Oz’s Comprehensive Ideas For A New Game Engine (“AI”)

Shifting topics slightly: I've mentioned my belief that a combination of simple Booleans and simple math could drive sophisticated AI behavior (and I do hope to have time to fully illustrate this, sooner rather than later.

In the meantime, I had a conversation with Flintlock about how to assess the best place for an AI Civ to build its next City. It's, admittedly, a crude example, but it might help a bit:
Spoiler Simple AI Next City Build Algorithm :

For this, I was assuming that any new city will be founded five tiles away from any other city. (Of course, there will be exceptions to that rule, but, as I’m so fond of saying, “let’s burn that bridge when we get to it.”) For the time being, every potential Tile, within that 5 Tile radius, and the 8 tiles surrounding it, are evaluated. Flintlock and I agreed that Resources are undervalued - but that is what prototypes are for.

Most of the logic consists of simple IF/THEN statements, with only a few of the IF/THEN/ELSE variety.

So, to begin:

1. For every Tile, which is five Tiles away from any player city, separately SUM the “Food Value” (“FV”) and Shield Value (“SV”) for all nine files, taking into account any Bonus Resources.

2. There is only one modifier here: add “+1" to the FV for every Grassland or Bonus Grassland Tile adjacent to a river, excluding the NCPT itself (this modifier is addressed separately, below.

3. Next, “Keep” all NCPTV Tiles where the ratio of FV:SV is = OR > 3:2.

4. Then, SUM {“Total Food Value” + “Total Shield Value” = “NCPTV1.”} (The 1" =“1st iteration”)

5. Add/Subtract the following “Tile Modifiers” for each Tile adjacent to the NCPTV:

• FOR each Tile where TileType = “Volcano,” THEN -4 (chance of eruption.)
• FOR each Tile where TileType = “Jungle” THEN -4 (chance of disease.)
• FOR each Tile where TileType = “Marsh” THEN -4 (chance of disease.)
• FOR each Tile where TileType = “Tundra” THEN -4 (useless terrain)


• FOR each Tile where TileType = “Desert” THEN -3
• FOR each Tile where TileType = “Mountains” THEN -3

• FOR each Tile where TileType = “Plains” THEN -2
• Exception: IF {TileType = “Plains”} AND {Tile = Adjacent To River} THEN -1 (possible Irrigation)

• FOR each Tile where TileType = “Hills” THEN -1
• FOR each Tile where TileType = “Floodplains” THEN -1 (chance of disease.)

• FOR each Tile where TileType = “Forest” THEN = 0
• FOR each Tile where TileType = “Grasslands” THEN = 0
• FOR each Tile where TileType = “Bonus Grasslands” THEN = 0

1. Other Resource Bonuses are:
• FOR SUM of every Commerce Value (“CV”) ADD “+1."
• FOR SUM of every Gold Value (“GV”) ADD “+2."
• FOR SUM of every Luxury Value (“LV”) ADD “+1."
• FOR SUM of every Luxury Value (“LV”) ADD “+1."
• FOR SUM of every Luxury Value (“LV”) ADD “+1."
• FOR SUM of every Strategic Resource Value (“SRV”) ADD “+2."

2. Now, for one, single “sophisticated” Booleans:
• IF NCPT itself is adjacent to s River, THEN = +2 (automatic City Growth frolm “1" to “2.” )

- Once again: just an example.
 
Top Bottom