After toiling around with resetting maps on my own, I realized that I wanted to save maps and if I can save them, I can just load the default map to reset a map as well.
- I tried the ever so valuable SwapMaps library to do the following things.
--- LoadMap
--- SaveMap
--- ResetMap
--- LoadDefaultMap
--- LoadLastMap
and... its working awesome.
Here's a shot of the host window and a random generation. Notice the generic starting locations. If only two players, the game will randomly select locations for the players and delete the other two.
I tweaked a few things to improve testability. AI now has no build times while I'm testing.
That's pretty much it for MRTS. Getting all the UI stuff hooked up along with state correctness took a while.
I also had someone ping me about how I was doing the AI. Here's a reduced example which pretty much sums up my AI loop.
AI Example.zip
The example can be a little mis-leading if you compare it to MRTS because the example AI is showing itself moving around on the map. In my RTS, this primary AI loop does not show anything on the screen (aside from the selector rect). It just performs actions. The little tanks I have in MRTS move around in their own mini-loops.
What's Next?
- I'm going to refer to my "AI" as "Bots" from now on.
When you think of "AI", you think of it as number crunching behind the scenes. What I shoot at is the result of the number crunching. I can never get to the AI. I can beat it, but I can't shoot at it.
When you think of "Bots", you think of things running around on a map that you can actually shoot at. They have behavior traits. Maybe its just me but "Bot" has more substance.
What else...
- Select Players/Bots (Window)
- Create Your Own Bot (Window)
- Run your Bot through the MRTS Gauntlet. If your bot wins enough games against the MRTS Bots, you can submit your bot to the MRTS "server" where it will be added as an official MRTS bot. Fun.
ts