Changes between Initial Version and Version 1 of AI_Notepad


Ignore:
Timestamp:
Feb 23, 2008, 4:18:58 AM (16 years ago)
Author:
trac
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • AI_Notepad

    v1 v1  
     1This development notepad is an organized way to jot down preliminary API decisions. Nothing is finalized. If it doesn't add up, it WILL change.
     2[[BR]][[BR]]
     3= TODO =
     4Decision Tree Generation[[BR]]
     5Event Handler[[BR]]
     6State Machine[[BR]]
     7
     8= Mediator =
     9Mediators encapsulate how a set of objects interact. We will have a mediator that describes the heirarchy and how the nodes (objects) relate to eachother. A scripter could choose to create his own mediator to change the way the AI "thinks". For example, one could make it so Military interacts directly to Economy and Diplomacy instead of having to go through Commander. The nodes somehow will be responsible for the pieces of the State Machine that pertain to it probably using a chain of responsibility or simply encapsulating it by node which is much more flexible.
     10[[BR]][[BR]]
     11The interaction between nodes will need handlers to Filter Up and Specify Down the various messages it needs to work with.[[BR]]
     12[[BR]]'''Filter Up:'''[[BR]]
     13We will need to create objects that can analyze an array of recieved messages and return a more general state/need. When it does that, it also removes the states/needs it used to make the recognition.
     14[[BR]]'''Specify Down:'''[[BR]]
     15We will also need objects that can intelligently seperate messages into smaller messages.
     16== Commander ==
     17The Commander node makes sure everything is up to date and creates the strategies the other nodes must accomplish.
     18== Economy ==
     19The Economy node makes sure the economy is running as smoothly as possible and decides on how to manage civilians based on needs.
     20== Diplomacy ==
     21The Diplomacy node handles issues that can be categorized as diplomatic and political. The major role of diplomacy is communicating with the AI: Player to AI and AI to AI. The Diplomacy node can send messages to any AI's Commander node. It's the only way to communicate, it should not be possible to directly communicate with other nodes. Player to AI communication could simply be taking notice of all available ways a player can communicate such as signals and chat. The node can then decide what to do with that information.
     22
     23== Military ==
     24The Military node develops military tactics to accomplish goals set by the Commander.
     25== Groups ==
     26The Groups node is the Flocking logic of the game.
     27
     28== Units ==
     29The Units node is the lowlevel logic for units such as attack, walk, garrison, etc.
     30
     31= Decision Trees =
     32== Constraints ==
     33== Learning ==
     34The AI can be capable of learning by remembering past experiences. Experiences can be outlined using the route chosen in a Decision Tree. The AI could learn as it plays the game by figuring out which past decisions were more favorable to reach a defined goal.
     35
     36= State Machine =
     37== Game ==
     38=== State ===
     39string Game.getMap()
     40
     41Player Game.getPlayers()
     42
     43Resource Game.getStartingResources()
     44
     45int Game.getTime()
     46
     47int Game.getType()
     48
     49int Game.getStartingPhase()
     50
     51int Game.getMapSize()
     52
     53int Game.getBorderTimer()
     54
     55int Game.getMaxCenters()
     56
     57int Game.getVisibility()
     58
     59int Game.getPopCap()
     60
     61int Game.getDifficulty()
     62
     63int Game.getVictoryCondition()
     64
     65bool Game.isOnline()
     66
     67bool Game.hasTeams()
     68
     69bool Game.hasTeamsLocked()
     70
     71bool Game.cheatsEnabled()
     72
     73bool Game.playerInGame(String player)
     74
     75bool Game.playerResigned(String player)
     76
     77int Game.buyingPrice(String resource)
     78
     79int Game.sellingPrice(String resource)
     80
     81=== Action ===
     82void Game.chatLocalToSelf(String message)
     83
     84void Game.chatToAllies(String message)
     85
     86void Game.chatToNeutrals(String message)
     87
     88void Game.chatToEnemies(String message)
     89
     90void Game.chatToPlayer(String player, String message)
     91
     92void Game.tauntLocalToSelf(int tauntID)
     93
     94void Game.tauntToAllies(String message)
     95
     96void Game.tauntToNeutrals(String message)
     97
     98void Game.tauntToEnemies(String message)
     99
     100void Game.tauntToPlayer(String player, String message)
     101
     102void !EventHandler.acknowledgeEvent(String eventID, String player)
     103
     104void !EventHandler.acknowledgeSignal(String signalID, String player)
     105
     106void !EventHandler.disableTimer(int id)
     107
     108void !EventHandler.enableTimer(int id, int time)
     109
     110== Players ==
     111=== State ===
     112string Player.getCiv()
     113
     114bool Player.receivedResourceFromPlayer(String resource, String player)
     115
     116int Player.resourceAmountReceivedFromPlayer(String resource, String player)
     117
     118int Player.getID()
     119
     120int Player.getScore()
     121
     122int Player.getPhase()
     123
     124int Player.getTimeInAge()
     125
     126int Player.getCurrentPop()
     127
     128int Player.getEconomicPop()
     129
     130int Player.getNonEconomicPop()
     131
     132Resource Player.getResources()
     133
     134array Player.getUnits()
     135
     136array Player.getStructures()
     137
     138bool Player.isDefeated()
     139
     140bool Player.canAffordUnit(Type)
     141
     142bool Player.canAffordBuilding(Type)
     143
     144bool Player.canAffordTech(Type)
     145
     146bool Player.canAffordWall()
     147
     148bool Player.canBuy(Type)
     149
     150bool Player.canSell(Type)
     151
     152bool Player.canResearch(Type)
     153
     154bool Player.canTrain(Type)
     155
     156bool Player.canBuild(Type)
     157
     158int Player.getBuyPrice(Type)
     159
     160int Player.getSellPrice(Type)
     161
     162int Player.numEnemyBuildingsInTown()
     163
     164int Player.numEnemyBuildingsOfTypeInTown(Type t)
     165
     166int Player.wallCompletedPercentage(int perimeter)
     167
     168int Player.wallInvisblePercentage(int perimeter)
     169
     170int Player.stanceToward(String player)
     171
     172=== Action ===
     173void Player.tribute(Player, int food, int wood, int stone, int ore)
     174
     175void Player.resign()
     176
     177void Player.setStance(Player, int)
     178
     179void Player.research(Type)
     180
     181void Player.buy(Type)
     182
     183void Player.sell(Type)
     184
     185void Player.declareCentralObject(Type t, Array pos)
     186
     187void Player.declarePlayerCentralObject(String player, Type t, Array pos)
     188
     189void Player.build(Type t, int distance)
     190
     191void Player.buildAtPos(Type t, Array pos)
     192
     193void Player.buildForward(Type t, String player, int distance)
     194
     195void Player.buildWall(int distance)
     196
     197void Player.buildWallAroundPlayer(String player, int distance)
     198
     199void Player.train(Type unitType)
     200
     201void Player.trainInBuilding(type unitType, Building b)
     202
     203void Player.acknowledgeTribute(String resource, String player)
     204
     205== Resources ==
     206=== State ===
     207int Resource.getWood()
     208
     209int Resource.getFood()
     210
     211int Resource.getStone()
     212
     213int Resource.getOre()
     214
     215int Resource.getMinDistance()
     216
     217== Structures ==
     218=== State ===
     219array Structure.getWaypoint()
     220
     221int Structure.getPercentConstructed()
     222
     223Unit Structure.getLastAttacker()
     224
     225int Structure.getLastAttacked()
     226
     227bool Structure.isConstructing()
     228
     229bool Structure.isConstructed()
     230
     231bool Structure.isLocked()
     232
     233bool Structure.isQueued()
     234
     235bool Structure.isUnderAttack()
     236
     237=== Action ===
     238void Structure.setWaypoint(x, y)
     239
     240void Structure.train(Unit)
     241
     242void Structure.cancel(Unit, amount = 1)
     243
     244void Structure.lock()
     245
     246void Structure.unlock()
     247
     248void Structure.delete()
     249
     250== Units ==
     251=== State ===
     252array Unit.getPosition()
     253
     254int Unit.getCurrentHP()
     255
     256int Unit.getMaxHP()
     257
     258int Unit.getCrushArmor()
     259
     260int Unit.getHackArmor()
     261
     262int Unit.getPierceArmor()
     263
     264Type Unit.getType()
     265
     266int Unit.getCurrUP()
     267
     268int Unit.getNextUP()
     269
     270Unit Unit.getLastAttacker()
     271
     272int Unit.getLastAttacked()
     273
     274bool Unit.isBalanced()
     275
     276bool Unit.isAggressive()
     277
     278bool Unit.isDefensive()
     279
     280bool Unit.isDead()
     281
     282bool Unit.isIdle()
     283
     284bool Unit.isRepairing()
     285
     286bool Unit.isConstructing()
     287
     288bool Unit.isPatrolling()
     289
     290bool Unit.isHealing()
     291
     292bool Unit.isEscorting()
     293
     294bool Unit.isAttacking()
     295
     296bool Unit.isGathering()
     297
     298bool Unit.isGatheringWood()
     299
     300bool Unit.isGatheringFood()
     301
     302bool Unit.isGatheringStone()
     303
     304bool Unit.isGatheringOre()
     305
     306bool Unit.isGarrisoned()
     307
     308array Unit.getPosition()
     309
     310int Unit.getCurrentHP()
     311
     312int Unit.getMaxHP()
     313
     314=== Action ===
     315void Unit.repair(Structure)
     316
     317void Unit.patrol(array, array)
     318
     319void Unit.heal(Unit)
     320
     321void Unit.escort(Unit)
     322
     323void Unit.attack(Unit)
     324
     325void Unit.attackPlayer(Player)
     326
     327void Unit.gather(Type)
     328
     329void Unit.move(x, y)
     330
     331void Unit.garrison(Structure)
     332
     333void Unit.construct(Type, x, y)
     334
     335void Unit.buildWall(array, array)
     336
     337void Unit.delete()
     338
     339== Entity Filters ==