ID:87362
 
Keywords: ai, code, design, spec

Poll: Do you think this design approach will fail in the end?

Yes 22% (8)
No 27% (10)
Other (see comments) 2% (1)
LimaBeans 47% (17)

Login to vote.

The design approach:
Step 1.
Create an AI base loop.

Step 2.
Create actions and update the AI to use them inside the loop. (Build, Attack, Defend,etc)

Step 3.
Constantly test AI against itself as I'm adding actions.

Step 4.
When actions are mostly implemented and interesting games can be played in full by the AI, add the ability for a player to join and play.

I'm currently on Step #1. At this point, I have no idea what type of RTS it will be and I intend to keep it that way for as long as possible. I will essentially start adding generic RTS like actions without any direction or forethought and I believe this will lead me to where I need to go. :) Just need a little faith is all.

Here are some real time notes from my efforts this morning.

Hooked up the attribute+1d100 and it looks alright.

Here's a shot of the AI's "personality".


Here's a shot of the AI (not the same AI as above) running.


Seems crazy to have the AI try to perform one of these action once a second. I will have to work on that. Hard to say at this point what will make sense as far as loop delay.

I realized while writing the AI mob that I could merge the Player and AI mob into ActivePlayer. By doing this, I will actually be able to track the players actions and essentially model and record their behavior using the same methods and attributes I would use with the AI. A couple of interesting things can come from this.

1. Save and reuse the Player models against the players.
2. Constantly analyze player behavior during games and tweak the AI to provide a better challenge. This would be my first AI cheat since I can make adjustment without "seeing" my opponent. :)
3. The game can compare and track the success of AI models vs different Player models and automatically pick the best challenge for the player.

Fun.

Alright. Here's early output of how the AI will behave. I added 4 AI's and cranked the tick rate. The "Action Count" shows how many times the AI randomly chose to perform an action. Later on, I will probably use the tick rate to essentially dumb down the AI but right now, they are all the same.

STATS FOR: AI#1
Attributes:
Aggression: 98
Exploration: 36
Military: 66
Defense: 31
Expansion: 72
Research: 98
Materials: 50

Action Count: (Based on 9366 ticks)
Aggressive Acts: 1349 (14%)
Exploration Acts: 765 (8%)
Military Acts: 1114 (11%)
Defensive Acts: 690 (7%)
Expansive Acts: 1344 (14%)
Research Acts: 1292 (13%)
Materials Acts: 911 (9%)
Do Nothing: 1901 (20%)


STATS FOR: AI#2
Attributes:
Aggression: 30
Exploration: 39
Military: 42
Defense: 71
Expansion: 35
Research: 45
Materials: 89

Action Count: (Based on 9366 ticks)
Aggressive Acts: 646 (6%)
Exploration Acts: 810 (8%)
Military Acts: 824 (8%)
Defensive Acts: 1209 (12%)
Expansive Acts: 770 (8%)
Research Acts: 886 (9%)
Materials Acts: 1309 (13%)
Do Nothing: 2912 (31%)

STATS FOR: AI#3
Attributes:
Aggression: 58
Exploration: 26
Military: 91
Defense: 59
Expansion: 22
Research: 25
Materials: 7

Action Count: (Based on 9366 ticks)
Aggressive Acts: 1014 (10%)
Exploration Acts: 601 (6%)
Military Acts: 1405 (15%)
Defensive Acts: 999 (10%)
Expansive Acts: 583 (6%)
Research Acts: 626 (6%)
Materials Acts: 382 (4%)
Do Nothing: 3756 (40%)

STATS FOR: AI#4
Attributes:
Aggression: 29
Exploration: 77
Military: 84
Defense: 99
Expansion: 54
Research: 14
Materials: 30

Action Count: (Based on 9366 ticks)
Aggressive Acts: 648 (6%)
Exploration Acts: 1338 (14%)
Military Acts: 1401 (14%)
Defensive Acts: 1314 (14%)
Expansive Acts: 964 (10%)
Research Acts: 434 (4%)
Materials Acts: 646 (6%)
Do Nothing: 2621 (27%)

You know, up front, it looks pretty sexy. Almost like I know what I'm doing. :)

Comments, nay saying, questions, and etc are welcome. Feel free to bash on the approach. I am by no means endorsing it. Just trying to have a little fun.
I was going to answer no in the poll, until I saw the last option. Either way, it sounds good, just don't forget to make those actions datums :P
lima beans