May 09, 2021, 05:56:39 pm

The Gang Garrison 2 Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

NOTICE: Due to a rise in bot activity, new posters need to be approved before posting.

Join the community Discord server!

Pages: [1] 2

Author Topic: [Client-Side] Controller Support 2.0  (Read 2769 times)

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
[Client-Side] Controller Support 2.0
« on: September 16, 2017, 03:30:47 pm »

Connect an XBox/PlayStation controller to your pc and you're ready to play Gang Garrison!

Because of the limitations of Game Maker 8 this is slightly harder that using Game Maker Studio, but this way you can even play with a steering wheel or a plane joystick! (Why though)

The controls are designed so that you'll almost never need to take your thumbs away from the analog sticks
More/better controls coming soon

(click to show/hide)
Want to use a PS3 controller like I do? Use SCP DS3!
« Last Edit: January 17, 2018, 10:59:10 am by PrOF »
Logged

Spazz

  • Seasoned Member
  • *****
  • Karma: 44
  • Offline Offline
  • Posts: 1933
  • Almost too much seasoning.
Re: [Client-Side] Controller Support 1.0
« Reply #1 on: September 16, 2017, 05:07:23 pm »

Custom controls when
Logged

<3 Bustatunez

Kevin Kuntz

  • Heroic Member
  • ****
  • Karma: -58
  • Offline Offline
  • Posts: 712
  • panda took the kids
    • Rav And Kill Bill
Re: [Client-Side] Controller Support 1.0
« Reply #2 on: September 16, 2017, 09:47:16 pm »

PrOf is good

and i'm gonna test the ps3 controller


UPDATE : Hey it actually works, nice one PrOf  :woot:
« Last Edit: September 17, 2017, 01:44:58 pm by Kevin Kuntz »
Logged
I PEAKED
I PEAKED

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Controller Support 1.0
« Reply #3 on: September 17, 2017, 05:34:05 am »

Custom controls when
Because of the (kinda stupid) way joysticks work in Game Maker it's harder than regular keyboard mapping to do. Each axis uses a different method so it's not as easy as joystick_getAxis(global.controllerMove)
However I have an idea involving ini files that might work but will also take some time. Until then I'll focus on finishing implementing the necessary controls to play the game "normally"
Logged

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: [Client-Side] Controller Support 1.0
« Reply #4 on: September 17, 2017, 11:09:45 am »

I did this a long time ago and those are exactly the problems I experienced.

>Each axis uses a different method so it's not as easy as joystick_getAxis(global.controllerMove)

use execute_string lol

Alternatively dump all the controller data into variables then select the right variable programmatically. Could even use arrays/lists for indexing buttons and axises.
« Last Edit: September 17, 2017, 11:11:53 am by Phantom Brave »
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Controller Support 1.0
« Reply #5 on: September 17, 2017, 11:21:39 am »

use execute_string lol
Yep. That's what I was going to do. Also because this is a plugin and plugins use object_event_add I'll read the ini outside any event and then add code as variables where needed

object_event_add(PlayerControl, ev_step, ev_step_begin, '
    if (joystick_' + global.controllerMove + '(' + global.connectedJoystick + ') {
        //code that works
    }
');


Where global.controllerMove can be
direction
xpos
ypos
zpos
rpos
upos
vpos
pov

or something along the lines
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Controller Support 1.0
« Reply #6 on: September 17, 2017, 11:25:47 am »

-Added support for most common bubbles, planning to also add the :x4: bubble somewhere, probably on L3
-Bubbles will be modifiable in the ini, don't worry
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Controller Support 1.0
« Reply #7 on: September 17, 2017, 02:27:52 pm »

Ok, quick thought.
Having secondary fire on L1 SUCKS when playing Healer and you need to jump and shoot.
Solution: move the secondary fire to R2 and put Taunt on L1
Because of CODE, R2 and L2 are considered both part of the z axis. As such they can't be pressed simultaneously, result: you can't shoot and jump simultaneously.
Solution: L1 Jump, L2 Taunt, R1 Primary, R2 Secondary
From the next update controls will be like this then.
Logged

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Controller Support 1.0
« Reply #8 on: September 17, 2017, 03:19:24 pm »

Update:
-Changed controls
-Added :x4: bubble to L3
-Added a context action bubble:
    When playing in a CTF or Generator map, :x3: and drops the intel
    When playing in a CP, Koth, DKoth or Arena map, :x7:
-Context actions like  :x8::superburst:(Ask for superburst) or :generatorBubbleThatDoesn'tExistWhyTho: coming soon

We should add the  :x3:, :x7: and a possible generator bubble to the same button (X3?) even in the official game. It leaves space for other bubbles and is easier to remember.
Plus it's easy and fast to implement. Just add some different sprites and some instance_exists() to the BubbleMenuX controller and you're done
Logged

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: [Client-Side] Controller Support 1.0
« Reply #9 on: September 17, 2017, 03:56:49 pm »

>Because of CODE, R2 and L2 are considered both part of the z axis.

This is because of xbox controllers. Normal directinput controllers don't have this problem.
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Controller Support 1.0
« Reply #10 on: September 17, 2017, 05:08:15 pm »

>Because of CODE, R2 and L2 are considered both part of the z axis.

This is because of xbox controllers. Normal directinput controllers don't have this problem.
That's an issue with the DirectInput api. I could use the XInput api but it'll require some time. Most users will also probably stick to the default controls I set
https://msdn.microsoft.com/en-us/library/windows/desktop/ee417014(v=vs.85).aspx
« Last Edit: September 17, 2017, 05:09:47 pm by PrOF »
Logged

Phantom Brave

  • All Hail Classicwell
  • Moderator
  • *****
  • Karma: 70
  • Offline Offline
  • Posts: 12701
  • Another one --
Re: [Client-Side] Controller Support 1.0
« Reply #11 on: September 17, 2017, 05:31:34 pm »

Normal directinput controllers do not put R2 and L2 on the same axis in the directinput API. Only the xbox controllers do. Microsoft did this on purpose to force devs to implement xinput (and thus advertise the xbox 360 controller) because otherwise xbox 360 controllers wouldn't support pressing both at once in their games. See also Games For Windows Live.
« Last Edit: September 17, 2017, 05:34:45 pm by Phantom Brave »
Logged

http://steamcommunity.com/id/wareya/
ladies and gentlemen i would like to announce that the fact of the matter is up that the fact of the matter is a fact and it matters

Kevin Kuntz

  • Heroic Member
  • ****
  • Karma: -58
  • Offline Offline
  • Posts: 712
  • panda took the kids
    • Rav And Kill Bill
Re: [Client-Side] Controller Support 1.0
« Reply #12 on: September 18, 2017, 12:08:42 am »

i keep confusing r2 for shoot, i don't like these default controlls :z7:
« Last Edit: September 18, 2017, 12:29:05 am by Kevin Kuntz »
Logged
I PEAKED
I PEAKED

Kevin Kuntz

  • Heroic Member
  • ****
  • Karma: -58
  • Offline Offline
  • Posts: 712
  • panda took the kids
    • Rav And Kill Bill
Re: [Client-Side] Controller Support 1.0
« Reply #13 on: September 18, 2017, 12:28:46 am »

Connect an XBox/PlayStation controller to your pc and you're ready to play Gang Garrison!


TO DO
-Support for up to 2 controllers plugged in simultaneously
Offline Gang Garrison 2, NOW  :z3:
Logged
I PEAKED
I PEAKED

PrOF

  • Full Member
  • ***
  • Karma: 43
  • Offline Offline
  • Posts: 594
  • Sometimes a dev. Only sometimes
Re: [Client-Side] Controller Support 1.1
« Reply #14 on: September 23, 2017, 09:24:49 am »

Better mouse update
-Reworked mouse movement so that it isn't painful to use
-Seamless transition between mouse and controller, GG2 no longer locks your mouse when alt-tabbing. If the issue persists press SELECT to switch to Mouse mode
-Added spectator controls
-Fixed controller behaving differently in 30 or 60 fps
-Fixed Quote being unusable due to slow Blade fire rate
 See code changes here
Logged
Pages: [1] 2
 

Page created in 0.053 seconds with 37 queries.