|
|
|
|
|
|
|
|
|
Re: First Screenshots![message #279779]
|
Thu, 12 May 2011 09:26
|
|
usrbid |
|
Messages:1506
Registered:December 2008 |
|
|
primetide... destructible environment ... major headache for the AI ...
Probably because the map data isn't stored in a way where the AI can process it easily.
- *All* map tiles / objects need a special "effort" cost attached to them
- A tile / object you can walk through has a cost of zero
- A tile / object you can destroy and then walk through has a cost of one
- A tile /object you can never walk through has a cost of 999
Now the pathing calculation of the AI needs to not only evaluate the movement cost but also include the additional "effort" cost. A cost of zero means there is nothing to do. A cost of one means that you need to spend an additional turn (yah, yah, I know its RTwP). Hopefully the cost of 999 will prevent the AI to try to cross.
A cost of one adds one turn worth of APs to the movement cost and you need to remember the additional effort was used. If the pathing determines that this is the best path, the algorithm needs to check if additional effort has been used and the AI needs to go into a sub routine to try to destroy the tile / object, however this may look like e.g. wire cutters, open door, plant bomb etc.
You probably have an issue with the current code because you handle the additional cost as more APs / time ticks instead of breaking it out into a separate calculation. Show this to your programmer, I am sure (s)he will make sense out of this.
In theory you can also handle multi round actions this way, for example if destroying an obstacle takes two additional round, such as planting a bomb (would end your turn) and then running away the next turn (so that you don't get injured from the explosion). For this you assign a cost of two to the obstacle.
I have played with this in the past, having efforts of more than two points tends to have undesirable results, such as the enemy actor is going to be dead by the time they make it through the obstacle, meaning they might be better off just taking cover and trying to get a lucky shot.
Report message to a moderator
|
|
|
|
|
|
|
|