Hi,
I search what value i need to put in "maxslope".
It's a setting that say if an unit can climb well of not, but that go from 0 to, apparently, 255. No 360...
[resolved] maxslope ?
Moderator: Moderators
[resolved] maxslope ?
Last edited by vampi3 on 20 Apr 2009, 20:47, edited 1 time in total.
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: maxslope ?
maxslope * 1.5 = degrees a unit can climb.
Note that the maxslope in the unitdef controls where the unit can be built, and the maxslope in the movedef controls where the unit can move.
Note that the maxslope in the unitdef controls where the unit can be built, and the maxslope in the movedef controls where the unit can move.
[resolved] Re: maxslope ?
Thank you (and for your precision, too).
Re: maxslope ?
Weird, I thought it was just maxslope since 89 works fine while at 1.5 it should be ~-45.Evil4Zerggin wrote:maxslope * 1.5 = degrees a unit can climb.
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: [resolved] maxslope ?
md->maxSlope = DegreesToMaxSlope(moveTable.GetFloat("maxSlope", 60.0f));
static float DegreesToMaxSlope(float degrees)
{
return (float)(1.0 - cos(degrees * 1.5f * PI / 180.0f));
}
Taking the average of two normals' y components isn't completely accurate, but in any case n.y equals the cosine of the angle between n and the y direction, and likewise for n2.y, n2, and y; upon comparison with DegreesToMaxSlope(), we can see that the maximum angle that can be climbed is indeed 1.5 * maxSlope in degrees. This also explains the 89 maxSlope situation; it corresponds to being able to climb any slope whose normal has a y component of at least ~-0.7. I suppose if Spring had caves the unit would be able to cling to parts of the ceiling. You'd need a maxSlope of 180 (= 270 degrees) to come around the other side and start losing climbing capability (although you get the best default slopeMod at 120, but that's another story).slopemap[(y / 2) * gs->hmapx + (x / 2)] = 1.0f - (n.y + n2.y) * 0.5f;
Now what I want to know is who decided kbots should be able to climb 137% grades D:
- Forboding Angel
- Evolution RTS Developer
- Posts: 14673
- Joined: 17 Nov 2005, 02:43
Re: [resolved] maxslope ?
Thanks for this info zerg, I didn't know that.
My tanks have a maxslope of 30 yet they still can only climb a 45 degree slope? Can't most modern tanks climb something around like 60 - 70 degree slope? I could sworn I read that somewhere.
My tanks have a maxslope of 30 yet they still can only climb a 45 degree slope? Can't most modern tanks climb something around like 60 - 70 degree slope? I could sworn I read that somewhere.
Re: [resolved] maxslope ?
70 degrees is way too much for current tanks. For example, M1 Abrams can climb 60 degrees, and that's the maximum any tank can do afaik (I don't quite understand how the Abrams may do such a feat, but that's listed in its data). Late Soviet T-84 can only do up to 32 degrees. Current Russian T-90 can only do 30 degrees (that's a guaranteed 'safe' angle, tanks can actually do more in the field, but those would be risky climbs).
- Evil4Zerggin
- Posts: 557
- Joined: 16 May 2007, 06:34
Re: [resolved] maxslope ?
I'm pretty sure it's 60 percent grade (~31 degrees), not 60 degrees, e.g. http://www.military-today.com/tanks/m1_abrams.htm. Grade is the tangent of the angle; e.g. 30 maxSlope = 45 degrees = 100% grade.
Re: [resolved] maxslope ?
Remember also TA tanks, that mean BA, CA, XTA and others NOTA, are BIG and probably HEAVY !
More degrees the unit has to climb, more chances the ground fall and make the unit fall with with it.
Kbots, in another way, can anchor their feet more easilly.
More degrees the unit has to climb, more chances the ground fall and make the unit fall with with it.
Kbots, in another way, can anchor their feet more easilly.