Fair play vs. cheating AIs
Posted: 13 Jan 2012, 15:34
I was wondering if it would be worth creating some guidelines for AI developers in order to ensure that AIs play fair. This would provide a quantitative way of assessing if an AI 'cheats' or not.
Here's my first attempt (this would probably be better in the wiki?)...
Visibility
A human player has 4 levels of visibility of items on the map, and your AI should work the same way:
Hidden
These are parts of the map covered by "fog of war" (FOW) and the human has no idea what's there.
If your AI wants to know what's there, it should scout or build radars / satellite uplink to remove the FOW (unveiling - see later).
Preview
These are features that were shown on the map preview when the human set-up the game, such as oil resources and player starting locations.
If they are in the FOW from your AI's perspective, the AI should unveil the map.
Echos
These are things in the FOW that are still visible on the map:
* a previously visible building that's now back in the FOW
* a previously visible droid that's just gone in to the edge of the FOW (a green radar ping appears to show it's movements in the FOW, but it eventually disappears)
It's not currently clear how an AI should deal with this. A request has been made for an isVisible property on droids/structures/features which would facilitate AIs handling this situation.
Visible
These are things that are in full view on the map, eg. within range of a radar/droid/structure or exposed by satellite uplink. You can look at them on the map and see what they are doing, etc.
Unveiling
Humans have to explore the map to remove the FOW and find things, and only then can they full interact with them. For want of a better term, I'm calling this "unveiling".
For example, if a human knows the rough location of an oil resource but it's in the FOW, they can't build a derrik on it. They have to send a truck to the general location and only once the FOW lifts and they see the oil resource can they build the derrik.
A request has been made for new events that would make it feasible for an AI to work this way (using the JS API): eventNewStructureDetected(structure,sensor) & eventNewDroidDetected(droid,sensor) & eventNewFeatureDetected(droid,sensor)
If these events (or similar) are provided, the AI can "head in the general direction" to lift the FOW then get notified of the new features/structures/droids that are unveiled and react accordingly.
Don't create stuff unfairly
Your AI can create structures/droids before they are researched or even if there isn't enough oil to create them. It can remove structures from the map without demolishing/recycling them. A human can't do this - so you're AI should resist the temptation and only do what a human could do.
If you want to create something, you have to research it and then build/recruit it in the normal way. If you want to get rid of something, you have to demolish/recycle it in the usual way.
Oil
Your AI can create oil out of thin air, but humans can't.
If you want more oil, you should unveil oil resources on the map, build derriks on them with a truck and build enough power generators (using trucks) to make them operate.
Here's my first attempt (this would probably be better in the wiki?)...
Visibility
A human player has 4 levels of visibility of items on the map, and your AI should work the same way:
Hidden
These are parts of the map covered by "fog of war" (FOW) and the human has no idea what's there.
If your AI wants to know what's there, it should scout or build radars / satellite uplink to remove the FOW (unveiling - see later).
Preview
These are features that were shown on the map preview when the human set-up the game, such as oil resources and player starting locations.
If they are in the FOW from your AI's perspective, the AI should unveil the map.
Echos
These are things in the FOW that are still visible on the map:
* a previously visible building that's now back in the FOW
* a previously visible droid that's just gone in to the edge of the FOW (a green radar ping appears to show it's movements in the FOW, but it eventually disappears)
It's not currently clear how an AI should deal with this. A request has been made for an isVisible property on droids/structures/features which would facilitate AIs handling this situation.
Visible
These are things that are in full view on the map, eg. within range of a radar/droid/structure or exposed by satellite uplink. You can look at them on the map and see what they are doing, etc.
Unveiling
Humans have to explore the map to remove the FOW and find things, and only then can they full interact with them. For want of a better term, I'm calling this "unveiling".
For example, if a human knows the rough location of an oil resource but it's in the FOW, they can't build a derrik on it. They have to send a truck to the general location and only once the FOW lifts and they see the oil resource can they build the derrik.
A request has been made for new events that would make it feasible for an AI to work this way (using the JS API): eventNewStructureDetected(structure,sensor) & eventNewDroidDetected(droid,sensor) & eventNewFeatureDetected(droid,sensor)
If these events (or similar) are provided, the AI can "head in the general direction" to lift the FOW then get notified of the new features/structures/droids that are unveiled and react accordingly.
Don't create stuff unfairly
Your AI can create structures/droids before they are researched or even if there isn't enough oil to create them. It can remove structures from the map without demolishing/recycling them. A human can't do this - so you're AI should resist the temptation and only do what a human could do.
If you want to create something, you have to research it and then build/recruit it in the normal way. If you want to get rid of something, you have to demolish/recycle it in the usual way.
Oil
Your AI can create oil out of thin air, but humans can't.
If you want more oil, you should unveil oil resources on the map, build derriks on them with a truck and build enough power generators (using trucks) to make them operate.