New c++ interface: GetResourceMapSpotsPositions() broken?

New c++ interface: GetResourceMapSpotsPositions() broken?

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

Moderators: hoijui, Moderators

Post Reply
shredguitar
Posts: 3
Joined: 07 Sep 2009, 20:37

New c++ interface: GetResourceMapSpotsPositions() broken?

Post 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?
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

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

Post 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.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

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

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

Return to “AI”