This tutorial goes over the basics of planning and setting up a zombie AI from scratch.
This includes:
-idle state
-run/walk towards player state
-pathfinding around objects state
-hitting player state
Most people starting out in BGE want to create some sort of zombie shooter game, so I figured I might as well make a tutorial on it
I love zombies. Good job Tim. Thatâs exactly the way I do it, with the exception of the Navmesh. Zombies canât rationalize obstacles. Which is why theyâre always stuck on things. LOL Kidding. I bone parent a cube (hitbox) to the zombies head bone, static, ghost, actor, invisible. then interconnect that to the zombies death state. because the only way to kill a zombie is to kill itâs brain.
Thanks! for hit boxes is probably a good idea to use a sensor for detection of bullets/hit points.
Since zombies are fictional though, the virus could have infected and embedded itself in the nervous system, making the brain redundant as this would otherwise be a weakpoint. In this case the only way to kill them would be to dismember the zombie or destroy the spine, but this is up to you and how you want to interpret a zombie virus ;).
I find the navmesh is a good starting point to keep the gameplay interesting, otherwise having 7 zombies stuck behind a wooden board isnât very fun.
I was just joking about the zombies, of course you 're right, anyone can do anything they want.
probably a good idea to use a sensor for detection of bullets/hit points.
Yeah in most cases, but, not for me. For example. My FPS uses a bow and arrow in addition to other weapons. The arrow (arrow_add) sticks in an object with the property âsoftâ and sets parent the object. So the zombie can walk with an arrow in its head. I canât get it to work as a sensor.
I use an old bullethole script written by Social, (I think) and updated by HG1 for 2.6* modified slightly by me, to add the arrow and align it at the vector it was shot from. then a script on the âarrow_addâ to parent it to the object.
I find the navmesh is a good starting point to keep the gameplay interesting, otherwise having 7 zombies stuck behind a wooden board isnât very fun.
Yeah the Navmesh is a great addition. Youâll laugh, but, I still use a track-to-closest object script and spawn nodes. Old habits die hard I guess. Iâll be doing more with a navmesh in the future.
Looking forward to your next video. And great job with Undertow, love it.
For a bow and arrow I think this is a better idea! Usually for a first person shooter (with a gun) you will use a sensor on the zombie and either make the zombie mesh static or add a static hitbox to trigger the ray (smaller than the sensor).
Then when the ray hits the hitbox, it will spawn a static âhitpointâ which will trigger the sensor.
This way you donât need any dynamic/rigid body physics, however again it usually only works for things like guns and in your case since you are using a dynamic projectile itâs probably easiest just to use a static sensor.
track-to-closest might be a bit difficult in regards to navigating around obstacles and walls, but usually if you only have 1 player itâs a bit of a waste to find the nearest object, since there is always only one object to find.
Thanks its great to see so many people making great games!