Page 1 of 1

Water Map related Questions

Posted: 16 Mar 2007, 21:21
by Reth
Just a few problems I had been trying to fix for a while now, but have had little to no success with.

1) is there any known way to detect if a map's water is lava/acid or otherwise harmful? Or if there is even water at all? (for example: small divide does not have water below 0 elevation)

2) for amphibious units, I have been having trouble determining the commander's maximum water depth? I would have thought that unitdef->maxWaterDepth would be the answer, but theory and practice have been inconsistent. In XTA, Commander unitdef->maxWaterDepth = 35, however they can move down to about (-95 to -100) elevation. In AA, Commander unitdef->maxWaterDepth = 35, but they can move down to 'at least' (-193) elevation. In Both mods, most units we think of as 'land' have a unitdef->maxWaterDepth around (10 to 30), and most unit we think of as 'amphibious' are around (100-255) - which seems about accurate. In other words, the commander's unitdef seems to be the only one that's busted.
Does anyone have any ideas of why?

Posted: 16 Mar 2007, 22:50
by AF
water is always drawn at 0. Thus a map with no water will have no zero or negative height values.

You can read damage from the smf using a TdfParser class.

Also have you tried countering the units height? It might be that (depth - height) rather than simply depth is the issue.

Posted: 17 Mar 2007, 00:14
by Reth
I kind of recalled there being maps where a commander would detonate leaving a puddle of water where the terrain dropped below 0, even on maps that originally had no water. But maybe that was changed in one the resent versions of spring (although the mini-map still shows water)

As for a unit's height, it's a possibility, but it wouldn't make up for the difference I'm finding. Commanders height = (45-50)ish, same in both XTA&AA. XTA aside, AA Commanders can dive to at least -193 when there unitdef->maxWaterDepth = 35.

Posted: 17 Mar 2007, 00:19
by AF
No, the lowest height on a map is not standardised.

As a result a map may be at heights a-b c-d or e-f where e-f are all negative values and a-b are above the 10k mark at least. Maps where com explosions leave puddles would be from say 2-500 so when the terrian deforms it goes under 0 and water shows.