User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19

Thread: How to set up 8-directional movement with Xbox controller?

  1. #1
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)
    MrSnakeGaming's Avatar
    Join Date
    Aug 2016
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to set up 8-directional movement with Xbox controller?

    I've tried a lot of different ways to get it to work but now I've just given up. Does anyone know a way to get 8-directional movement to work with an Xbox controller? Thanks!

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleUniversal Windows Platform Export Module

    Join Date
    May 2014
    Posts
    94
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Are you talking about the default eight direction movement?

    The first thing I would recommend is checking out this example. It covers the basics of the XBOX Gamepad object.

    If you don't want to make a custom movement, I suggest using the bouncing ball movement. That way, you're not fighting with the built-in control mapping that the 8-dir movement has.

    Make a value someplace to track the angle of the left stick. Ex: ATan2(( StickLeftV( "XBOX Gamepad", 1 ) * -1.0 ), StickLeftH( "XBOX Gamepad", 1 ))

    Also make a value that changes when you've moved the stick outside of the dead zone. (0 for inside dead zone, 1 for outside dead zone).

    So, when your inside/outside dead zone value is 1 and that angle value is within whatever range, move in a direction.

    It's still coffee time here, but I hope this helps.

  3. #3
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    618
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    I strongly recommend VACCiNE, it makes everything to do with gamepads easier: https://clickstore.clickteam.com/vaccine_2

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleUniversal Windows Platform Export Module

    Join Date
    May 2014
    Posts
    94
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by elvisish View Post
    I strongly recommend VACCiNE, it makes everything to do with gamepads easier: https://clickstore.clickteam.com/vaccine_2
    I have to disagree a bit with that recommendation, and that's based on what I've seen without using it. Not only is the video a bit misleading on what the XBOX Gamepad and Joystick 2 objects can do, but it also seems to rely on Control X (Key Object always gets me a better result). Can't speak for how easy it is.

    If it's a quick solution that works okay for people, that's great. However, XBOX Gamepad, Joystick 2, and Key are not that complicated once you figure them out.

  5. #5
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    618
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by raxabit View Post
    I have to disagree a bit with that recommendation, and that's based on what I've seen without using it. Not only is the video a bit misleading on what the XBOX Gamepad and Joystick 2 objects can do, but it also seems to rely on Control X (Key Object always gets me a better result). Can't speak for how easy it is.

    If it's a quick solution that works okay for people, that's great. However, XBOX Gamepad, Joystick 2, and Key are not that complicated once you figure them out.
    I've used VACCiNE extensively and Xbox control works out the box, it's very exhaustive and you can modify any aspect you want to suit your needs. @Volnaiskra knows what he's doing

  6. #6
    Clicker Fusion 2.5 (Steam)Android Export Module (Steam)
    MrSnakeGaming's Avatar
    Join Date
    Aug 2016
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply! I've been studying the example for quite a bit and have gotten pretty comfortable with it. Thanks again!

  7. #7
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Volnaiskra's Avatar
    Join Date
    Jan 2014
    Location
    www.sprykegame.com
    Posts
    2,124
    Mentioned
    76 Post(s)
    Tagged
    0 Thread(s)
    The Xbox Gamepad object is pretty good if you definitely only want Xbox controls. It's relatively easy to use, and should be adequate for many needs. Though IIRC it won't give you 8-directional, 360-degree or analog strength information - just X and Y information, which you'd need to convert using trigonometric equations if you want that information. If you want support for Playstation or other gamepads, then you need Joystick 2, which is a whole other story.

    Quote Originally Posted by raxabit View Post
    .....Joystick 2.....[is] not that complicated once you figure [it] out.
    Sorry, but that's just not true. Joystick 2 is way more complicated than it should be. It contains various errors and inconsistencies that are certain to break your game in certain situations and/or on certain gamepads, provides much of its information in convoluted and inconsistent ways, has inconsistent and/or missing deadzones, and fails to measure basic things like how hard certain joysticks are being pressed, or what direction they're pointed. I could give you a huge list of its problems and inconsistencies, but I've already done that elsewhere, so I'll copy and paste that. Behold, a little taste of the uncomplicated and user-friendly world of the Joystick 2 object:


    The PS4 joystick gives you both 8-directional and 360-degree values. But you have to press the stick significantly harder to register the 8dir one. 8dir starts at 0 but 360deg starts at -1, and while one goes clockwise, the other goes anticlockwise. But at least they both start at east. Unless you're talking about the right joystick, in which case they both start at south. Just for fun, the dpad starts from north (oh, and the value you'll get when pressing north on the dpad just happens to identical to the one you'll get if no gamepad is detected, so have fun with that). If you want to know how hard you're pressing either of the sticks, you'll need to calculate it yourself from the X and Y values. The X and Y values from the left stick are given as RawX and RawY, and both go from -1000 to 1000. On the other hand, the X and Y values of the right stick are given as RawZ and RawZrotation. Like RawX and RawY, RawZ goes from -1000 to 1000, but RawZrotation (which actually has nothing to do with rotation) likes to really express itself, so goes from 0 to 65535. But at least the use of RawZRotation doesn't conflict with the Xbox gamepads, which the use of RawZ does, since RawZ is what Xbox uses for the triggers (well, unless a player is on Windows 10 with native drivers, in which case their right trigger is measured in RawZrotation). Anyway, the Xbox left stick works much like the PS4 one, complete with inconsistent measurement methods and mismatched deadzones. But the Xbox right stick missed the memo and doesn't bother giving you 8dir, 360deg or analog strength data at all. Well, not real data anyway - it does give you a permanent false positive for 'moving left', so there's that. But it provides X and Y info (from 0 to 65535) so stop interrupting its nap and work it all out for yourself (hope your trigonometry is up to scratch!). Oh, and it has absolutely no deadzone, so you'll need to program one in yourself unless you want erratic micro-movements pretty much nonstop.............Simple, right?

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleUniversal Windows Platform Export Module

    Join Date
    May 2014
    Posts
    94
    Mentioned
    6 Post(s)
    Tagged
    0 Thread(s)
    It's true that it's a disaster if you try bringing analog to the table. If analog controls aren't needed, it's really not that terrible.

    Some things have to be left up to the user to change (mainly right stick axes). In the case of the Xbox Gamepad object, it might be a good idea to leave an option for the user to adjust the dead zone.

    Do you think Joystick 2 is inherently flawed, or is it DirectInput that is the problem?

  9. #9
    Clicker Fusion 2.5 MacFusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleiOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)
    elvisish's Avatar
    Join Date
    Oct 2014
    Posts
    618
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by raxabit View Post
    It's true that it's a disaster if you try bringing analog to the table. If analog controls aren't needed, it's really not that terrible.

    Some things have to be left up to the user to change (mainly right stick axes). In the case of the Xbox Gamepad object, it might be a good idea to leave an option for the user to adjust the dead zone.

    Do you think Joystick 2 is inherently flawed, or is it DirectInput that is the problem?
    The recent controller issues from a recently released and highly successful Fusion-made game on Steam was due to joystick2 having problems with steam overlay.

  10. #10
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCiOS Export ModuleInstall Creator Pro
    Julian82's Avatar
    Join Date
    May 2012
    Location
    outbuddies.com
    Posts
    910
    Mentioned
    44 Post(s)
    Tagged
    0 Thread(s)
    That is true, Dark Devotion and Aggelos both had controller issues on Steam-launch, due to the joystick2 extension. If a user on Steam has controller configuration enabled joystick 2 will either stop working in total or randomly mix up button and axis input. Many Steam users have these configurations enabled, and while this also produces issues in AAA titles like Seikiro, it remains a very bad thing, as we Fusion devs cannot fix joystick2 and it remains the only option to support generic controllers next to JoyToKey setups.
    TBH, with the options on Steam it is very easy to setup a JoyToKey solution for any game, but many players seem to get angry if gamepads do not work out of the box and refuse to fiddle around a bit.

    Xbox extension is a very good readout and works perfectly with Steam, but to have just Xbox support is not enough... My advice is at least to implement both readout in any commercial product to at least offer the player some options.
    I very much hope CT can fix these joy2 issues, I think the need is very much there, I don't know if this is technically possible tho.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How do I add a second Xbox controller?
    By C4PRO in forum Fusion 2.5
    Replies: 2
    Last Post: 22nd February 2017, 04:27 AM
  2. Replies: 1
    Last Post: 19th May 2016, 05:39 AM
  3. Replies: 6
    Last Post: 12th January 2015, 09:15 PM
  4. Xbox 360 controller
    By Fanotherpg in forum XNA Export Module Version 2.0
    Replies: 6
    Last Post: 23rd February 2012, 02:02 PM
  5. xbox 360 controller
    By Mauser in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 21st February 2012, 10:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •