Hi Guys,
I have been beating my head against the wall for a while trying to solve this, but have had no luck.
I am creating a top down zombie shooter, however even though my opponents are zombies, they are just a BIT too stupid. Right now, you can easily stack up large groups of enemies behind each other, despite the fact that there is room on either side.
This is what my zombies end up doing.
My basic code goes like this:
<psuedo code>
if(zombie not in range && can see me){
if(nothing in way){
Move Towards()
}
}
if(inRange){
attack
}
</psuedo code>
However this results in the chain of zombies halting once one of them reaches the target.
In the image above, you can clearly see that the second (the larger) zombie, could move around the other zombie, so that it could get into range of me.
Even better would be having it “shove” the other zombie, so that it (the shoving zombie) can move in a straight a path as possible. Ideally the zombie being pushed should not end up partially through a wall, on top of the character, inside another zombie (this could be done by shoving the OTHER zombie) etc.
I do not NEED you to write all this code for me, but examples, or just ideas, would be deeply appreciated. It might also be best if you could explain any concepts that you reference (eg: if you say I should you the potentiality inducing matrix, you might need to explain what this means, or provide wikipedia links )
Thanks,
- Dan