Floatify distance parameter for A_Explode

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

Moderator: GZDoom Developers

Accensus
Posts: 2377
Joined: Thu Feb 11, 2016 9:59 am

Floatify distance parameter for A_Explode

Post by Accensus »

Not like it's much of an issue, but it requires that I explicitly cast it to int whenever I pass anything involving doubles (so every time for me) to avoid the warnings in the console. Some other methods like A_Quake(Ex) could probably also benefit from this, assuming it wasn't all intentional.
User avatar
Major Cooke
Posts: 8081
Joined: Sun Jan 28, 2007 3:55 pm

Re: Floatify distance parameter for A_Explode

Post by Major Cooke »

I don't know about A_Explode but I plan on doing A_QuakeEx for the intensities...

...eventually...
Accensus
Posts: 2377
Joined: Thu Feb 11, 2016 9:59 am

Re: Floatify distance parameter for A_Explode

Post by Accensus »

Does this mean the intensity will get unclamped? Cause it really bugs me that I can't stack random quakes, and wave quakes don't really look all that great for the effect I'm doing. That clamp has to be the most arbitrary decision of all time.
User avatar
Rachael
Admin
Posts: 13084
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: Floatify distance parameter for A_Explode

Post by Rachael »

My guess is the clamp was put in to prevent camera offsets from getting too out of control.

If you've ever played certain games that use camera positional smoothing, you probably know what happens when you get a frame rate blip and the game overcompensates for it. It's a nightmare and you have to wait a little bit before the camera returns to normal again - good luck figuring out where the camera is in the meantime. (hey, if you're lucky you might get some behind the wall glimpses though!) The same thing can happen with quakes that get too intense. Though a better way to attenuate this than clamping is to simply apply a square root to the offset distance, or even calculate a logarithm instead. Square roots allow you to have no limits to something but still make larger numbers appear more sane - logarithm does the same thing (even though it's something completely different) but to much greater effect.
Accensus
Posts: 2377
Joined: Thu Feb 11, 2016 9:59 am

Re: Floatify distance parameter for A_Explode

Post by Accensus »

In my case I use the shake effect on a camera actor for a TITLEMAP. Camera getting out of control or seeing behind the walls is out of the question here. My main issue is that the camera is a certain distance away from the central object and the higher the distance, the less shaky the object is even at maximum intensity. The only way around this right now is using some cinematographic tricks such as making the objects small and close to each other, essentially fooling the viewer into thinking the objects are actually big. This is kind of what I already do but I'd need to go even smaller, at which point I run into the issue of having to move objects around at 1 map unit per trial just to get the perspective right and it just starts to get painfully tedious.
User avatar
Major Cooke
Posts: 8081
Joined: Sun Jan 28, 2007 3:55 pm

Re: Floatify distance parameter for A_Explode

Post by Major Cooke »

Rachael wrote: Sun Aug 28, 2022 4:37 pm My guess is the clamp was put in to prevent camera offsets from getting too out of control.

If you've ever played certain games that use camera positional smoothing, you probably know what happens when you get a frame rate blip and the game overcompensates for it. It's a nightmare and you have to wait a little bit before the camera returns to normal again - good luck figuring out where the camera is in the meantime. (hey, if you're lucky you might get some behind the wall glimpses though!) The same thing can happen with quakes that get too intense. Though a better way to attenuate this than clamping is to simply apply a square root to the offset distance, or even calculate a logarithm instead. Square roots allow you to have no limits to something but still make larger numbers appear more sane - logarithm does the same thing (even though it's something completely different) but to much greater effect.
Bingo. The reason it's clamped is because it's very easy at larger numbers to clip through walls, and some mods will abuse this to make the gameplay practically unplayable. So I am completely against removing it.

At the same time, we cannot change the clamping at this point because it would mess with how quakes work in older mods that are meant to use the defined amount. Also, quakes can be additive, and upsetting that system is opening a whole 'nother can of worms that I don't want to deal with.
Accensus wrote: Sun Aug 28, 2022 7:59 pm In my case I use the shake effect on a camera actor for a TITLEMAP. Camera getting out of control or seeing behind the walls is out of the question here. My main issue is that the camera is a certain distance away from the central object and the higher the distance, the less shaky the object is even at maximum intensity. The only way around this right now is using some cinematographic tricks such as making the objects small and close to each other, essentially fooling the viewer into thinking the objects are actually big.
Something to keep in mind is people can outright turn off quakes by changing r_quakeintensity to 0.
-----
Getting back to the main topic, I think distance was kept to an int was for a couple reasons. One of them being a byproduct of simply not wanting to deal with Fixed_T and the other being it's just easier to calculate since they only do integers and there's no room for corner cases this way.

I could be wrong on both, but those are my guesses.

Return to “Feature Suggestions [GZDoom]”