home home

downloads files

forum forum

docs docs

wiki wiki

faq faq

Cube & Cube 2 FORUM


Sauerbraten Game Controller Support

by dbox on 03/22/2006 20:48, 39 messages, last message: 05/26/2006 09:53, 15979 views, last view: 05/18/2024 05:16

I thought I would start a new thread to announce the game controller support enhancement I recently just finished. You can check it out here (source code included):

http://www.quadropolis.us/node/171

I'm really curious to get feedback to see if there would be any other interest in this feature (and to know if it works for anyone else). If so, I would be happy to donate what I've done so far back to the project and expand on what is there now.

My general approach was to translate joystick events (button presses, hat and axis movements) into sauerbraten "keypress" events. This way you can use the bind command to map joystick events to actions. (There are examples of this in the quadropolis posting).

I did my best to add this without much modification to the existing code. I put all of the joystick event and logic into a single class (joystick.h) and only touched 3 other files:

main.cpp - added 4 calls to joystick class

engine.h, physics.cpp - added joymove() method (very similar to mousemove)

   Board Index    Go to next 20 messagesGo to last 20 messages

#1: New link

by dbox on 03/22/2006 21:37

Accidentally had it uploaded in the map section. Please use this link instead:

http://www.quadropolis.us/node/172

reply to this message

#2: no joystick fans

by dbox on 03/23/2006 20:09

Hmmm... after browsing through some old posts I'm starting to see why there is not too much interest in this subject.

When asked about joystick support back in 2002 Aardappel said:

"I am not going to implement joystick support for just 1 person, especially since you'd be better of learning proper fps controls. Trust me, within weeks of switching you'll be a dramatically better fps player."

And I got a kick out of this "tutorial" by spentron-postcrash2 in 2003 on how to use your joystick with Cube:

"1. Plug in joystick.
2. Play Cube with mouse and keyboard.

It is said that the only reason Quake has joystick support is to be able to properly demonstrate the superiority of mouse and keyboard."

reply to this message

#3: ..

by CC_machine4 on 03/23/2006 21:49

great, but the x and y of my looking direction are reversed lol

(i.e. i push the stick left and i look up, i push the stick up and i look left etc.)

reply to this message

#4: console ports

by Sean on 03/23/2006 21:50

One huge use of controller support would be to assist in a port to a console system. Mouse/keyboard kicks ass over a game controller any day for an FPS, but with some systems, you don't have any choice in the matter.

reply to this message

#5: Re: ..

by dbox on 03/23/2006 22:18, refers to #3

I bet it's more challenging that way.

You can actually switch that by changing the x and y axis variables in your config.cfg. So, if you have it set like this:

joyfovxaxis 2
joyfovyaxis 3

change it to this:

joyfovxaxis 3
joyfovyaxis 2

reply to this message

#6: Besides

by Pxtl on 03/24/2006 00:34

I get the impression this is primarily for single-player - and it's not like the monsters are agile enough to really demand your hyper-accurate mouseaiming skillz.

reply to this message

#7: Re: Besides

by dbox on 03/24/2006 01:56, refers to #6

Interesting assumption... personally, I'm not a real fan of single-player. I like knowing I'm up against other humans.

I think I got the idea because I've recently been playing some console games where the control is actually quite good (Halo2 for instance). I'm a software developer by profession and I spend most of the day hunched over the computer. It's kind of a nice break to kick back on the couch.

I've been a fan of Cube and Sauerbraten for a while and was just curious how it would work console-style.

Not as accurate? Maybe. I'll admit that I'm more accurate now with the mouse, but then it's just my first attempt at joystick support.

I know, we'll have a challenge. All the joystick fans out there can download my mod and help me get it as accurate as possible and we'll challenge all takers to an epic battle royal to settle the matter once and for all! Who's with me?

(I have the feeling it will be me vs. the rest of the sauerbraten community)

reply to this message

#8: Seriously

by Pxtl on 03/24/2006 02:09

This has been tried. Any time mousers play against joystickers, it's a bloodbath. Especially in frantic, fast-paced games like Sauer. Notice how _slow_ console FPS games are? The only fast-paced console FPS I can think of is OutTrigger, which relied on really powerful autoaim to handle the pace.

reply to this message

#9: Re: Seriously

by dbox on 03/24/2006 02:20, refers to #8

Hmmm... point taken.

So I'll put you down for Team Mouse then?

reply to this message

#10: Re: Seriously

by Passa on 03/24/2006 07:25, refers to #8

meh its good to have the option anyway.

some people WOULD prefer to play from the confort of their lounge, and console FPS games are not that slow, have a look at Halo 2 for example.

reply to this message

#11: Re: Seriously

by eihrul on 03/24/2006 08:30, refers to #8

Makes me wonder about mouse vs. the nintendo revolution's controller... :)

reply to this message

#12: Re: Seriously

by RealNitro on 03/24/2006 09:52, refers to #11

"Makes me wonder about mouse vs. the nintendo revolution's controller... :)"

It seems like Nintendo will encourage indie developers to write games for the Revolution, maybe somebody will port Sauerbraten...

reply to this message

#13: Re: Seriously

by Pxtl on 03/24/2006 14:03, refers to #12

By "indie" they mean "only $2000 per devkit" not "Free Software".

reply to this message

#14: Re: Seriously

by RealNitro on 03/24/2006 15:23, refers to #13

I know, but still. You never know somebody that has a devkit descides to port it... (Just dreaming here, I'm not saying somebody will.)

reply to this message

#15: improvements

by dbox on 03/24/2006 17:26

So I log on last night to do some testing with the old joystick and wouldn't you know it, there's Pxtl.

I'm not going to lie to you folks... I got handled.

But it did help me find some flaws with my design. So I went back to the drawing board and made some enhancements. By the end of the night I was actually holding my own pretty well against some established cube/sauerbraten players.

I'll be posting the updates later this afternoon.

Sign-ups are still open for the Joystick/Mouser Smackdown :). So far we've got dbox (or "joystick boy" as some of you started affectionately calling me last night) on Team Joystick vs. Pxtl on Team Mouse.

reply to this message

#16: Re: improvements

by dbox on 03/24/2006 23:21, refers to #15

As promised I have uploaded a new and improved version of the joystick support mod. Not only does it impact less existing sauer code (only minor modifications to main.cpp to make calls out to my joystick class) this one is exponentially better than the first attempt with regards to quality of control.

With the first one I was never really happy how "flat" the field of view control was. Now it is much more sensitive to how far you are moving the analog controller. Light pressure keeps the motion slow and controlled for aiming. Pressing hard right or left now lets you wheel around very quickly.

Personally, (and I know I'm probably biased) I think this release is getting pretty close to the level of control you would have with a console game.

I'd really like to hear some feedback from anyone who tries it out.

reply to this message

#17: Re: improvements

by dbox on 03/24/2006 23:22, refers to #16

You can get it here:

http://www.quadropolis.us/node/172

reply to this message

#18: Joystick for Cube

by dbox on 03/25/2006 23:17

Hey all. Just wanted to announce that I back-ported the joystick support to Cube. It's included in the same zip file now:

http://www.quadropolis.us/node/172

reply to this message

#19: Re: Joystick for Cube

by boilover_atwork on 03/26/2006 01:49, refers to #18

not as cool as my mod for sauerbraten

reply to this message

#20: Re: Joystick for Cube

by CC_machine4 on 03/26/2006 23:56, refers to #19

this mod is way cooler than yours, you mean.

reply to this message

   Board Index    Go to next 20 messagesGo to last 20 messages


Unvalidated accounts can only reply to the 'Permanent Threads' section!


content by Aardappel & eihrul © 2001-2024
website by SleepwalkR © 2001-2024
54039278 visitors requested 71820023 pages
page created in 0.026 seconds using 9 queries
hosted by Boost Digital