IAICallback->GetSlopeMap?

IAICallback->GetSlopeMap?

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
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

IAICallback->GetSlopeMap?

Post by hughperkins »

There's a GetSlopeMap function in CAICallback, but it doesnt exist in the IAICallback interface, so it's inaccessible. Could it be possible to add that to the interface please?

Note that it's not possible to simply cast the IAICallback * to a CAICallback *, because CAICallback is not exported, I think?
User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

BUMP

this is very important, and is a big obstacle to an array of terrain analysis algorithms that I hughperkins and a number of others have expressed an interest in.

This would revolutionize building placement and terrain analysis in the AIs and it requires very little.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

Note that until this is fixed, there is a workaround for this by copying and pasting code from ReadMap.cpp. You can get the heightmap using GetElevation. Note that the heightmap returned by GetHeightMap is centre heights, and we need corner heights.
Tobi
Spring Developer
Posts: 4598
Joined: 01 Jun 2005, 11:36

Post by Tobi »

please dont make such copy paste workarounds, your only giving everyone who ever has to handle your code, including yourself, a headache (because you need to merge bugs from upstream etc.)

anyway, (re)added GetSlopeMap, GetMinHeight and GetMaxHeight & bumped interface version.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

> (re)added GetSlopeMap, GetMinHeight and GetMaxHeight & bumped interface version.

Great, thanks.
User avatar
hughperkins
AI Developer
Posts: 836
Joined: 17 Oct 2006, 04:14

Post by hughperkins »

User avatar
AF
AI Developer
Posts: 20687
Joined: 14 Sep 2004, 11:32

Post by AF »

yay! good work, now I neednt do a big loop in my heightmap output in the map exporter AI to rerieve the highest and lowest height values.

^^ =D
Post Reply

Return to “Engine”