Controller Rumble Support?
Moderator: GZDoom Developers
-
- Posts: 72
- Joined: Wed Aug 16, 2017 5:29 am
Controller Rumble Support?
I know this was rejected a few years ago but I thought I'd bring it up again now that things have changed.
Doom Retro has nice rumble support for controllers and it really does add to the immersive feel when 'couch' gaming.
Could something similar be added to ZDoom?
Doom Retro has nice rumble support for controllers and it really does add to the immersive feel when 'couch' gaming.
Could something similar be added to ZDoom?
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Controller Rumble Support?
Only if you find a developer with a controller that supports such a feature and is willing to do the work.
I don't think you are in luck with this but let's hear from the others first.
I don't think you are in luck with this but let's hear from the others first.
-
- Posts: 13836
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Controller Rumble Support?
I do have a controller, but not sure if it supports rumble (I think it does).
Point me to a controller API similar to what ZDoom uses where this can easily be added.
Also - what events should trigger a rumble?
Point me to a controller API similar to what ZDoom uses where this can easily be added.
Also - what events should trigger a rumble?
-
- Posts: 72
- Joined: Wed Aug 16, 2017 5:29 am
Re: Controller Rumble Support?
Sorry, being completely code illiterate I've no idea what API ZDoom uses let alone where to find a similar one for your use... *embarrassed*
As far as events go, I'd suggest the same as Doom Retro (namely, weapon fire and player damage from enemy fire).
I've no idea if Doom Retro is any good as a starting point code-wise but here's a link to the homepage:
http://www.doomretro.com/
I'm sorry I'm too ignorant to offer more than the original suggestion...
As far as events go, I'd suggest the same as Doom Retro (namely, weapon fire and player damage from enemy fire).
I've no idea if Doom Retro is any good as a starting point code-wise but here's a link to the homepage:
http://www.doomretro.com/
I'm sorry I'm too ignorant to offer more than the original suggestion...
-
-
- Posts: 17468
- Joined: Mon Oct 27, 2003 12:07 am
- Location: Kuala Lumpur, Malaysia
Re: Controller Rumble Support?
I'd suggest attaching the rumble behavior to the lowest level where the weapon firing functions are called, player being hurt, player falling down (oof), earthquake radii, and maybe some custom A_Rumble(amount) functions for modders.
-
- Posts: 13836
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Controller Rumble Support?
Thank you, this is a lot more descriptive and helpful than just saying "do it like Doom Retro does it."Nash wrote:I'd suggest attaching the rumble behavior to the lowest level where the weapon firing functions are called, player being hurt, player falling down (oof), earthquake radii, and maybe some custom A_Rumble(amount) functions for modders.
-
- Posts: 72
- Joined: Wed Aug 16, 2017 5:29 am
Re: Controller Rumble Support?
Thank you, Nash, for explaining in a clearer manner than I could.
Rachael, sorry for being so vague. I didn't mean to irk you. I just don't have the game code vocabulary to clarify other than saying "when shooty stick go bang-bang!". I'll try to be better in future.
Rachael, sorry for being so vague. I didn't mean to irk you. I just don't have the game code vocabulary to clarify other than saying "when shooty stick go bang-bang!". I'll try to be better in future.
-
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
Re: Controller Rumble Support?
I'd think the problem here is, which weapon functions would trigger a rumble?
A_FireBullets is a safe bet (you can assume users aren't using it for anything but bullets), but projectiles are a blurrier line. A_FireCustomMissile is sometimes used for smoke and bullet casing effects, which would trigger a rumble during, for example, reloads. Then in that case, why not whenever the Flash state is triggered via A_GunFlash? Except there are weapons that used the Flash state for things other than weapons firing, at least one of which does this during the weapon's Ready state, meaning the controller would be constantly shaking whenever that weapon is selected at all.
A_FireBullets is a safe bet (you can assume users aren't using it for anything but bullets), but projectiles are a blurrier line. A_FireCustomMissile is sometimes used for smoke and bullet casing effects, which would trigger a rumble during, for example, reloads. Then in that case, why not whenever the Flash state is triggered via A_GunFlash? Except there are weapons that used the Flash state for things other than weapons firing, at least one of which does this during the weapon's Ready state, meaning the controller would be constantly shaking whenever that weapon is selected at all.
-
- Posts: 13836
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Controller Rumble Support?
It can simply rumble on the first actual attack/projectile spawning function after the initial fire or refire check. Which would give it the functionality of a delayed rumble for the BFG, but instant fire for the other weapons, and somewhat constant rumble for the chainsaw and chaingun.
-
- Posts: 21706
- Joined: Tue Jul 15, 2003 7:33 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): A lot of them
- Graphics Processor: Not Listed
Re: Controller Rumble Support?
The chaingun I'd anticipate being a little strange - assuming a quick burst of rumble, and only triggering on the first attack function, it'd only rumble once for every two shots. I suppose there'd be some fudging going on with duration and intensity though.
-
- Posts: 317
- Joined: Mon Jul 16, 2012 2:02 am
Re: Controller Rumble Support?
...make it configurable by some means on per weapon basis?
-
- Posts: 108
- Joined: Mon Dec 12, 2016 1:12 pm
Re: Controller Rumble Support?
I'm assuming GZdoom uses SDL for joystick support. SDL does allow for force feedback.
https://wiki.libsdl.org/CategoryForceFeedback
I know that rumble functionality is pretty easy to implement with XInput, but that is platform dependent and aimed primarily just at XBox controllers (though 3rd party controllers can pretend to be an XBox controller and latch onto XInput)
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
As for when to rumble, a small kickback from firing a rocket launcher, chain gun or SSG might be nice, but I could also see force feedback when your chainsaw connects with an enemy, or when you're hit. Perhaps the intensity of the rumble could relate to the amount of damage you take when hit.
I'm not sure it would make sense to include all damage (such as lava), rather just when an enemy hits you.
https://wiki.libsdl.org/CategoryForceFeedback
I know that rumble functionality is pretty easy to implement with XInput, but that is platform dependent and aimed primarily just at XBox controllers (though 3rd party controllers can pretend to be an XBox controller and latch onto XInput)
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
As for when to rumble, a small kickback from firing a rocket launcher, chain gun or SSG might be nice, but I could also see force feedback when your chainsaw connects with an enemy, or when you're hit. Perhaps the intensity of the rumble could relate to the amount of damage you take when hit.
I'm not sure it would make sense to include all damage (such as lava), rather just when an enemy hits you.
-
- Lead GZDoom+Raze Developer
- Posts: 49188
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: Controller Rumble Support?
GZDoom uses SDL only on Linux. Any kind of controller support will have to be platform specific. If you want to try, be my guest, but as you may have noticed the developers here have little to no interest in this feature.
-
-
- Posts: 26644
- Joined: Tue Jul 15, 2003 4:58 pm
- Location: Scotland
Re: Controller Rumble Support?
Have people not used it to create flashlights, laser sights and maybe other stuff (custom puff with light attached)?wildweasel wrote:A_FireBullets is a safe bet (you can assume users aren't using it for anything but bullets)
-
- Posts: 13836
- Joined: Tue Jan 13, 2004 1:31 pm
- Preferred Pronouns: She/Her
Re: Controller Rumble Support?
UUUUGH! Yeah, sure, a damage requirement check can be added for this, but that's just one more thing in the long list of exceptions it will check for. It's becoming less and less worth it.