Now, where the heck do I put the giant stack of methods I'm going to need for making Mobs act? Do I define their intelligence as an Object in itself? What's the most efficient way to send the movement information up and down between the Map Object and the Main Program? And how do I reinterpret all this into attacks?
I'd put the actual AI in each Mob's object to begin with. Once you've gotten a few of them working, then it'll be easier to see how to abstract it.
I've been liking how I've got my AI organized though. I've got a set of AI objects like:
IdleAI, WanderAI, PatrolAI, DigAI, RunAwayAI, SeeAndAttackAI.
And each monster definition includes a list of these AI objects in a particular order.
Whenever the AI is queried for an action, it starts at the top of the list and if an AI doesn't return an action, it goes and checks the next one until it finds one that feels like doing something.
So I've got a digging monster that has the AI's
- RunAwayAI
- DigAI
- WanderAI
So his first priority is to run away if there is danger. If there is no danger, the RunAwayAI doesn't return an action, so it moves to the DigAI. DigAI looks to see if there is anything appropriate for digging. If there is, it'll wander over and start digging until it runs out or the RunAwayAI is triggered. If there is nothing to run from and nothing to dig, it falls back to the last AI routine, where it just wanders around doing nothing in particular.
This way I can have each monster have a somewhat customized AI without writing a big routine for each one.