Someone please document depthModParams!

Someone please document depthModParams!

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Someone please document depthModParams!

Post by Forboding Angel »

Code: Select all

depthModParams = {
         minHeight      = number,
         maxHeight      = number,
         maxScale       = number,
         quadraticCoeff = number,
         linearCoeff    = number, -- deprecates "depthMod"
         constantCoeff  = number,
       }
Would someone kindly document this and add it to the changelog? Thanks!
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Someone please document depthModParams!

Post by knorke »

i just added that to the changelog!

new formula is given by
if h < depthModParams.minHeight: 1.0
if h > depthModParams.maxHeight: 0.0
else:
depthScale = MAX(0.01, MIN(depthModParams.maxScale, (a * h * h) + (b * h) + c))
depthMod = 1 / depthScale
where
h = unit's absolute height below water surface
a = depthModParams.quadraticCoeff
b = depthModParams.linearCoeff
c = depthModParams.constantCoeff
Kloot
Spring Developer
Posts: 1867
Joined: 08 Oct 2006, 16:58

Re: Someone please document depthModParams!

Post by Kloot »

It IS in the changelog.
User avatar
knorke
Posts: 7971
Joined: 22 Feb 2006, 01:02

Re: Someone please document depthModParams!

Post by knorke »

yes, it is now. before it was not obviously.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Someone please document depthModParams!

Post by Forboding Angel »

Please document the tags if you would :-)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: Someone please document depthModParams!

Post by smoth »

http://springrts.com/wiki/Movedefs.lua
you could start the process forb by updating the wiki page.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6240
Joined: 29 Apr 2005, 01:14

Re: Someone please document depthModParams!

Post by FLOZi »

Updating the movedefs wiki page with the changes for 87 is on my todo list.

edit: updating the rest of the wiki to 83 and beyond is also on the todo list.
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Someone please document depthModParams!

Post by Pxtl »

Fed the wiki. Enjoy.

I hope you like math.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Someone please document depthModParams!

Post by Forboding Angel »

If I understood the equation, I would. As it is, I don't understand why such a complicated equation is even necessary.

Pxtl, I love you. Thanks!
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Someone please document depthModParams!

Post by Pxtl »

Forboding Angel wrote:If I understood the equation, I would. As it is, I don't understand why such a complicated equation is even necessary.

Pxtl, I love you. Thanks!
AFAIK, this was *always* the equation. Nothing has actually changed except that everything that used to be constant is now a parameter. That's all the patch did - "Congratulations, you can now fiddle with all the knobs!".

I agree it's overcomplicated, but it always was and I suppose there's no need to fix it if it ain't broke.

I admit the quadratic term is probably unnecessary and just having the linear and offset coeffs would be plenty... plus the fact that there's no way to control the over-max multiplier or provide a minimum divisor means you can't do quite as much with crazy-reverse "higher is faster" or "faster underwater" stuff as is potentially possible.

But either way, 'sall good.
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Re: Someone please document depthModParams!

Post by Forboding Angel »

Honestly, as long as it is documented (like you did), I don't have a problem with it. What does bug me is these wtf moments that happen when you're looking at tags and values, but if they are documented, you can read up, fix it, and move on. Works for me! :-)

Thanks to both you, pxtl, and knorke!
User avatar
Pxtl
Posts: 6112
Joined: 23 Oct 2004, 01:43

Re: Someone please document depthModParams!

Post by Pxtl »

I can't take any credit, I just fed the wiki and read the formula.

Seriously, don't fear the math.
Post Reply

Return to “Engine”