Page 1 of 1

New c++ interface: GetResourceMapSpotsPositions() broken?

Posted: 22 Sep 2009, 13:31
by shredguitar
I am using the new c++ interface to write an AI for Balanced Annihilation. I use the function mentioned in the topic to find out where there is metal on given map. However, on some maps the values returned by the function are wrong and my AI ends up building metal extractors on non-metal spots.

Maps where the function does not return correct values:
DeltaSiegeDry
Eye Of Horus v2


On the other hand it works fine on these maps:
Archers Valley v5
Adamantine Mountian v1


Anyone knows of this problem and how to fix it?

Re: New c++ interface: GetResourceMapSpotsPositions() broken?

Posted: 22 Sep 2009, 13:54
by abma
I've tested it, the function seems to have a bug. My ai also tries to build at non-metal spots.

Other ai's often use their own function to get metal spots...

I've filled a bug report: http://springrts.com/mantis/view.php?id=1656

It seems to be fixed in git.

Re: New c++ interface: GetResourceMapSpotsPositions() broken?

Posted: 22 Sep 2009, 16:27
by hoijui
yeah, kloot fixed it wiht this:

Code: Select all

-	MapHeight = resourceHandler->GetResourceMapWidth(ResourceId);
-	MapWidth = resourceHandler->GetResourceMapHeight(ResourceId);
+	MapWidth = resourceHandler->GetResourceMapWidth(ResourceId);
+	MapHeight = resourceHandler->GetResourceMapHeight(ResourceId);
was me doign ti wrong:
DOH!