Page 2 of 2

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 22:50
by Argh
The only one is depthmod which says water does not slow me.
OK. So you want Units to prefer water, when they have to choose.

You want depthmod results that give a final speed greater than a pathing result on land to be weighted higher.

Problem there... IIRC, the pathfinder doesn't actually look at Unit speed, it merely looks at slope. Could be wrong there, but I don't recall seeing anything about the relative Unit speed per se, it just tries to solve for the fewest changes in slope.

I guess water could be treated as a bonus to the slope values or something. That might be a good solution.

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 22:52
by zwzsg
we cannot access pathing values in lua
Then instead of using the engine pathfinder, just build your own pathfinder in Lua. It's only the most algorithmy-difficult and CPU-expensive part of RTS coding after all.

the Devs aren't our slaves
Be your own slave!

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 22:53
by lurker
By access he meant affect.

He wants them to seek deep water when the speed boost is enough to overcome going over slopes, in other words default pathfinding. He just needs a way to tell the pathfinder that they're faster in water.

Edit for responses during this: Yes it very much looks at speed. Go use a map with roads.

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 22:59
by Argh
I thought that it just preferred the roads due to a weighting in the typemap?

In either case, we circle back again... why not just make water areas a typemap, since Gundam uses custom maps already?
He wants them to seek deep water when the speed boost is enough to overcome going over slopes, in other words default pathfinding.
OK, so basically guys walking underwater? Again, looks like this could be solved with a typemap.

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:02
by lurker
The weighting is a speed modifier...

Because typemaps only have 4 categories and you'd have to overhaul the entire system for that to even start making sense to be manipulated by the engine?

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:06
by Argh
OK, so it's the speed modifier that counts?

Then a typemap would solve it, on custom maps, but he wants this to be default behavior, for all maps, where it treats depthmod like the speed bonus from a typemap?

I'm confused here. If it's really taking speed into account, and not just the heights and typemap, then why isn't this working already? Is depthmod / slopemod just not factored into final Unit speed until after pathfinding has occurred?

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:07
by lurker
There's no reason to have a "this is water" typemap.

If you would just read the thread thoroughly... He is unable to set speed via depthmod so he sets it via cob. This means the pathfinder is unaware of it. If depthmod could be negative this would be largely solved.

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:21
by Argh
There's no reason to have a "this is water" typemap.
No more arbitrary than "this is K-Bot ground" typemaps...

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:24
by lurker
What? I'll be more clear. There is no need to take every type that intersects with water and turn it into two types, one on water and on on land. You also have to have more unit classes in each ground type, and base speeds for them. Please explain your plan, because it makes no sense to me.

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:29
by smoth
"Smoth knows triangles are puppies"

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:34
by SeanHeron
My god, I'm really sorry I ever mentioned the typemaps now - I was only trying to point out what I thought might be a workaround. I'd not expected a borderline flamefest to ensue...

On topic: It shouldn't be a question that being able to set a modifier for units speeds depending on whether they're in water or not would definitely be a very useful setting (Edit: and not just monodirectional or whatever is possible now)! I certainly think that is something worth implementing (and should perhaps have stated so more clearly immediately...).

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:35
by Argh
1. KBOT movetypes are governed by KBOT being set in the name, IIRC.

2. Typemaps can give a speed bonus, i.e.:

Code: Select all

kbotmovespeed=1;//multiplier of kbot units speed after slope mods etc has been applied (default value=1)
3. There is no need for major duplication, as Smoth's Units in this example are all using that movetype with the depthmod anyhow- i.e., those special movetypes are already being "wasted".

So he'd just append KBOT to the movetype's names with a quick grep, same with the UnitDefs, and use the appropriate gray value on the typemap where water is. Voila, done.


While we're talking about this, I'm going to say it again: if the Typemap value wasn't read-only and wasn't restricted to four very arbitrary movement "types"... it would have some pretty nifty uses.

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:40
by Kloot
I thought it might be interesting to visualize for some people how depthMod actually affects a (ground) unit's speed in water, assuming a constant slope and slopeMod:

Image

It's pretty simple to invert the relationship for negative modifier values, so I'll do that.

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:44
by smoth
thank you kloot.

Re: depthmod feature request and specific reasoning.

Posted: 21 Aug 2009, 23:58
by Argh
So basically it treats it as 0. What about the slopemod incurred by going down in depth?

Won't it take a pretty hefty depthmod to overcome that?

Just kinda curious as to how that's going to effect Unit speeds on, say, a map with very shallow water mixed with ground, vs. a map where you have deep water with sharp undersea cliffs.

Re: depthmod feature request and specific reasoning.

Posted: 22 Aug 2009, 00:09
by smoth
depends on how you want to setup your slopemod.

Re: depthmod feature request and specific reasoning.

Posted: 22 Aug 2009, 00:17
by Argh
I was just curious, since I set mine up to largely ignore slopes that don't stop movement entirely. Anyhow, that's just a minor wrinkle.

Re: depthmod feature request and specific reasoning.

Posted: 22 Aug 2009, 00:18
by smoth
Then odds are it will not effect it much.

if you had a slopemod of .5 and a depthmod of say 0.1 it should slow the unit down 0.6 if I understand it correctly or there are no gay formulas.