Monster “AI” Can Go Away
Still plugging away at the Monster "AI" although I've been sick so haven't been able to spend too much time on it.
The pathfinding itself isn't a problem, I'm using Dijsktra's Algorithm for pathfinding in general and have been for, what at least a year now, and it works great. The problem however is determining where to set the end goal nodes right>
For example, we need to find the full path to the player so that we can path properly in the event thatthere is an obstacle beyond the max range the monster can move. If we do that, though, then we could have a path longer than the max range. If we just lop off everything longer than the max range and go for it though, we could wind up with a last tile that is occupied by an ally. Tiles occupied by allies are ok to talk through, but NOT to land on, so what do we do?
After a little late night bickering with my husband as I explained the problem and why certain strategies do and don't work, we determined the best plan is to lop off everything past the max range, and then look at the last tile to see if we can stand there. If not, set that tile as being temporarily invalid to walk through and recalculate the shortest patht ot he target node.
Now, of course, this all assumes we can properly determine what the target node should be. For simple skills like melee range skills, we just need to look at the tiles surrounding the party members, find the closest oone we can reach and hit it. But what if it's a spell? Now we need to calculate the whole path, backtrack based off the range of the spell to determine how close we have to get before we're in range.
Now what is that spell has an area of effect. We need to figure out where the target spell tile is based off of how many of the party we can reach with it. The plan to tackle this one is to have a method to store the max number of targets hit based off skill shape, since I have different shaped skills in mind, lines, rings, "circles" etc. and then each pattern needs it's own calculation based off of where the party members are in relation to each other.
Annoyances abound, and I am not looking forward to it, although at the same time, once this is done and working to a certain extent, I'll have an actual working combat engine that I'll be able to expand on.
Also, monsters are able to be larger than one tile, so all of this gets more complicated since it needs to keep that in mind as well. FUN!














