Building issues

K

KetoGames

Guest
Hello! I am adding buildings into my zombie survival game. I've attached an image that displays the most of my problems:

upload_2016-11-27_23-8-50.png

In the first circle, zombies seem to clump up and get stuck on the buildings. Is there any good way to avoid this, preferably without pathfinding?

Also in the first, their arms stick through the walls. I was told that circular collision masks would be best since the objects can rotate freely without getting stuck on anything. Is there any way to avoid this, without making their collision masks huge?

In the other bubble, there is a body stuck under the building. Is there a way to push it away from the building while the death animation plays?

I can make more animations if needed, and I am decently proficient in programming. Any help would be wonderful. Thank you!
 
G

greeneman42

Guest
Perhaps you could try and create some sort of navigation nodes to help the zombies get to the player.



Whenever the zombies are in the light blue area, check to see if they have a line of sight on the player, if so, move towards him. However, if not, move towards the closest node, once at the node, see which node is closest to the player, and either ascend in node order, or descend until the zombie can see him. The nodes could just be a simple placeholder object that isn't visible. You could create a variable to keep track of each node and just use one object that way to place them in your room.

Hopefully that helps :) I don't have any experience with AI obstacle avoidance but I think this can work and even be expanded upon in the future if your buildings weren't too complicated.

Edit: Maybe what I described was pathfinding, so sorry if that's not what you wanted at all lol. But I kept thinking about it and made a little test that looks similar and allows the enemies to find the player using the shortest route despite the building. It's here if you wanna check it out.
 
Last edited by a moderator:
Top