Water Map related Questions

Water Map related Questions

Here is where ideas can be collected for the skirmish AI in development

Moderators: hoijui, Moderators

Post Reply
Reth
AI Developer
Posts: 70
Joined: 15 Aug 2006, 14:05

Water Map related Questions

Post 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?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
Reth
AI Developer
Posts: 70
Joined: 15 Aug 2006, 14:05

Post 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.
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post 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.
Post Reply

Return to “AI”