Getting the ai to make buildings in C++

https://github.com/bwapi/bwapi
TheBlueGnu
Posts: 27
Joined: Fri May 20, 2011 12:34 pm

Getting the ai to make buildings in C++

Postby TheBlueGnu » Wed Jul 13, 2011 12:22 pm

Had code in C++ from before which runs, so I've been trying to get buildings made. However, try as I might, the AI can't find the location (even if it moves to the right place) and just won't do anything if I just order it to build at a specific location. I think it's a logic error, but I've combed through and can't understand it. It may be a problem with the visibility command method, but not sure on that either.

Would attach the whole ExampleAITutorial project to make things easier, but download quoter for posts won't let me;
[attachment=2849:GnuExampleAIModule.zip]

If anyone can figure it out, please let me know.

Edit: 25th July 20114
It was the tile position and bwapi::position. See post "BWAPI::TilePositions width and height?". BWSAL is your (long and complicated to learn but useful) friend.

Edit: 4th Aug 2011
Removed link for space reasons.
krasi0
Posts: 254
Joined: Thu Dec 18, 2008 12:42 pm

Postby krasi0 » Thu Jul 14, 2011 6:47 am

You might want to have a look at BWSAL to get an idea of how the building placer works. Also have a look at ConstructionManager

[quote name='TheBlueGnu' date='13 July 2011 - 02:22 PM' timestamp='1310559721' post='10292']
Had code in C++ from before which runs, so I've been trying to get buildings made. However, try as I might, the AI can't find the location (even if it moves to the right place) and just won't do anything if I just order it to build at a specific location. I think it's a logic error, but I've combed through and can't understand it. It may be a problem with the visibility command method, but not sure on that either.

Would attach the whole ExampleAITutorial project to make things easier, but download quoter for posts won't let me;
[attachment=2849:GnuExampleAIModule.zip]

If anyone can figure it out, please let me know.
[/quote]
TheBlueGnu
Posts: 27
Joined: Fri May 20, 2011 12:34 pm

Postby TheBlueGnu » Thu Jul 14, 2011 7:09 am

[quote name='krasi0' date='14 July 2011 - 02:47 PM' timestamp='1310626042' post='10293']
You might want to have a look at BWSAL to get an idea of how the building placer works. Also have a look at ConstructionManager[/quote]

Cheers, will do.

My current error is that it says the spot isn't visible, even though it should be. Had the problem before of it making a building, going to the point and just sitting there as well though. I might switch to these managers though and remove all the non-terran, non-used units in my project.

The managers look very impressive O_O I so wish I'd know about them when I started making an AI.

Edit:
Downloaded the project, compiled it as release and made a DLL. Updated bwapi.ini to use the DLL and tried to run in Chaoslauncher. Gets into Starcraft, but at the start of a match it can't find the BasicAIModule.dll :(

Edit: 15/7/2011

Oh wait a min, this thing says it's for BWAPI 3.4 ... that might be why. Might make a new topic for this.

Return to “BWAPI (wrappers in other languages / questions and announcements related to BWAPI itself)”

Who is online

Users browsing this forum: No registered users and 1 guest