I'm working on a grid- and turn-based strategy rpg. My problem is concerning finding best position for my AI to use a skill. But lets start at the beginning.
My plan is to make each skill an action for my AI. It checks for each action how effective it would be, chooses the best and does it.
Each skill has a usage and a affect area that can be circular or shapes like
[ [1,1,1,1,1], [0,1,1,1,0], [0,0,1,0,0] ]
which can be used in 4 directions.
The most simple solution would be to just check the affect area for each position and direction of the movable and usage area. But as these checks can get quite intensive I want to minimize them as far as possible.
One approach would be to combine the circular movement area with the skills usage and affect areas and find all target entities in it. So I have a list of all entities that could be targeted by the skill. The next step would be to group these entities by the skills affect area to rate it higher when the skill hits multiple targets. And as the new position and direction should get into that rating as well I have to check all possible positions for each group. And I've no idea on how to effectively do that.
1) Does this AI approach makes sense?
2) Is there a better way to define such grid-shapes and apply them to the checks later on?
3) Any ideas on how to group the targets by the skills usage area or minimize the positions and directions to check by the knowledge of where the target entities are?
Thanks for reading!
EDIT: After this is not going to get answered I have to ask another question: Am I bad in asking for help? In the 10 year's I'm developing now there were like five times were I really couldn't get further without a tip. But unless which way I try to ask for help (in the internet, asking the few developers I know or someone outside of the industry for understanding problems) I've never got any. To be fair I'm only coming with real problems after being stuck for days. But as I see the internet full of perfectly answered questions I begin to think: Is that my fault? What makes this question not worthy for an answer?