I have had a long thought about AI.
Here are my suggestions how it can be improved:
1. Fear. I would like to have monsters that run away. This could be under the following circumstances:
2. Communication between monsters.
3. Non-target specific AI code. At the current moment, monsters can only attack players. I would like to see that different.
4. Better path-finding. In the current situation monsters try to run towards you. If they got blocked, they stop moving. I do not have one solution for this problem, but 3 ones (and all in some way or another flawed).
PS: Clint, I do not post this to give you more work. I am confident enough in my coding skills that I can probably implent these AI improvements myself.
I was thinking the same things for the two firsts points during my last game (I agree with the third, and know nothing about pathfinding...). I would just add that these better AI may be depending on the subject: I can't imagine a minotaur, a zombie or a spider fleing or screaming for help. But a goblin, yes.
Completely True.
Some monsters are loners, others are team-workers, so most AI parts should be configurable. (You'll have a hard time scaring off a minotaur)
I forgot to mention that I want to make variables in the AI code. (E.g. Courage, Cooperative skills, melee-ranged preference). I hope that will improve the feel that every monster is different.
AI gets into a long discussion, I think we should figure stuff out before code gets written/changed.
Pathfinding
Currently the pursuit AI is dead simple: face the hero and walk forward. It is supplemented by one main feature: If the enemy loses Line of Sight on the creature, the enemy instead pursues where it last saw the hero. This works surprisingly well for most situations.
I think this could be supplemented by A* in the following way: If the enemy has Line of Movement, use the simple pursuit (face hero, move forward). If the enemy loses Line of Movement but can still see the target, calculate an A* path once and follow that path until Line of Movement is re-established (then abandon the A* path and continue with simple pursuit).
Fear
This can be done simply: face away from the hero and move forward. A chance_flee could be used, and checked when certain situations occur (e.g. another nearby enemy dies, the enemy takes damage, etc). Spells could also have a fear_duration added (War Cry was intended to have an AOE fear component).
Monster Packs
One simple way that monster packs can be done: enemies in combat could emit an AOE pulse that targets creatures (e.g. source Neutral). It could have no damage component but still have an attack roll. Basically, if a creature is attacked (even if missed) it automatically enters combat. Dropping an invisible AOE hazard could be an easy way to get nearby creatures into combat.
Non-Target Specific AI
This might be too far outside the scope of Flare 1.0. Save it for another time. Flare 1.0 won't have henchmen, pets, multiplayer, creatures attacking each other, etc.
Here is a pathfinding algorithm I made
Is this a good idea for FLARE?
PS: I am aware that flare is written in C++ and this application in C#. I am willing to rewrite it.