aIndy Version History (versions 3.0 and 3.1) Download from: http://deckard.mc.duke.edu/bolo/archive/aIndy_3.1.sit.hqx ftp://fly.mc.duke.edu/pub/bolo/brains/brains/current_interface/aIndy_3.1.sit.hqx aIndy 3.1 (released 23 November, 1997) Changes from aIndy 3.0 to aIndy 3.1: Completely reimplemented emergency pill drop functionality. The logic provides much better dropping decisions, and the choice of where to plant is much improved and results in much less man death. In particular, aIndy tries not to drop if it is likely the man will die when he leaves the tank (i.e. shells are about to hit us), tries to avoid sending the man to build just in front of the tank (which often fails), and tries to avoid building in the path of incoming shells. No longer drops pills in emergency if there are no enemy players. Reimplemented "Build Fort" as "Place Pill". Although still based around our bases, aIndy now places pills at much better positions than the previous algorithim, with effort made to cover other nearby bases and pills. Future work on this will focus on improving safety of the LGM, which is pretty poor in this version. Improved choice of when to kill a man by not targetting men that are out of gun range and close to their owners tank (often they are just building etc near the tank and we get unnecessarily distracted by this). Improved KillMan by using knowledge of when a man is heading for a pill to attempt to get him at the pill. This needs more tuning, as we are a little too eager when it's too late. It's a very simple implementation and will screw up sometimes, but othertimes it works well. Modified refueling such that aIndy sits on base corners if this helps avoid nearby pills, thus avoiding unnecessary building at times, and minimising needed barriers in general. When we capture our first pill, if all bases are spiked, we don't enter the "Place Pill" goal, but instead, use the pill to help us refuel. When waiting for man to build barriers to refuel on spiked base, aIndy now defends itself against incoming hostile tanks. When sitting on a base refueling, no longer goes into kill base mode unless it thinks it has enough shells to kill the base. aIndy now has a limit to the number of shells it will fuel up with, which is less than the maximum a tank can carry. In general this seems to be a good idea. Implemented a SetManTime function that calculates how long the man should be gone when we send him out to build something, instead of guessing like before. Modified choice of when to go and pickup our man, such that if he is running toward us and nearly there, just "ignore him". Exceptions: when on tarmac, then slow down to let him catch up; when on a boat, stop if he's nearby or if not go get him right away. Modified tree farming to prevent the man getting a tree if we are about to enter a boat, river or deepsea. Now also doesn't auto get a tree when on a boat (which often left the man behind as aIndy sped off). Modified tree farming while refueling so that we now get trees from a wider area if possible (previously only looked for trees in squares immediately around the tank). Part of this improvement is that aIndy tries to avoid getting a tree if the time required would be more than our estimated time of departure from the base (otherwise man gets left behind sometimes). Fixing pills, placing pills, and building barriers to refuel on a spiked base, all now use a new and much improved method of working out where to build from. Improved FixPill such that if the place we send the man from is dangerous, we move elsewhere instead of waiting for him, and while waiting for the man we look out for enemy tanks. Added special code to try and avoid going for a dead/highly damaged pill that is far away from us, when there is another pill nearby we could attack. Added code to ignore dead pills on deepsea that are covered, a tactic crafty humans could use to distract aIndy. Improved pill killing such that once a pill is dead, we try and avoid any shots it still has coming for us. When attempting to pick up a dead pill, aIndy will now kill very weak covering pills if appropriate. Improved GetPill so that when we are fleeing, we try and do so to cause damage to pills (e.g. when doing a take on two hostiles, turn inwards so that the closest pill gets completely killed). Implemented new code to shoot at enemy tanks while we are sitting still in various situations. This is just a reorganisation but now uses the more accurate tank shooting code of aIndy 3.0. Two improvements to tank fighting. In a very limited set of circumstances aIndy will try and retreat to a protected base. aIndy will now fight better when chasing a tank through forest. Improved choice of when to attack an enemy tank, such that when the enemy is carrying, we are more prone to attack even when our strength is low. Modified KillBase so that we can "kill" (ie drive over) dead bases when we have no shells. Also modified choice logic for killing bases in subtle but significant ways. aIndy should now be much more aggressive at killing bases, maybe even too agressive. Reimplemented allocation of memory to use Handles, and to use TempNewHandle as necessary. This means that aIndy only needs enough memory allocated to Bolo to enable the CODE to load, then it can use system memory if it can't get all the memory it needs from Bolo. When aIndy dies, the last goal (FixPill, getPill etc) is now forgotten, so that the situation can be totally reassessed. This may sound bad, but in fact aIndy's AI is written such that this is actually a bug fix. Modified reading of prefs file to be compatible with Bolo 997 and 998a2, also uses generic routine to try and determine key map for other Bolo versions. If a key map is undetermined, an alert box is displayed with the option to use a default key setup, or quit. In Bolo 997 and 998a2 also reads the auto slowdown setting from the prefs file (this may also work with the final release version of 998). A big thanks to Craig Hickey for sharing his code for this. Added Fine Aiming option to borg mode, where turning and adjusting the gun range are done in fine increments if the relevant key is only pressed for a short time. This allows a finer degree of control over aiming. I don't know how useful this really is though. Added Auto Slowdown option to borg menu, where the tank is stopped when the accelerate key isn't being pressed. This is useful for when the Bolo version is other than the recognised versions (see above on prefs file reading). If auto slowdown is ON in the Bolo prefs, this option is set ON at startup; following startup the menu setting overrides whatever was read from the pref file. Added new menu borg menu item, Messages To Self. When checked, and the tank is in borg mode, aIndy sends human allies readable messages to itself about pills and LGM. Shortened the messages that aIndy sends human allies about pills and LGM return times to be more concise. Man return times sent to human allies are now rounded to nearest ten seconds to speed comprehension, except when the return time is small. Added error checking to FAT startup code (BBRN Loader), with Alert for when an error occurs (the Bolo partition may be too small even to load the code resource itself). aIndy now uses a prefs file with version number in teh name, e.g. "aIndy 3.1 prefs". This means that different versions won't mess with each others preferences. Fixed three significant bugs in Route Finding. The first two were related to not recognising the terrain in front of the tank correctly when it isn't possible to travel diagonally (and we ideally want to go diagonally). One symptom of this is that aIndy would sometimes get stuck against objects it needs to shoot through to continue travelling. The other bug was in not recognising terrain of one of the diagonals correctly when trying to travel vertically or horizontally. Fixed bug in GetPill where the accelerate key was erroneously getting set when the tank was almost in pill shell range. Symptoms were the tank driving forwards when it shouldn't - sometimes straying into the pills range when meaning to sit and wait a while, and worse, sometimes straying into deepsea. Fixed major bug in KillMan, where every other call the man in question was computed to be stationary. With this bug fix, Killman is now much more effective. Fixed bug in man movement code, where hostile bases that were alive (instead of dead) were counted as passable by the man. Fixed hanging bug in man movement code. Fixed a bug in FixPill where aIndy would go into spasms (i.e. repeated large computations) if the pill to fix was covered and we couldn't find a safe place top build it from. Fixed bug where if aIndy was started with other than neutral bases on the map, some base stocks where set to zero, and then aIndy might enter the Explore state if no bases where counted as having any stocks. Fixed bug in GetPill, where when we are waiting for a pill to cool before attacking, we weren't correctly checking for a nearby safe place to wait. Fixed a bug where very damaged friendly pills would sometimes not be repaired or picked up (costing problem). Fixed a bug in detection of target of a shell which in particular meant that sometiems aIndy would briefly stop shooting at a pill it was attacking. Fixed bug where aIndy would go onto a coastline, and plan to build boat and use it, but instead would build long strips of road over the water. Fixed the bug in GetPill where aIndy would sometimes "shoot through" friendly pills it should be shooting past. Fixed bug where aIndy would go into spasms if it was trying to get a tree and the only trees it knows about are covered by pills. Bug fix: discovered that carriedPills field of tanks wasn't actually being initialised to 0 at startup, which would have been impacting on costing of tank targets in possibly bizarre ways. Fixed bug in KillTank. aIndy 3.0 (released 8 October, 1997) Changes from aIndy 2.6 to aIndy 3.0. This version was many hours in the making. Listed here are most, probably all, of the major improvements, and some of the many minor improvements. Added a new Alert box and logic to deal with non advantage mode (i.e. aIndy displays the alert, then shuts down). Improved the "factory defaults" for the menus. Modified pill to attack selection code so that early in the game we try and target closer neutral pills more (i.e. weighting of other factors was too high before). Modified code to go get the LGM so that if we don't have enough shells to reach him, go and refuel first. Similar to above, if we don't have enough shells to pickup a dead pill we have targetted, refuel first. Added logic to avoid certain processing tasks if CPU is too low (i.e. slow Mac, or too much going on to give aIndy enough time). Changed the way tree farming is done to be more eco friendly; this has positives and negatives I guess, I haven't watched it too much to see if it's overall a regressive change. Patched Route Finding a little so that if we are examining a square with pill with no strength, the cost is minimal. This way aIndy "automatically" picks up other pills (sometimes?) when on the way to get others. aIndy communicates it's current pill target, and "cost" estimate of getting there when picking up a dead pill and when fixing a pill. This info is used by a team of aIndies to try and limit the number of aIndies heading for any particular dead pill or pill in need of repair. (Previously, all aIndies would flock to such "attractive" targets). Similarly, aIndy communicates it's current neutral base target during the base grab, to try and prevent many aIndy's heading for the same base. Played around with Route Finding so that aIndy can shoot through single barriers when on a boat, if the boat is needed after the wall. aIndy watches friendly tanks that may be causing a danger to our LGM fixing some pill, and tries to avoid losing man this way. aIndy watches allied men, and tries to avoid driving on squares that would endanger them (only looking at the pill the allied man is going to fix). aIndy won't "flee" from these situations yet though. More readily shoot at friendly pills to piss them when sitting on a base. Will now shoot friendly pills to piss them, in order to protect dead pills (previously aIndy just tried to fetch the dead pill without using it's pill resources for protection). Modified KillTank so that the LGM isn't sent out when it's dangerous. Discovered that the way the selection of a tank to kill code was written meant that we only ever select the first "known" tank in our data, and this might not even be killable! Replaced this with code that considers all enemy tanks that we can kill, orders them, then picks the most attractive. aIndy is now much safer at picking up trees in desperate situations (e.g. need to plant pill and have no trees), since it looks around a bit for a good tree instead of getting the nearest one (which may be covered). aIndy tries to avoid picking up dead pills that are covered by hot hostile pills. aIndy can now rebuild dead friendly pills, and tries to do it if it is judged that building would be better than attempting to pickup. Previous aIndies and Indy 2.02 were not programmed to build dead pills (amazing huh); if you saw a man build a dead pill it's because the man was sent before the pill as actually dead. Refueling is changed such that: 1) aIndy doesn't try refueling at an occupied base (ie one which has an ally sitting on it), except in some special circumstances. 2) if a "manual" ally sits next to the base an aIndy is on for 1 second, then aIndy will vacate that base so that the ally can use it, except in special cases. Is 1 second too long or short? 3) if a non-manual tank, carrying pills, is sitting next to our base then vacate after 1 second, unless we are also carrying. This is to give preference to allies that are carrying when good bases are scarce. It works because if there was a good base for the aIndy ally to refuel at, it wouldn't be trying to get onto ours (see point 1). Improved decision when to go for a pill, if sitting on a base while carrying pills, aIndy will get more armor than it used to. Implemented a Base Killer mode, in which the aIndy will target enemy bases as first priority. Base Killer mode is entered/exited manually or automatically: One aIndy on a team will automatically become a Base Killer iff the number of players on the team is at least 2 more than the total number of hostile players. It exits Base Killer mode when there are no enemy bases. So, playing against 3 aIndies should be much more challenging now. Modified the way aIndy attacks bases which are covered by enemy pills, to allow Base Killer aIndies to be more successful. A human ally can also command one or more aIndy tanks to enter/exit Base Killer mode. This is done using a modified form of the "kill base" command, in which you replace the base ID with ON or OFF as required. Note also that the kill base command can now be given in the short form using just k, e.g. !k 5, !k on, !k off (see the section on command message changes for other changes). Added commands to support pill massaging, i.e. to get aIndy to auto re-ally you after leaving the alliance. (see section on commands). Added menu item "Pause at Startup". When checked, pause will be switched on every time aIndy is started. Handy for starting games with/against bots, so you don't have to set "pause" on for each one by hand. Added memory of deepsea squares that have been seen, this enables aIndy to tell if a dead pill is on deep sea or not (it is difficult otherwise to tell believe it or not). aIndy still doesn't use the information as well as it should though. Extensively reworked parts of the route finding, including coverage system - aIndy now uses information regarding enemy pills "blocking" other enemy pills. Implemented new Path Checking code for the LGM, which takes account of the fact that the LGM can move around objects; previously the linear path was checked, and if any blocking terrain encountered the path was considered impassable. Using similar code to Path Checking, the Kill Man code works much better - it can predict much better where an enemy LGM will be (previously linear path was assumed). Other good improvements were made, and overall, LGM killing is much better. Improved KillTank aiming. When enemy men are dead aIndy more aggressively targets enemy pills (i.e. in preference to neutrals). I have now extended this so that if *all* enemy men are dead, it's even more aggressive. When allied men are dead, aIndy computes their return time, and sends this to allies. I think it also sends return time for dead enemy men. the return time is only sent if you told aIndy you are a "manual" player (by sending a "!mytype manual" message). New FixPill. It is now heaps better :-). One aspect is that it avoids using the pill it is trying to fix as a barrier to hide behind if in range of en enemy pill (which was usually fatal to the LGM ;). Update the message system so that aIndy 27 can tell who is an allied aIndy 27, this is the use of the /goodbye message when you shut down aIndy. Added code to detect switching pill targets based on distance. If we try switching back based only on distance, it isn't allowed. It works, only for switching between two pills though, but that's much better than no detection. Improved GetPill: new code for determining when to turn and run from a pill we are shooting at, resulting in faster pill takes. improved the code that determines if we fix the terrain of the square we will be attacking a pill from. much better aiming for edges of pills tank drives out from behind a barrier to get a better shoot angle if possible; drives behind barrier if that's useful. fine tuned attack positions data. tries much harder to use n pill as a barrier in preference to a wall. And ... drive not so close to target pill, shoot earlier, flee earlier if the pill is strong, decelerate sooner when fleeing, checks for danger and blocks when fleeing. Implemented basics of pill massaging, but this isn't ready for prime time yet, so it is unused code. Key problem is WHEN to try a pill massage. Added reading of the Bolo prefs file, to get the keys that are set up for Bolo, and use them. Thanks are due to the person who submitted this code by to brains list: Craig Hickey, hickeyc@cadvision.com or cmhickey@acs.ucalgary.ca. Added code which specifically deals with the case of numEnemies == 0. In this case aIndy now looks much more intelligent when playing against no one. Implemented code that finds source and dest of each shot visible. This is used to detect if an allied tank is firing at one of our pills, and if so don't rush over to fix it. Similarly, don't rush to an fpill to fix it if it is being hit but there are o enemy tanks or pills around. This all prevents loss of LGM by attempting to fix pill being picked up; also prevents frustration of human allies ;-). Choosing which base to build pills at: tries to only build two pills at each base instead of three, also uses KevDogs idea for building closer to enemy territory. Before shooting a pill to piss it off, checks if anything else is already shooting that pill. Modified shooting of neutral pills to kill enemy tanks - now only does this if enemy tank is very close to neutral pill and we are far away. Fixed bug in recording of x,y locations of tanks as given by Bolo, causing aIndy to aim poorly. Fixed bug in parsing of messages. Fixed two instances where the "ninth" surrounding square was being examined. Fixed bug where Pause/Cont messages were not adjusting state of Pause menu item. Fixed a "silly bug in refuel" (didn't record what it was). Fixed bug in Refuel where the terrain to build a barrier on wasn't exhaustively checked, so sometimes aIndy would build a boat on river, instead of a road, then a wall. Fixed bug in which pills could become momentarily forgotten. Fixed handle leak in Prefs code form aIndy 2.6. Fixed bug in GetTankFromXY where last tank wasn't being considered. Fixed bug in the code for costing pills to attack where the number of covering pills wasn't being considered. Fixed a divide by zero error. New/changed messaging: Can now optionally use '.' character as prefix for commands. Added "very short forms" for kill base, get pill, and suicidal get pill commands. Examples: !k 2, !g 1, !s 7 Modified Kill base command to switch base killer mode on and off. This is achieved by replacing the 'ID' with either 'on' or 'off'. e.g. !k on Added Re Ally function. This is the where you tell aIndy to request alliance with you as soon as you leave the alliance. This way you can use aIndy as a pill massage partner. Can be invoked as a one off, or switched on and off.