My first massive smart mob

First and foremost I have to thank a few people for making this all possible:
@ninjasheep for keeping me motivated on roblox and to never give up.
@Weeve for being kind enough to teach me how to script through explaining his/her code in full detail over the past 2-3 years.
@ScriptOn for sharing his method for making zombies.
@VolcanoINC for creating this plugin that I use for finding and creating paths for my pathfinding.


I’ve always been fascinated by Left 4 Dead 2 and its zombies intelligence so much so that I’ve been obsessed with wanting to learn about AIs and create my own, I can’t necessary say this creation is like Left 4 Dead’s AI manager (because this uses nodes, and not navigation mesh) but its still one of the best zombie logics on roblox that I know of. Unlike typical mobs on roblox that will follow you or a path in such a way that it looks robotic, my zombies are a bit more random as they will bump into each other then move around each other and start swarming players making it hard for you to get out of the swarm. They also have the ability to climb but not just Trusses and ladders but walls and buildings. After a weeks worth of work, I finally created a zombie intelligence that I am very proud of.

If you want to check the place out: Some zombie game in the works idk - Roblox

Also, you’re probably wondering what the colors on the bricks mean.
Green means the zombie is either moving normally (in a straight line) towards a player or a node.
Red means the zombie has detected another zombie and is attempting to walk away. (But if the zombie isn’t moving, red means its stuck)
Orange means the zombie has detected another zombie and is moving away from another zombie.

6 Likes

Looks neat. You still need to work on the tweening to smooth out server latency and add proper characters, but functionally it’s good.

PS: when the AI runs into a friendly, make it turn and walk just a bit. Currently they go out like 10 studs. Try setting it to 2.

2 Likes

Couple things:

  • Sometimes the zombies will spaz a bit and get stuck at about 10 studs away from the character.
  • Jump onto the shack. The zombies seem to be able to walk through the shack walls.
  • If you jump onto a zombie they can’t damage you.
    Other than that, this is great! :slight_smile:
1 Like

These are so cool, I love how some just wander around like actual zombies. Another thing that I thought was really neat was how some only chase you if they see you.

1 Like

Awesome job! I fell over and got swarmed so fast I died before getting up haha.
Nicely done :slightly_smiling:

1 Like

That’s great, well done!

I went and stood an the corner of the baseplate, and just held spacebar in so they would fall off the sides. Then I noticed that they respawned. qq

1 Like

You can get them stuck in the basement for about 3 minutes before they figure out there’s 2 exits.

What was your process for making the AI in Demented Defense go around each other? I’ve been reading all your posts about your AI system and it’s pretty genius; the turning part is the one part I don’t understand though.

Assign them to go left or right.

When they run into a friendly make them turn to that direction by 8* then move them forward half a stud or so. The next frame they’ll try running back into a friendly but they’ll yet again be moved just slightly over to the side. Eventually they don’t run into another friendly and now they’ve begun forming a circle.

So they make an attempt to go to their target, but if somethings blocking the way, they ‘forget’ their target for that frame, rotate, and try to move forward?

Yeah. That’s the beauty of anchored humanoids. You can easily rotate/CFrame them without it looking choppy or unrealistic (since the client tweens any changes).

Yeah the networking is really smart and actually quite simple, but I’m stupid and I’m having trouble making the AI go around other AI.

Don’t worry, what I’m making has nothing to do with zombies, ‘defense’, or anything similar.

Good luck, curious to see what you make.

1 Like

If you need any help, feel free to ask.


All local.

1 Like