Page 1 of 1

Input manager

PostPosted: 15 Jan 2012, 17:29
by acme_pjz
Hi everybody,

Now input manager just works :) I'm uploading it to SVN. Currently not all input are managed by InputManager, and the key config screen is a bit ugly. Any improvements and bug tests are welcome!

Re: Input manager

PostPosted: 16 Jan 2012, 16:37
by Edward_Lii
Hello acme_pjz,

acme_pjz {l Wrote}:Now input manager just works :) I'm uploading it to SVN. Currently not all input are managed by InputManager, and the key config screen is a bit ugly. Any improvements and bug tests are welcome!

It's a start, I think we should make a screen with buttons and after pressing the button you can configure that key.
And perhaps there should be a feature to loop through the controls to configure them one by one?

Anyway, how should we implement joystick support?

Re: Input manager

PostPosted: 26 Jan 2012, 10:35
by acme_pjz
Hi Edward_Lii,

IMHO we should have joystick support and some time ago I have written a game which uses SDL for joystick input.

But we have a minor problem: how we recognize different joysticks? Currently I'd like to assume there is only one joystick plugged to computer when playing MnMS :| the reason is if we want to support multiple joysticks we must save the index of joystick and when the game restarts the index may changes; if we use the name of joysticks to identify them, then it won't work under Windows because all joysticks under Windows got the same name :(

But if we only support one joystick, then in some system it said that there will be a fake joystick, see STK forum, so our program may run into trouble... Any suggestions?

Re: Input manager

PostPosted: 26 Jan 2012, 18:04
by Edward_Lii
Hello acme_pjz,

acme_pjz {l Wrote}:IMHO we should have joystick support and some time ago I have written a game which uses SDL for joystick input.

But we have a minor problem: how we recognize different joysticks? Currently I'd like to assume there is only one joystick plugged to computer when playing MnMS :| the reason is if we want to support multiple joysticks we must save the index of joystick and when the game restarts the index may changes; if we use the name of joysticks to identify them, then it won't work under Windows because all joysticks under Windows got the same name :(

But if we only support one joystick, then in some system it said that there will be a fake joystick, see STK forum, so our program may run into trouble... Any suggestions?

I'm afraid I haven't got any experience with SDL and joysticks, but it seems quite troublesome (for multiple joystick support).
Wouldn't it be best if we could somehow treat them as one, handling axis-x up the same no matter which joystick?
This way it doesn't matter if there's a virtual and/or multiple joysticks.

Not sure if that's easy to do, I'll have to take a look at the joystick system of SDL.

Re: Input manager

PostPosted: 27 Jan 2012, 07:11
by acme_pjz
Hi Edward_Lii,

Edward_Lii {l Wrote}:Wouldn't it be best if we could somehow treat them as one, handling axis-x up the same no matter which joystick?
This way it doesn't matter if there's a virtual and/or multiple joysticks.


You mean we should treat axis-x up of joystick 1 and axis-y up of joystick 2 the same? This is a good idea, I can implement this :) But there is still a minor problem, in STK forums some user reports that they have a bogus (virtual) joystick which will constantly send false positives :| IMHO currently we should ignore this situation first...

Re: Input manager

PostPosted: 27 Jan 2012, 16:46
by Edward_Lii
Hello acme_pjz,

acme_pjz {l Wrote}:You mean we should treat axis-x up of joystick 1 and axis-y up of joystick 2 the same? This is a good idea, I can implement this :)

Yes, only look at the action that is done (e.g. axis-x up) regardless of which joystick.

acme_pjz {l Wrote}: But there is still a minor problem, in STK forums some user reports that they have a bogus (virtual) joystick which will constantly send false positives :| IMHO currently we should ignore this situation first...

I think it's best to ignore this situation (for now). ;)

Re: Input manager

PostPosted: 28 Jan 2012, 08:35
by acme_pjz
Hi,

I have implemented joystick support in SVN 212. But currently I don't have joysticks, so I can't test my code. Could anybody test the code?

Re: Input manager

PostPosted: 28 Jan 2012, 09:37
by Edward_Lii
Hello acme_pjz,

acme_pjz {l Wrote}:I have implemented joystick support in SVN 212. But currently I don't have joysticks, so I can't test my code. Could anybody test the code?

Sadly I can't test the code. :(

I tried some stuff with a virtual joystick and in the end the player kept walking to the left.
Not sure if this is a problem with the code or with the virtual joystick?

Re: Input manager

PostPosted: 28 Jan 2012, 13:45
by odamite
@acme_pjz
I have tested it with a gamepad and it's working perfectly! :D Configuring works with all buttons and both d-pad and analog sticks. Thank you very much! Just one thing I would like to see is two different configurations: one for keyboard and the other joystick/gamepad. I don't have my gamepad plugged on my computer all the time when I want to play Me and My Shadow so this feature would be nice.

Re: Input manager

PostPosted: 28 Jan 2012, 18:35
by acme_pjz
Hi odamite,

odamite {l Wrote}:Just one thing I would like to see is two different configurations: one for keyboard and the other joystick/gamepad. I don't have my gamepad plugged on my computer all the time when I want to play Me and My Shadow so this feature would be nice.


OK, maybe next day or so...

Re: Input manager

PostPosted: 01 Feb 2012, 07:57
by acme_pjz
Hi odamite,

The two different key configurations is implemented, please have a try :)

Re: Input manager

PostPosted: 01 Feb 2012, 12:50
by odamite
Hello acme_pjz,

Thanks for the whole InputManager. You've done fantastic work there! On top of that you've added two different configurations! And everything works great. So thank you again! :D

Re: Input manager

PostPosted: 01 Feb 2012, 15:40
by MCMic
acme_pjz {l Wrote}:Hi odamite,

The two different key configurations is implemented, please have a try :)

The up key and the jump key should not be the same one.
On a gamepad I'd like to jump with a button but use the direction cross in the menus for instance.
Same thing for down and activate.

Re: Input manager

PostPosted: 01 Feb 2012, 16:59
by acme_pjz
MCMic {l Wrote}:
acme_pjz {l Wrote}:Hi odamite,

The two different key configurations is implemented, please have a try :)

The up key and the jump key should not be the same one.
On a gamepad I'd like to jump with a button but use the direction cross in the menus for instance.
Same thing for down and activate.


OK, implemented.