Input manager

Input manager

Postby acme_pjz » 15 Jan 2012, 17:29

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!
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Input manager

Postby Edward_Lii » 16 Jan 2012, 16:37

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?
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Input manager

Postby acme_pjz » 26 Jan 2012, 10:35

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?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Input manager

Postby Edward_Lii » 26 Jan 2012, 18:04

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.
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Input manager

Postby acme_pjz » 27 Jan 2012, 07:11

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...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Input manager

Postby Edward_Lii » 27 Jan 2012, 16:46

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). ;)
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Input manager

Postby acme_pjz » 28 Jan 2012, 08:35

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?
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Input manager

Postby Edward_Lii » 28 Jan 2012, 09:37

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?
From,
Edward_Lii
User avatar
Edward_Lii
MnMS Moderator
 
Posts: 777
Joined: 20 Dec 2010, 16:46

Re: Input manager

Postby odamite » 28 Jan 2012, 13:45

@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.
User avatar
odamite
 
Posts: 166
Joined: 16 Jan 2012, 16:28

Re: Input manager

Postby acme_pjz » 28 Jan 2012, 18:35

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...
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Input manager

Postby acme_pjz » 01 Feb 2012, 07:57

Hi odamite,

The two different key configurations is implemented, please have a try :)
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Re: Input manager

Postby odamite » 01 Feb 2012, 12:50

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
User avatar
odamite
 
Posts: 166
Joined: 16 Jan 2012, 16:28

Re: Input manager

Postby MCMic » 01 Feb 2012, 15:40

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.
User avatar
MCMic
 
Posts: 723
Joined: 05 Jan 2010, 17:40

Re: Input manager

Postby acme_pjz » 01 Feb 2012, 16:59

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.
Some of my open source games on GitHub
User avatar
acme_pjz
 
Posts: 665
Joined: 10 Dec 2009, 15:32
Location: PeeKing, China

Who is online

Users browsing this forum: No registered users and 1 guest

cron