Floating point intensities for quakes

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

Moderator: GZDoom Developers

Floating point intensities for quakes

Postby Marisa the Magician » Wed Jun 01, 2022 4:59 pm

I've always been bothered by how the intensities for quake functions are integers from 1 to 9, especially when an intensity of 1 is still rather noticeable. Would it actually be possible to make this support floating point values?
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Floating point intensities for quakes

Postby Lord Misfit » Sun Jun 12, 2022 10:13 am

Seconding this if its possible. I also admit it feels a bit weird that double/floating-points aren't a thing since a lot of people might think of the Richter scale for quake intensities, even if it's not a RL thing in the engine and they don't scale the same way. V:
User avatar
Lord Misfit
Servant of Aetherius? Servant of Siel?
 
Joined: 27 Dec 2006
Location: Canton, OH
Discord: Lord Misfit#9594

Re: Floating point intensities for quakes

Postby Kinsie » Sun Jun 12, 2022 9:21 pm

TBH some kind of client-side, unsynched camera-shake method would be good too. Lord knows like 99% of my using quakes is for shaking the screen for a tic or two to emphasise an impact or attack...
User avatar
Kinsie
Dog Days
 
Joined: 22 Oct 2004
Location: MAP33
Discord: Find Me...
Twitch ID: thekinsie

Re: Floating point intensities for quakes

Postby Major Cooke » Tue Jun 14, 2022 5:39 pm

If we're going to do something involving clientside, I can't exactly help there since I've no idea on how to do that.

Converting to floats, yes. It's perfectly doable. In fact, the moment a DEarthquake is made, it auto converts intensity into double vectors!

Code: Select allExpand view
void DEarthquake::Construct(AActor *center, int intensityX, int intensityY, int intensityZ, ...)
{
   //...
   m_Intensity = DVector3(intensityX, intensityY, intensityZ);
   //...
}


I'll look into it.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Floating point intensities for quakes

Postby Marisa the Magician » Wed Jun 15, 2022 3:27 am

Kinsie wrote:TBH some kind of client-side, unsynched camera-shake method would be good too. Lord knows like 99% of my using quakes is for shaking the screen for a tic or two to emphasise an impact or attack...

Something like this could probably be done with viewpos, now that it's made it in, actually. I'll have to look into it myself.
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Floating point intensities for quakes

Postby Major Cooke » Wed Jun 15, 2022 10:09 am

Don't count on it. ViewPos relies upon the class ViewPosition, which is only created when SetViewPos function is called in ZScript.

Code: Select allExpand view
class ViewPosition native
{
   native readonly Vector3 Offset;
   native readonly int Flags;
}


It was made this way because of concerns about performance and size. Since this would be supplanted on every actor, it makes a lot more sense that it be a class and only be called when wanted. A class pointer is also smaller than a Vector3 & int combined.

In addition, there's a reason why DEarthquake isn't exposed, so it can remain unsynced safely. ViewPos is exposed to the play side of things.

And if anyone's wondering why this is a class instead of a struct, it's because I didn't know how to properly implement them.
Last edited by Major Cooke on Wed Jun 15, 2022 10:22 am, edited 1 time in total.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007

Re: Floating point intensities for quakes

Postby Marisa the Magician » Wed Jun 15, 2022 10:10 am

Oh, yeah, that's a problem.
User avatar
Marisa the Magician
ZScript Crimester
 
 
 
Joined: 08 Feb 2008
Location: Vigo, Galicia
Discord: Marisa the Magician#1666
Twitch ID: MarisaDOOM
Github ID: OrdinaryMagician
Operating System: Other Linux 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: Floating point intensities for quakes

Postby Major Cooke » Wed Jun 15, 2022 10:58 am

In addition, quakes are also affected by r_quakeintensity, so there's also that.

Kinsie wrote:TBH some kind of client-side, unsynched camera-shake method would be good too. Lord knows like 99% of my using quakes is for shaking the screen for a tic or two to emphasise an impact or attack...


Quakes are already as clientside as they can be. It's also why I created ViewPos so you can generate your own custom quakes in a way, but for mods that want to combine and create additional quakes using that, admittedly may not mesh well with other mods that attempt to create their own quakes, so I went out of my way to expand A_QuakeEx as much as possible. The only thing that's missing is the ability to set the oscillation offset (i.e. akin to FloatBobPhase) for the sine quakes, but otherwise you can do a lot with them.

Anyway...

I'll look into adding floating point precision, but I'm still going to keep the cap in at 9 for intensity. Some mods set them over 9, unaware that the cap and may cause massive confusion with an intensity of 100 and seeing into sectors you normally shouldn't be able to (on top of completely fucking with your aim). I mean, that problem already exists if you stand against a wall anyway but uncapping it would only exacerbate it.
User avatar
Major Cooke
QZDoom Maintenance Team
 
Joined: 28 Jan 2007


Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest