Introduction to AI


Project Module (Cross-Cutting)

space settlers

This semester you will be using a gaming simulation system for your projects called Space Settlers.  This game was written by Dr McGovern and was inspired by the arcade game Asteroids and an another game called Spacewar.  Dr McGovern has redesigned her own Spacewar implementation from several years ago and we are now using a game she calls Space Settlers.

Space Settlers has two alternative paths to victory. The first is a competitive environment where multiple teams of ships compete for resources and the winner is the one who lives the longest, kills the most other ships, and collects the most resources.  The second is a cooperative environment where multiple teams of agents work together to collect resources and build up their settlements.  This second was inspired by Settlers of Catan, which is how the game got renamed from SpaceWar to Space Settlers. Both are valid approaches and it is fine to pick either one and also fine to switch approaches between projects. 

Lots of ways to play

Space Settlers screen shot

 Screenshot from a Capture the Flag game inside Space Settlers

basic Space settlers Rules

  • The simulator runs for a fixed amount of time steps, moving ships around and handling all collisions. At the end, a winner (or set of winners in the cooperative version) is declared.
  • Turns: At every time step, you may choose any combination of the following actions.
    1. Accelerate your ship in some direction (turning and linear)
    2. Make a purchase (if your team has sufficient resources to afford the purchased item)
    3. Use a power-up (includes weapons and defensive mechanisms
  • Once you have collected resources, there are a variety of purchases available to your team. You can buy additional bases, power ups that let you hold more energy or heal faster, shields, and additional weapons. In later projects, you will be able to purchase additional ships. Purchase costs start low but double with every purchase of that item.
  • Scores: The score used for the game is chosen in the setup file.  The method updateScores() in SpaceSettlersSimulator.java shows the full list of scores.  Below is a partial list.
      • Resources:  Count up all the resources collected
      • Kills: Count the kills 
      • KillAssistsAndCores: Count kills and assists and AI cores collected 
      • Flags: Count the flags collected

Space settlers objects

Ships

The main controllable unit in the game are the ships.  In the initial projects, you will only have one ship.  Later projects will let you control a whole team of ships (as well as to purchase more).  Your job this semester will primarily be to control ships though you will eventually control other objects in the simulator as well.

Screenshot of a ship

Screenshot of a ship showing the current energy (4675).  The small pink circle is a missile (see below).

Energy

Every movement and/or power-up takes energy. Movement energy is proportional to your mass and acceleration.  Power-ups take a fixed amount of energy to deploy.  If you run out of energy, your ship will temporarily die. It will re-spawn but that will take time away from your game time. There is an increasing delay every time a ship dies (up to a maximum delay time).  To collect new energy you have two choices.

  1. Collect a yellow energy beacons for a fixed amount of extra energy (power-ups can improve this).
  2. Fly your ship to one of your bases to boost your energy.  This depletes your base for a time so you can’t just hang around at your base and collect energy forever.  

Note: Energy beacons do not move.  They disappear if a ship collects them or if a moving obstacle (asteroid) runs into them.  The beacon will then randomly reappear somewhere else in the environment.

Energy beacon

Screenshot of an energy beacon.  They are always yellow and have an E in the center.

Home bases

Each team has an initial home base (placed randomly within the team’s starting region).  Additional home bases can be purchased after acquiring the right resources.  The home base is where ships need to go to deposit resources or flags.  It can also be used to re-energize a ship. 

Your base will recharge your ship’s energy in proportion to its own energy/health levels. If enemies damage it, the recharge level will be lower. It will rebuild its own health but it is slow (power-ups can fix this).

Secondary bases can be killed. Be careful, you can kill your own base by accident! You cannot kill any team’s original home base. To kill a base, you just need to drop its energy to zero (e.g. shoot it until it loses all its energy).

Base screenshot

Home base is colored by the team it belongs to and shows the current energy it can give to a ship (2500 in this example) as well as resources or flags collected (currently 0).

asteroids

Space Settlers has three kinds of asteroids: mineable, non-mineable, and gaming. Mineable asteroids have resources inside them that can be mined and stored in a ship.

There are three kinds of resources:

  • Water
  • Fuel
  • Metals

To collect a mineable asteroid’s resources, the ship needs to touch it. Note: Once you have a resource in your ship’s cargo hold, it must be delivered back to one of your bases before your team can count the resource towards winning or use it for purchases.

Gaming asteroids are mineable asteroids but with more resources available.  However, you can’t obtain the resources unless you win the game against the asteroid’s AI.  This kind of asteroid will not show up until we get to adversarial search.  It will look just like a mineable asteroid but it will have a G inside it.  To obtain it, you will need to go touch it (as with a mineable asteroid) and then play the game against it.

The non-mineable asteroids cause damage in proportion to the velocity at which the ship hit the asteroid.

Asteroids can either move or be stationary. If they move, you have to chase them down to collect their resources.

Screenshot of asteroids

All mineable and gaming asteroids have some mixture of the three resources. This is depicted graphically in the GUI with blue showing WATER, green showing FUEL, and gray showing METALS.

Screenshot of non-mineable asteroids

Non-mineable asteroids are brown. They cause a ship to bounce if they are touched. 

AI Cores

If a ship dies before getting its resources back to its base, the resources are lost but it drops an AI Core, which you can pickup and use to purchase other resources. This core is fragile and only lasts on the screen for a few bounces or hits (so it can be shot).

AI core screenshot

AI cores are just circles with the letters AI inside them

Space settlers power ups

One you have collected resources, you can purchase power ups for your ships and bases.  Note that you start with a small supply of missiles so these do not need to be purchased.

  • Shields
    • These can be deployed around ships or bases and they block all incoming missiles.  Note they also block you from depositing resources at your base or powering up from your base.
  • Mines
    • Mines can be dropped near a ship and then they explode when another ship comes near.  They cause damage to any ship near the explosion (they will not explode right away when you drop them so they do not hurt your own ship to deploy).
  • Electro Magnetic Pulses (EMPs)
    • These deploy like a mine but they do not cause damage.  Instead, they block the affect ship or base from taking any actions for a period of time (basically acting like it fuzzed out all your electronics for a period of time).
  • Drones
    • Drones can be programmed to go to a destination autonomously.  These rely on AI Cores to deploy.
  • Double your base healing speed
    • You can purchase a power up to double the healing speed of your base
  • Double your maximum energy
    • You can purchase a power up to double the amount of energy your ship or base can hold
  • Double your weapons capacity
    • All of the weapons have limited capacity.  You can purchase a power up to double your ship’s capacity to hold weapons

 

Semester project list