Saturday, 21 June 2014

Configurable Controls - Finally

Writing Japanese in such low res is hard
So I've added keyboard-config & gamepad support. GM:S newer gamepad functions only works with newer controllers (using Xinput), but in hopes of making Labcoax compatible with older gamepads (using DirectInput), I've added the older functions. I've tested the old functions but i'll need to get a new controller to test the newer Xinput functions.

Programming the input configurations took a good amount of time. The UI too. It'd be great if I could know some of your go-to control schemes for platformers. Example below:

Directions: Up, down, left and right  (Up in Labcoax is an 'interact with objects' button)
Shoot: Primary attack
Jump: Self-explained
Weapon/Ammo change: Switching between 4-5 different shot types
Skill/Evasion: For maneuvers like backhop and etc.


Direction: Up, down, left and right arrow buttons
Shoot: C key
Jump: X key
Weapon/ammo change: V key
Skill/Evasion: Z key

Gamepad (modify button names as per your controller e.g. PS2/3, XBOX, ... )

Direction: D-pad
Shoot: [ ] button
Jump: X button
Weapon/Ammo change: Triangle button
Skill/Evasion: O button

Though it doesn't really matter what schemes since it'll be configurable via menu options, I just wanna see if some of you might have crazy configurations. Crazy configurations give rise to possible scenarios in which my configurations handler would fail.

*Note: From what I've gathered, GM:Studio's latest gamepad support functions (for Xinput) is most compatible with XBOX controllers. For everything else, there may be a need to emulate your non-XBOX controllers as XBOX controllers using programs like xbox360ce and the like.

P.S: My translation is shit


  1. Ooh, fun!


    Direction: Up, down, left and right arrow buttons
    Shoot: Left Shift
    Jump: Z
    Weapon/ammo change: X
    Skill/Evasion: A

    PS3 Controller (I use a program that translates the input to be recognized by games as a 360 controller):

    Direction: D-pad
    Shoot: [ ]
    Jump: X
    Weapon/Ammo change: R1
    Skill/Evasion: L1

    This is based only on the control style that only includes those functions, of course; If there's some sort of special attack I always map it to X, meaning Weapon Change would have to be moved to another key (Left Ctrl would be my goto key in that instance).

    1. What program do you use to emulate the 360 controller, if you don't mind me asking?

      I see you like threading dangerously close to the windows button.

  2. If the game is on a computer I use a keyboard. PERIOD.
    Direction: Up, Down, left, right
    Attack: Z
    Jump: Up or X (Depending on what the Up direction is used for)
    Dodge/Evade: Left shift
    Weapon Switch: A and/or S

    1. Ah I forgot to write down that Up in Labcoax would be used for interactions. Also, holding up and attacking let's you use an alternate attack (much like in Castlevania's specials like the arcing axe)

  3. The translation isn't bad. The main problem is that the ッ doesn't look right, so almost every word looks wonky (e.g. "Ashippu" for "Up"). The ッ character should be significantly smaller than it is, and its lines should be more vertical. Otherwise, it's impossible to distinguish it from a シ or ツ.

    Less of a problem is that up should be 上 and down should be 下, to keep the kanji notation consistent.

    Fixing those two things would make the Japanese look perfect.

    1. those kanji mean above(上) and under(下).
      The katakana notation is frequently used to describe moves in japanese games anyway.

    2. 'AMMO' is translated as '攻スワップ' which means attack swap (as you probably already know). however writing 'swap' in katakana makes it into a noun, changing its meaning into 'an exchange'. 'To change' should be written as '変わる' making the complete translation '攻を変わる'.

    3. Thanks for the input y'all.

      I'll make the changes to the translation, but '攻を変わる' is gonna be hard to put into an 8x8 pixels. Maybe pattern ( 'パターン' ) could be an alternative?

      I could also try using icons or signs instead. Like that refresh button look on your browser.

    4. 攻を変わる is a bad translation. 攻スワップ is an weird abbreviation, but it gets the meaning across fine. I would suggest using 弾薬変更, ダンヤク or something along those lines, as suggested below.

      For up and down, Japanese would recognize what you mean by アップ and ダウン. However, kanji is preferable because the transition from アップ and ダウン to 左 and 右 is awkward.

  4. Personally, when I play a game using the keyboard, I find that it's much easier to map the action controls to an A S Z X scheme, instead of spreading it all along the bottom row as you have with the Z X C V right now. It keeps all of the buttons together making it a bit faster to push what I want, and I find I'm less likely to shift my hand off of the buttons that way

    1. I prefer asdf to zxcv. Gives you the little home row bump for finger placement and your palm for space. Plus you can shift up to qwer or down to zxcv quickly for extra buttons. Rather than some games that use zxcv for primary keys and asdf as secondary keys.

      Though from running emulators I prefer to use numpad 4568 as generic controller buttons, 79 as trigger buttons, wasd as movement, and qe as triggers. Then space/shift as start and select. It was the most comfortable way I found to emulate games befo

  5. Just wanted to thank you for that feature.

    1. Not publicly tested yet, hope it works when I put up the next release

  6. Hi there, I think the '攻を変わる' would sound much natural if you wrote it like '武器変更'(change weapon) or '弾薬変更'(change ammo), if you feel some pain in using kanji or long phrases, than instead 'ダンヤク'(DAN YAKU ammo) or 'ソウビ'(装備 SOU BI equipment/arm) should be enough to notice its meaning to the japanese gamers.
    Hope that I'm being some help.

    I'm from japan and please turn a blind eye if I said something rude. Japan is not a good place to get experience in using english, you know...

    1. Anyone is welcome! It's good to know that news of this development reached the far east. Feedbacks are important.

      I think I will use the DAN YAKU you suggested. I hope it is enough to convey the meaning. Thanks for the response.

  7. Is multiple bindings to the same button gonna be possible? For combo abilities. If you have extra buttons left over maybe make them further customizable by allowing a player to set a button which activates two or three different buttons at once?

    1. Well there's currently no validation for assigning 2 same buttons. I don't think it'll work well if you do that.

  8. Wow, programming that must have taken a lot of time.
    I'm barely able to program regular customizable keyboard controls.
    Implementing controler support is nearly impossible for me ^^"
    (I decided to skip that for now...)

    Did you figure it out by yourself or is there a good tutorial to learn from?
    Anyway, nice job!

    Keep the good work up! ^^

    1. Hey, long time! I referred to an example and scoured the forums a bit before I finally get the idea. Coding and implementation came after. I've only done minimal testing, it might not be perfect.

      Gamepad config is a bit trickier because there can be more than one at one time, and there's 2 different set of functions to read them (namely joystick set and gamepad set).

      Good luck to you too!

    2. Thank you very much!

      Yes, the gamepad config seemed a bit confusing to me, so I decided on only implementing keyboard keys customization for the time being.
      (there's still JoyToKey that can be used to use a gamepad, but well... that's extra software that needs to be downloaded by the players...)

      So, my "solution" isn't ideal, but I decided not to spend too much time on it ^^"
      (maybe I'll do that sometime in the future)

      Thinking about it.
      I remember now (yes, just "now") why I didn't do it...
      GMS has commands for checking when a keyboard key has been "released".
      But as far as I know, there's no command for checking if a gamepad key has been "released"... or did I miss something?
      (so yes, realizing that, I just decided to skip on it for now, instead of having to program a lot of stuff just to "fix" that...)

      I mean, of course it's manageable somehow, through coding and stuff.
      But I simply decided on not investing too much time into this.

    3. Yeah I was stumped at that part too. The joystick_ functions don't have checks for button presses and releases, only hold. I got around this by having am object that reads joystick input and simulate a keyboard equivalent button (press > hold > release order).

      Fortunately, the newer gamepad_ functions for GM:S have checks for button presses and releases, unlike the older joystick_ functions!

    4. Oh, I didn't know that there's a difference in both functions.
      Thank you very much for the advice/information.

      In this case, "maybe" I'll try implementing the gamepad support later on.
      But just maybe, I'll have to implement, test and solve some other (more important) stuff first.
      Anyway, this makes gamepad implementation a lot easier, thanks again ^^

  9. This seems like an odd thing to get sidetracked with. Why worry about remapping keys when you still have a ton of content to do? Unless you just got bored and needed something else to work on content is gonna get you a lot more interested people at this stage than key remapping

    1. It stuck with me when someone suggested key config so I looked around a bit. I looked around a lot. Shit, I got sidetracked!

    2. I take full responsibility for initiating this sidetrack.
      I regret nothing !

  10. You be living? How goes the project?