reaver, if you haven't read it already, check out
this interesting article series. I particularly like the state machine AI idea, and used that model in my own abandoned game Squirm, with data for different AI plugins stored in a file (kits/brains.yug in the source). Each state takes a quarry (called 'q'), which is the focus of attention of the active critter; when it's that critters turn, the state runs through a series of conditions. For instance, for a state like "zombi attack", the conditions and their triggers might be: * If 'q' is dead, mission accomplished, return to previous state, * if 'q' is in range to be attacked, do that, * if I can approach 'q' to come into attacking range, do that, * if 'q' is not in sight, explore to find 'q' (possibly heading for last known position of 'q', or scent, etc.), * if all else fails, wander aimlessly.
Some conditions trigger actions, other just change the state of a critter. This basic pattern can be scaled for more complex situations, including things like drinking potions, zapping wands, assigning quests, and going to the pub for a drink.
Oh and it might be better not to calculate LOS for every agent, as that's expensive. First try to see if it has any enemies close by. That can be optimized nicely by dividing the map into blocks, say 20x20 tiles each, and only check adjacent blocks for enemies.
In the system I used, whenever a critter performs an action, it checks to see if it's in line of sight of nearby critters, by checking a straight line for obstacles. Critters who see it, tests a series of conditions/triggers, based on their current state as well as their general world view (eg. an attacking state may have a condition to like anyone inflicting harm on your own enemy; a man-eating monster may be aggravated at the mere sight of any human whatsoever). This removes the load of performing a complete FOV calculation for every critter every round. Each critter keeps a register of other critters it knows about, with info on how well liked they are (bias). I found this kind of system could be made very flexible without getting too complex. It doesn't account for items lying inconspicuously around, though. I never got as far in Squirm, but a possible solution might be to let items emit a kind of beacon every three rounds or something, alerting nearby critters of their existence.
Just one of many plausible solutions.
As always,
Minotauros