home

games:
Flash games
Plausible Deniability
Afdarts
AI competition
ShootCity
other games

robotics:
Interaction Lab
PR Lite
RoboMagellan

other projects:
hackathons
VB6 code dump

videos:
robots
games
magic
other videos

commentary:
physics
ski lifts

other:
resume
links
email me
I made an entry for the 2008 ORTS RTS Game AI competition. Here is the recommended way to compile my client's source code as of 9/21/2008:
on Linux on Windows
  1. Install ORTS.
  2. Copy the apps/sampleai folder and rename it to "andrewd".
  3. Change the first line in app.mk to say "APP_DIR  := andrewd".
  4. Rename sampleai_main.C into andrewd_main.C.
  5. Replace the contents of the SampleEventHandler.C file with this file.
  6. Make sure #define LINUX_MODE is not commented out.
  7. Doing "make andrewd MODE=opt" should make bin/andrewd.
  8. If you want my client to show what is happening, run it with the command line "-disp".
  1. Install ORTS by following these directions. VC++ 2008 requires libs/kernel/src/Object.C to be added to each project.
  2. Copy the apps\sampleai folder and rename it to "andrewd".
  3. Change the first line in app.mk to say "APP_DIR  := andrewd".
  4. Rename sampleai_main.C into andrewd_main.C.
  5. Run a .bat file from the trunk directory saying "misc\windows\VSTool.exe ./ andrewd"
  6. Open andrewd.vc7.vcproj and convert it if necessary.
  7. Replace the contents of the SampleEventHandler.C file with this file.
  8. Make sure #define LINUX_MODE is commented out.
  9. Change the build configuration from debug to release.
  10. If you want my client to show what is happening, run it with the command line "-disp".

8/7/2009
I updated the online source file to contain the changes I made since last year's competition, which were adding a link to this website, setting the approach speed to 1.5 in the middle of the approach, making a function to return the unit type number, and improving the switching out of corner mode logic.

9/21/2008
I got the latest version of ORTS working, thanks to these directions. Frame rates are much better when the build configuration is set to release instead of debug.

8/4/2008
It seems that almost all of my entry's losses were due to the other entry being ahead when time ran out, probably because my entry was too late to switch out of corner mode. My client only saves to the data file when a player has no units.

8/3/2008
I made a video of the video captures I took yesterday at 4x speed with commentary. By the way, this year's competition finished. Too bad there was only one other competitor in my entry's category, but at least my entry didn't get last place or tie for it.

8/2/2008
I took several video captures involving my game 4 entry. Here is a video of my client in line mode playing my client in corner mode, a video of my client in line mode playing itself, a video of my client playing UofA's entry from last year, and, just for the fun of it, a video of my client now playing my client from 6/22.

8/1/2008
I found some minor problems in the code, but I'm too tired to trust myself to fix them without introducing other bugs just before the competition. However, I added many comments to the code.

7/31/2008
I fixed major bugs in the code that keeps marines out of range of siege tanks, made the client display a status message only every 20 frames, improved the collision response, and let more than 8 marines follow 1 tank.

7/30/2008
I forgot to mention on 7/28/2008 that on Linux, group rights should be given to config/create_dir.

7/29/2008
I continued testing my entry on tournament computers, made the file locking function time out after 500,000 tries instead of 200,000 tries, and tried to improve the way marines stay out of range of siege tanks.

7/28/2008
I started testing my entry on tournament computers. On Linux, it seems to help to run source .bashrc after logging on and libs/pathfinding/dcdt/makelinks before compiling. I also made my client print out more useful information and got the data file code to work on Linux.

7/27/2008
I made the re-approach code handle multiple unit types slightly better and let the file locking function time out after 200,000 tries.

7/26/2008
I improved the way that marines in line mode stay out of range of siege tanks, though I think it can still be improved. I also slightly improved the learning algorithm code.

7/23/2008
I broke up and fixed some bugs in the messy if statement that found who to follow, tweaked some variables, and allowed units to re-approach when they are still approaching. Also, marines in line mode will try to stay out of range of siege tanks until the opponent has 20 or less marines, though they currently do not handle certain situations well. Google Video is rejecting my video for some reason. (update: available here)

7/22/2008
I experimented with marine behavior, as shown by this video.

7/21/2008
If my client is told to use the data file, it now displays the win rate of each strategy at the end of each game.

7/20/2008
I fixed most of the problems with the learning algorithm, though I am probably not done with it yet. In corner mode, marines are now allowed to follow tanks in siege mode.

7/19/2008
I added the basics of a learning algorithm to choose whether to use the line or corner strategy. It might be a little buggy, so I plan to improve it tomorrow.

7/18/2008
After fixing a bug in which my client thought that units' ranges were less than they really were, my client consistently beats UofA's 2007 game 4 entry on 2007 tournament files. (Here's a video. My client has beaten UofA's entry on 2008 tournament files for longer because UofA's entry does not use siege mode and thinks tanks have the same range as marines.) My client also now uses variables included in ORTS to know whether units are in siege mode.

7/17/2008
I made my line strategy use siege mode and make decisions considering siege mode. I also slightly improved the corner strategy, including making it so that tanks should no longer get stuck behind the wall of marines. Here is a video of my client playing UofA's client, a video of my client playing itself, and a video of my normal client playing my client using the corner strategy.

7/16/2008
I added code so that 8 units maximum may follow one unit at a time, adjusted some variables, and worked on the siege mode in the corner code. Here is a video showing one of the stranger battles against UofA, and here is a video of my normal client playing the siege mode client.

7/15/2008
I copied my code to a directory with a newer version of ORTS to hopefully get access to a variable telling which client I am playing against, but I'm getting compile errors while linking. One step I forgot to mention on 7/7/2008 was to compile UofA's game 4 entry, you have to copy SimpleTerrainWidget.C and SimpleTerrainWidget.H into the src directory as well as add them in the solution explorer. I also improved the siege mode in the corner code (see 7/4/2008) and studied how my normal client plays against UofA's entry from last year, as shown by this and this video. My client is red and in the 2nd video runs away easily.

7/14/2008
I added code to re-approach if my units on average are too far away from the enemy. For approaches after the first one, I use my old obstacle avoidance because the ideal order probably would be out-of-date by this time and the older avoidance code is better at getting units out of clumps. I also tweaked some variables.

7/13/2008
I fixed 2 silly bugs in the code that keeps units in the same order and experimented with what temporary code did best against UofA's entry from last year. I took video captures that you can watch here, here, and here of my client playing UofA's entry to help me identify why I don't beat it. The third video includes parameters tweaked in a way I am not sure I like.

7/12/2008
I replaced the code that made people move to their right if there was someone at their ideal position with code that attempted to keep units in the same order. It currently seems to have some problems. I also commented out my incomplete implementation of "optimized" collision detection because it seems that it would not help.

7/8/2008
I started implementing optimized collision detection, though you won't see the effects yet. I also moved an if statement so that a loop should run less often.

7/7/2008
I commented out some unused code and did some other minor improvements. I also got UofA's game 4 entry to run properly by using the command line "-ngfx". (The other steps are similar to the ones above.) It is becoming difficult to take videos because running the server and 2 of my clients is starting to use 100% CPU, causing one client to fall behind and making me have to switch between windows. (It seems that windows on top get higher priority.)

7/6/2008
Today, I replaced the mechanism that changed units' speeds with one that changed the ideal distance to be from enemy units and slightly improved compatibility with game 2.

7/4/2008
Today, I made units try to shoot at tanks, made tanks try to be closer to enemy marines, added a mechanism to change units' speeds to synchronize their distance from the closest enemy unit, and experimented with a new siege mode strategy. Here is a video of it playing itself, and here is a different video of it playing a buggy siege mode version.

7/3/2008
Today, I made units move to their right if there was someone at their ideal position and experimented with siege mode, though my current implementation of it is not good enough to keep uncommented. I have several ideas about what to do with siege mode to implement tomorrow. Here is a video of my client playing itself.

7/2/2008
Today, I fixed a silly bug in the map edge avoidance which had caused me to comment out that section.

6/29/2008
I got the tanks to appear in game 4. It turns out that part of it is defined in the code.

6/25/2008
I'm stuck because I have trouble understanding the competitors' entries, have trouble testing some code, and do not know what else to do. In the meantime, here is an up-to-date video.

6/24/2008
Today, I improved obstacle avoidance and made units shoot the unit in range with least hit points.

6/23/2008
Today, the changes I remember making are better obstacle avoidance, attention to cooldown (so that units can move between shots), moving to just out of the range of enemy units for 130 frames before attacking, and moving out of range during cooldown. I am not sure how I can improve it, though it is definitely not tournament-quality yet. Here is a slightly outdated video of it playing itself.

6/22/2008
A few days ago, I copied one of UofA's project files and replaced the folder in the apps folder in the VC++ solution explorer with a copy of the sample AI files. Today, I modified those sample AI files and now have a client that tells units to go to the closest enemy unit until it is in range, then fire at it. It currently does not handle obstacles well, but I will try to improve that in the next few days. Here is a video of it playing itself.