I've been working on a little script to pick my random AI's for me. My goal is for the script to accept a approximate difficulty between 1 and 10, and then equalize the difficulty [or challenge] based on the AI personalities chosen and the difficulty. For example, choosing a pair of easy AI types might be assigned a difficulty of 8 because they are easy AI types, where as technologist AI's might receive a difficulty of 6. I'd also like the difficulties to fluctuate a bit; ie. a set of AI's may both be given difficulty 7 or one might be given difficulty 8 while the other is given difficulty 5 or 6 - still averaging to about difficulty 7.
I have a few questions I've been thinking about and I'd like input from other players.
1) How much harder is a hard AI type than an easy AI type?
Consider something like a turtle vs a raid engine. I would say the raid engine is probably 3 or 4 times more difficult.
2) How does the difficulty scale?
Consider a difficulty 10 AI vs a difficulty 5. The difficulty 10 is not just twice as hard, it's probably about 10 times harder if not more. I would probably model these using a exponential of some kind.
3) How much effect on difficulty [or challenge] does the AI type have vs the difficulty level?
I would rather face a difficulty 8 turtle than a difficulty 7 raid engine.
import random
import time
diff_points = int(raw_input('Difficulty: '))
ais = []
ais.append(('Entrenched Homeworld', 1))
ais.append(('Fortress Baron', 1))
ais.append(('Grav Driller', 1))
ais.append(('Mine Enthusiast', 1))
ais.append(('One-Way Doormaster', 1))
ais.append(('Shield Ninny', 1))
ais.append(('Sledge Hammer', 1))
ais.append(('The Tank', 1))
ais.append(('Train Master', 1))
ais.append(('Turtle', 1))
ais.append(('Zenith Descendant', 1))
ais.append(('Assassin', 2))
ais.append(('Backdoor Hacker', 2))
ais.append(('Bully', 2))
ais.append(('Camouflager', 2))
ais.append(('Counter Spy', 2))
ais.append(('Experimentalist', 2))
ais.append(('Feeding Parasite', 2))
ais.append(('Mad Bomber', 2))
ais.append(('Peacemaker', 2))
ais.append(('Speed Racer', 2))
ais.append(('Starfleet Commander', 2))
ais.append(('Stealth Master', 2))
ais.append(('Tag Teamer', 2))
ais.append(('Teleporter Turtle', 2))
ais.append(('Vicious Raider', 2))
ais.append(('Alarmist', 3))
ais.append(('Attritioner', 3))
ais.append(('Golemite', 3))
ais.append(('Radar Jammer', 3))
ais.append(('Scorched Earth', 3))
ais.append(('Shadow Master', 3))
ais.append(('Special Forces Captain', 3))
ais.append(('Raid Engine', 3))
ais.append(('Technologist Homeworld', 3))
ais.append(('Technologist Parasite', 3))
ais.append(('Technologist Raider', 3))
ais.append(('Technologist Sledge', 3))
ais.append(('Technologist Turtle', 3))
ais.append(('The Core', 3))
diffs = [1, 2, 3, 4, 5, 6, 7, 7.3, 7.6,
8, 8.3, 8.6, 9, 9.3, 9.6, 9.8, 10]
while True:
ai1 = random.choice(ais)
ai2 = random.choice(ais)
diff1 = random.choice(diffs)
diff2 = random.choice(diffs)
if abs(ai1[1] + ai2[1] + diff1 + diff2 - diff_points*2.5) <= 2.5: break
print 'AI1: %s (%s)' % (ai1[0], diff1)
print 'AI2: %s (%s)' % (ai2[0], diff2)
time.sleep(120)
This is what I currently have. Sometimes I am wanting a difficulty 7 and a difficulty 10 AI is produced, but the other AI difficulty is greatly reduced to make up for it. The problem is that no amount of reduction to the other AI can compensate for the impenetrable difficulty 10 AI. I have tried multiplicative, polynomial, and exponential equations, but haven't produced any better results; for this reason I've posted the simplest equation and anyone interested can experiment further on their own.
I would also be interested in having such a feature build into AI war itself.
Thanks for your thoughts.