Getting Started drawTerrainData

Issue #19 resolved
Brandon Chatham created an issue

Hi there, I'm having some issues with getting started with BWTA. It seems when I run my program I am correctly analyzing the map data, but when I try to draw the terrain data, my AI module crashes. The terrain data does not have to be drawn in order for it to be used, correct?

Comments (19)

  1. Alberto Uriarte repo owner

    No, if your AI module crashes it means something is wrong. What BWAPI and BWTA versions are you using? What map are you analyzing? Did you try to analyze the map without using a different thread?

  2. Brandon Chatham reporter

    As is, I am using a different thread to analyze the map. I believe I am using the newest version of both BWTA2 and BWAPI. I had gotten it to draw the terrain data once but it soon after crashed.

  3. Alberto Uriarte repo owner

    Maybe the problem is in this line:

    unit->move(BWAPI::Position(MapTools::getNextExpansion()), true);
    

    I don't know what MapTools is...

  4. Brandon Chatham reporter

    MapTools is attempting to find the nearest expansion location on that line. When I run my AIModule without the DrawTerrain(), it moves all of my SCV's however it moves them to the bottom right corner of the map, and not to the nearest mineral field.

    Of course, there could be errors in my logic for the mineral fields (despite having looked at it over and over), but what is even more weird, is that BWTA does seem to be working because I have put some print statements in my loops to determine the size of the list returned by BWTA::getBaseLocations().

  5. Brandon Chatham reporter

    Nevermind, I take that back - BWTA is not working at all. the array size is 0 and it's returning BWAPI::TilePosition::None which is why they are all going to the bottom right corner of the map, I suppose.

    Any idea why I might be having this issue?

  6. Alberto Uriarte repo owner

    Do you have a BWTA cache file at "StarCraft\bwapi-data\BWTA2*.bwta? If so, try to delete it (maybe it's corrupted)

    What is printed at "StarCraft\bwapi-data\logs\BWTA.txt"?

  7. Brandon Chatham reporter

    I deleted the cache files and that didn't fix anything but strangely it looks like I have no log file. I may try to start an entirely new project with a new module, and move my changes to that project. Maybe with all od my fiddling around with dependencies, includes, and files in general I messed something up?

  8. Brandon Chatham reporter

    So I just stashed all of my work on my github, I deleted all of my BWAPI files, chaoslauncher, BWTA and Starcraft. Reinstalled everything and tried to use BWTA. I copied the code from the code example into the ExampleAIModule and unfortunately, it still crashes when I type "/analyze". What more can do I do to debug?

  9. Alberto Uriarte repo owner

    Can you tell me your github to look at your code/libraries?

    BWTA should create bwapi-data/logs/BWTA.log that it tells you if there is any problem. It's really weird if you don't have it...

  10. Alberto Uriarte repo owner

    Just double checking: When you downloaded BWTA library, you moved the content of windows folder to your C:\Windows, right?

  11. Brandon Chatham reporter

    our linker config exactly matches that of the screenshot used in the "Starting Guide" except it also includes ../lib/libboost_filesystem-vc120-mt-1_56.lib because our program would not compile without it.

  12. Brandon Chatham reporter

    Ahhh so I should go back, get the newest BWTA.h include and replace it with whatever I have now. I'll do that tonight. I'll keep you posted on the results!

  13. Brandon Chatham reporter

    Okay, so I did what you suggested and got those new files. After that, it was still crashing, but I was having a little bit more luck earlier today when I moved my AnalyzeThread call into the onStart() function so I decided to try a bit more of that. I kept the new files and moved the thread call out of onSendText() and into the onStart() and it works perfectly! It took a moment for the map to be analyzed but once it finished, the terrain analysis was drawn AND my SCV's went to the closest expansion! :)

  14. Log in to comment