Last modified 22 months ago Last modified on 04/25/10 23:13:26

This documents the semperfi AI mod, which is an experimental AI that is designed mostly as a test bed for new AI-related code. It only works for trunk.

Unlike the normal AI, you can gain debug information from it by controlling an AI player and selecting droids or buildings. Then they will tell you what they are doing. Clicking them may tell you some information as well, such as group membership.

It has some fundamental constants that are important:

LOW POWER: 250
HIGH POWER: 1250
MIN TRUCKS: 5
MAX TRUCKS: 9

On game start, if the AI has more than one factory, and can build hardpoints, it will attempt a truck rush to seal off the enemy at the closest undefended gateway to the closest enemy base. This is risky, and since we do not have danger maps, it is rather buggy on some maps where the trucks will merely die.

The basic design tree is as follows:

  1. Do we have more oil derricks than we can utilize with our power generators? If not, immediately allocate trucks to build more power generators. The only exception is if we are already building a power generator, in which case we first try to help build that one.
  2. If we have less than LOW POWER, we will send trucks to build oil resources.
  3. We will send trucks to help build other unfinished buildings.
  4. If we have more than LOW POWER, we will send trucks to build one of each fundamental buildings.
  5. If we have between LOW POWER and HIGH POWER amount of power, and more than one factory, we will send trucks to build oil resources.
  6. If we have more than HIGH POWER, we will expand our base (see build expand).

Build expand:

  1. Count all factories and research labs. If we have less than that number multiplied by LOW POWER amount of power, we do nothing. This gives us reserves, and stops us from expanding too much or too quickly.
  2. If we have less cyborg factories than normal factories, we build that.
  3. If we have less resource labs than normal factories, we build that.
  4. If we have less vtol factories than normal factories, we build that.
  5. If the number of vtol/cyborg factories and research labs is equal to or higher than the number of normal factories, we build that.
  6. Failing all above, we go to fortification.

Fortification

  1. Will try to build hardpoints on gateways. Only one truck will do this at the same time.
  2. Failing that, try to upgrade something.
  3. Failing that, try to build artillery ("incendry").

Build oil resources:

  1. Find an idle truck. Find the closest oil resource out of nearby danger. Send truck there.
  2. Failing that, see if we can upgrade something.
  3. Failing that, trigger build oil defense.

Build oil defense:

  1. See if we can build some defense around a nearby oil.
  2. Failing that, see if we can expand our base.