Controller Rumble Support?

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

User avatar
Outtagum
Posts: 72
Joined: Wed Aug 16, 2017 5:29 am

Controller Rumble Support?

Post by Outtagum »

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?
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Controller Rumble Support?

Post by Graf Zahl »

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.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Controller Rumble Support?

Post by Rachael »

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?
User avatar
Outtagum
Posts: 72
Joined: Wed Aug 16, 2017 5:29 am

Re: Controller Rumble Support?

Post by Outtagum »

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... :(
User avatar
Nash
 
 
Posts: 17439
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: Controller Rumble Support?

Post by Nash »

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.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Controller Rumble Support?

Post by Rachael »

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.
Thank you, this is a lot more descriptive and helpful than just saying "do it like Doom Retro does it."
User avatar
Outtagum
Posts: 72
Joined: Wed Aug 16, 2017 5:29 am

Re: Controller Rumble Support?

Post by Outtagum »

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.
User avatar
wildweasel
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
Contact:

Re: Controller Rumble Support?

Post by wildweasel »

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.
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Controller Rumble Support?

Post by Rachael »

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.
User avatar
wildweasel
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
Contact:

Re: Controller Rumble Support?

Post by wildweasel »

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.
ZzZombo
Posts: 315
Joined: Mon Jul 16, 2012 2:02 am

Re: Controller Rumble Support?

Post by ZzZombo »

...make it configurable by some means on per weapon basis?
enderandrew
Posts: 108
Joined: Mon Dec 12, 2016 1:12 pm

Re: Controller Rumble Support?

Post by enderandrew »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Controller Rumble Support?

Post by Graf Zahl »

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.
User avatar
Enjay
 
 
Posts: 26534
Joined: Tue Jul 15, 2003 4:58 pm
Location: Scotland
Contact:

Re: Controller Rumble Support?

Post by Enjay »

wildweasel wrote:A_FireBullets is a safe bet (you can assume users aren't using it for anything but bullets)
Have people not used it to create flashlights, laser sights and maybe other stuff (custom puff with light attached)?
User avatar
Rachael
Posts: 13558
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her
Contact:

Re: Controller Rumble Support?

Post by Rachael »

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.
Post Reply

Return to “Feature Suggestions [GZDoom]”