Input manager
#1
Posted 31 May 2012 - 05:41 PM
First, this should be an optional way of doing things, not something forced on you, but the code wouldn't be too extensive so I don't think it would be necessary to include an option to turn it off, but it could be set like that as a global game option.
Second, the game designer defines a certain amount of "actions" which would include things like "run" and "jump" and even "left" and "right." Then they give a "default" keyboard key for each of these things. Then, GM provides functions that allow the game player to customize the controls at run-time, and the game designer calls these functions when his GUI buttons are clicked allowing this. The function call would return instantly, but set up a "thread" that waits a given amount of time(probably defined by the designer) that waits for the player to hit a key, or move a joystick axis or joystick button. Then whatever got moved gets set as the control for the given action. Also, the function would call a script(also defined by the designer) when either the control gets set, or a different one when time runs out. This is how the designer would know that the function call is finished so they would remove the indicator telling the player to press the button for an action. Assuming this was internal to GM, they could actually instead put these "callbacks" as events.
Third, at gametime, the game objects either react to the new action based events, or they call related functions, instead of checking inputs directly. This allows game code to not care if the player chose a joystick button, keyboard key, or any axis on the joystick and the game's code(or d&d) would work all the same. The exception to this could be if the designer designs with joystick axes in mind where the character would walk instead of run(or similar things).
To go along with this, you could provide different events similar to the current keyboard events, which would include the "just now pressed" event and the "is currently down" event which would fire every step until released, and also the "released" event. You could also even add a variable that would say for how long the action's input has been held down(which my extension does for you). It also needs a way to determine input "conflicts" so that the designer can advise the player if more than one action has the same input. Also very important is a way to save and load configurations, including the "default" configuration.
As far as mobile platforms go, if a game is not directly designed with touch/mouse in mind, it would mostly use virtual keys for the input, although it could use a "virtual joystick" as seen in other topics. If working with my suggestion, you would simply map those virtual keys to either "actions" or do a workaround mapping them to the "default" keys as set up for the input, though I think going directly to "actions" is better.
What does the community think of this? Right now we have to kind of roll our own code for this, use an extension(and mine is the only one), or simply now allow the player to customize the controls, which is very common with GM games. i think if GM provided this internally, many more games would allow custom controls. By doing this internally, it becomes event based, making it easily compatible with d&d, but you can also provide functions so things can still be done in step events. This caters to however the game designer feels is best to organize the code.
#2
Posted 31 May 2012 - 05:51 PM
#3
Posted 31 May 2012 - 05:56 PM
a keybind dialog box(wording...) would be great to be implemented by YOYO both for setup in IDE and in the game like a standard one just like colour wheels exist in many paint programs and such
I don't think we would want to use the "default" box for run-time in our games for the same reason it was ugly to use GM's default message boxes. Of course it needs to be there for the IDE though, and for the run-time it could be as well, but it should be optional, or be able to be well customized, which would then lead me to suggest an internal GUI system that is nicely skinnable.
#4
Posted 31 May 2012 - 06:52 PM
#5
Posted 31 May 2012 - 11:56 PM
Again, though, I do think making a tutorial for how to do something along these lines would be helpful to a lot of people! Not everyone takes advantage of customizable controls, but it's worth the small effort to implement for those who do!
#6
Posted 01 June 2012 - 12:14 AM
My point is that though these things can be done via scripting or an extension, it won't have that truly tight integration with the IDE that only the yoyo team could accomplish.
#7
Posted 01 June 2012 - 12:15 AM
My point is that though these things can be done via scripting or an extension, it won't have that truly tight integration with the IDE that only the yoyo team could accomplish.
#8
Posted 01 June 2012 - 12:20 AM
#9
Posted 01 June 2012 - 01:34 AM
The issue we are having isn't how the code it, rather that we can't integrate it well into the IDE, rather only in scripts and objects. And for example for my extension, I created a separate program for creating default configs, which you then load via a function call, but it could be better if such a dialog existed as part of the game maker environment.
#10
Posted 29 July 2012 - 04:44 AM
I think this is a pretty good suggestion, but no one paid much attention.... oh well. I'm not whining
None of the devs responded, maybe I'll get lucky this time.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











