GameSalad Joystick support

13

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    edited December 2014
  • MediaBrosMediaBros Member, PRO Posts: 26

    If any one can help with the amazon controller support. that would be great??

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    Go vote for it if you want it sooner please.
    http://bugs.gamesalad.com/show_bug.cgi?id=254

  • SocksSocks London, UK.Member Posts: 12,822
    edited January 2015

    If @BlackCloakGS pulls this off (and I don't doubt he will !!) - could the project be extended to supporting bluetooth keyboards ?

    Hooking your iMac bluetooth keyboard up to your iPad is really straightforward, but GameSalad doesn't recognise it, it would be great if it did, allowing you to make games with nice tactile keyboard control (as an option alongside onscreen touch controls).

  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250

    Yes my lib can be extended to support bluetooth keyboards or any HID device . However, not the first priory of the lib.

  • SocksSocks London, UK.Member Posts: 12,822

    @BlackCloakGS said:
    Yes my lib can be extended to support bluetooth keyboards or any HID device . However, not the first priory of the lib.

    Great ! It'd really cool to see it added once you've sorted out the joystick functionality.

  • MediaBrosMediaBros Member, PRO Posts: 26

    Sounds Great Cheers! @BlackCloakGS

  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250
    edited January 2015

    Though question how should you interact with the gamepad/joysticks in GameSalad? What kind of interface would you like to see?

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Maybe something like the keyboard key press interface that shows an image of the joystick and you choose which button/direction/trigger will be used in the condition.

    That is just a first thought, if something else comes to mind I'll post as well.

  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250
    edited January 2015

    @jamie_c that was my first thought as well. However unlike keyboard you can have more that one connected (i know you can connect more that one keyboard to a computer but they still throw the same event unlike a two or more joysticks).
    Also think about what if there are more then one controller connected. How would you use that for multiplayer games?

  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772

    Yeah, you're right. And there are a lot of joysticks/controls that offer different sets of buttons and controls on the market. Seems like something more generic might be needed, like choices of up/down/left/right, button 1/2/3/4, etc... but still not sure that is very workable.

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069

    Well... thinking about how there is no standard controller, a nice GUI might not be the best option. How about a drop down menu with list of available binds like in the code:

            XAxis,
            YAxis,
            XAxis2,
            YAxis2,
            LastAxis,
            DPadUp,
            DPadDown,
            DPadLeft,
            DPadRight,
            LastDPad,
            Button1,
            Button2,
            Button3,
            Button4,
            Button5,
            Button6,
            Button7,
            Button8,
            Button9,
            Button10,
            Button11,
            Button12,
            LastButton,
            Trigger1,
            Trigger2,
    

    And then maybe an option for control detection similar to touch count.

    So like a game.controlcount

    So we could do rules like:

    if game.controlcount = 1
    
    when actor recieves event Button1 = pressed (true)
    
    do rule
    

    Follow us: Twitter - Website

  • AlchimiaStudiosAlchimiaStudios Member Posts: 1,069
    edited January 2015

    @BlackCloakGS Actually thinking about that, it probably wouldn't work. But combining them might.

    The rule could be:

    when controller (Drop down menu) 1/2/3/etc recieves event (drop down menu) button 1/2/3/etc pressed

    Follow us: Twitter - Website

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited January 2015

    Could make selector thing and make a expression editor and make the controls like accelerometer.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    Xbox and ps4 could now be added right?

  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250
    edited January 2015

    I could if I had a dev kit.That would be way in the future.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    @BlackCloakGS said:
    They could if I had a dev kit.That would be way in the future.

    I am sure they will say yes if you ask, right?

  • zzap64zzap64 Member Posts: 405

    came across this today
    Apple Invents a Home Button that Doubles as a Gaming Joystick
    http://www.patentlyapple.com/patently-apple/2015/01/apple-invents-a-home-button-that-doubles-as-a-gaming-joystick.html

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694
    edited January 2015

    @zzap64 said:
    came across this today
    Apple Invents a Home Button that Doubles as a Gaming Joystick
    http://www.patentlyapple.com/patently-apple/2015/01/apple-invents-a-home-button-that-doubles-as-a-gaming-joystick.html

    That is pretty cool, apple will probably not add it any time soon or at all. Apple does not like buttons let alone a joystick.

  • scottharrrules43scottharrrules43 Tulsa, OklahomaMember, PRO Posts: 694

    Any updates?

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    edited January 2015

    @BlackCloakGS said:
    Though question how should you interact with the gamepad/joysticks in GameSalad? What kind of interface would you like to see?

    I've been thinking of how you could define this in game salad all weekend, and i came up with this, and it looks like some other people had a similar idea. Not sure if it's a great implementation, but it's something.

    • Stick Angle would return a value of 0-360 depending on where the stick is
    • Stick Magnitude would return a value of 0-100 depending on how far it is from the center
    • Buttons would return a true or false if they are pressed.

  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250
    edited January 2015

    @scottharrrules43 yes but i can't talk about them publicly right now.

    @jonmulcahy i think you are on the right track but have a few things for you to think about.

    Joysticks/GamePads analog sticks come in different min - max and and min can be negative. Also they comprise of to axis x and y and while one can map that to a angle and magnitude most good libs map each axis to -1.0 to 1.0 (min-max) so zero is half way. Also if the joysticks were devices how may should we support? The desktop and phone could support as may as bluetooth and USB would allow. Also how in this system do you deal with a controller being disconnected and then reconnected? May be we should introduce a concept of player like xbox, wii, and Playstion do. Where each controller is assigned a player number ? Thoughts?

    Also would you want a way for the joystick to throw keyboard events?

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    @BlackCloakGS‌
    haha it's more complicated that I imagined.

    @BlackCloakGS said:
    Also they comprise of to axis x and y and while one can map that to a angle and magnitude most good libs map each axis to -1.0 to 1.0 (min-max) so zero is half way

    That makes sense, it reminds me of the joystick template that used to come with GS way back when. I think if GS handled the physical button output the same way the onscreen joystick did, it would be easy to constrain the players movement to those variables instead of the custom attributes we created.

    @BlackCloakGS said:
    Also if the joysticks were devices how may should we support?

    I would imagine you'd want a minimum of 2, and since (i expect) the OS would provide some of the hooks into the Bluetooth devices, you'd want a way to map the joysticks to a certain player, like in the old Nintendo games where the first person to hit X would be player 1. If gamesalad just provided us a list of joysticks (like we do with touches) we could then add custom code to link those joysticks to onscreen actors in a configuration page to allow them to configure the joystick -> player matchup ingame. I think we have 10 touches prelisted under devices, maybe start with 4 joystick entries?

    @BlackCloakGS said:
    Also how in this system do you deal with a controller being disconnected and then reconnected?

    Maybe have something like the callback attribute in the network function. As long as a device is connected this callback attribute is true. Then we can code ourselves a catch if the callback turns false, display an error message

    @BlackCloakGS said:
    Also would you want a way for the joystick to throw keyboard events?

    I think this could be a good idea too. I can't really think of any real world applications right now, but the more flexibility the better.

  • Thunder_ChildThunder_Child Member Posts: 2,343
    edited January 2015

    What about joystick calibration?

    I use a GS13 controller that mimics keyboard presses. it has a thumbstick but is not variable as I use it W,S,A,D

    In an old Quake Clan...back in da day...we used a Quake setup....on the keyboard for all sorts of movements...when I got a GS13 we simply transfered those key commands to the joystick. Thats a great real world application I woukd think. Maybe hmmmm? :smile:

  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250

    @jonmulcahy what about single player game? I would think the min joysicks would be 1. If we went the way of the touch method you could only ever have 12 joysticks connected (or some finite number) with may be ok. Seems kind of limiting. The xbox and other devices with the concept of players assign the joystick a player number (android does this as well) and the first joystick connect is for player one and so on. If the joystick throws keys it would make logic easier for making a game support keyboard and joystick. You just add behavior for keyboard presses and then make the joystick trow key events for the buttons.

  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250

    @Thunder_Child the joystick lib will do automatic joystick calibration as well as dead space for the analog sticks ( i still need to finish that code) .

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    edited January 2015

    @BlackCloakGS said:
    jonmulcahy what about single player game? I would think the min joysicks would be 1. If we went the way of the touch method you could only ever have 12 joysticks connected (or some finite number) with may be ok. Seems kind of limiting. The xbox and other devices with the concept of players assign the joystick a player number (android does this as well) and the first joystick connect is for player one and so on. If the joystick throws keys it would make logic easier for making a game support keyboard and joystick. You just add behavior for keyboard presses and then make the joystick trow key events for the buttons.

    oops, forgot about single player games. I was thinking only in multiples. I think assuming that joystick1 is player1 is the way to go. It's easier to implement on our end and people are used to that system.

    That seems right on about the keyboard events. That's how I would like to do it.

    How could you envision adding logic for an infinite number of joysticks/players? Would you just define an actor as 'playerX' and that actor would accept the values from joystickX? That's the part I can't wrap my head around. I'm so used to constructing my code based on that column view, if we don't have a defined list, how do we assign events

  • BlackCloakGSBlackCloakGS Member, PRO Posts: 2,250

    I was thinking of players as devices and that a joystick would be under them. So you could say player1.joystick.dpadup == true or player1.joystick.yaxis >0 (for example). The joysticks would be assigned just like the consoles do it (or if the platform already has player assignment we would respect that). Then eventually we would have some way to show you the joysticks not assigned to a player and then you could assign them to a player. I was think of having a max of 4 to 8 players? Thoughts?

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    @BlackCloakGS said:
    I was thinking of players as devices and that a joystick would be under them. So you could say player1.joystick.dpadup == true or player1.joystick.yaxis >0 (for example). The joysticks would be assigned just like the consoles do it (or if the platform already has player assignment we would respect that). Then eventually we would have some way to show you the joysticks not assigned to a player and then you could assign them to a player. I was think of having a max of 4 to 8 players? Thoughts?

    works for me! Personally I would go with 8 players instead of 4. I would expect back end code is not too much different for 8 players vs 4. And it would give everyone more flexibility.

  • ThunderfalconThunderfalcon Member Posts: 15

    Wow... This sounds cool can hardly wait to see that update, and feature of course... I'll whip up something with game maker studio professional and use it to make the money to buy gamesalad at once... Is it ok if we use 4 game development software companies, say (scirra's construct 2, yoyogames's game maker, your gamesalad, unity)(just wondering is all)? Well provided the games we make for the gamesalad arcade are made with gamesalad of course, so on?

Sign In or Register to comment.