Zombie game lagging

Uncopylocked zombie game.

I still havent’ gotten very far, since I keep running into limitations. The inside of the houses was too many parts for acceptable mobile performance, so I needed to make a door script that will hide the inside in ServerStorage and put it back in place when the door is opened.

And now, with the current limit of 40 zombies, I am getting about 400ms ping time when the zombies are around.

I tried parallel luau, but that seemed to make it no better, so I removed it again.

I removed the ragdoll effect when a zombie dies, since it was badly lagging.

I also made most of the state control do work only on every 30th heartbeat.

I am not sure what to try and optimize next. The models are R15 and I would like to keep it that way.

I am not really sure if this is playable yet. Any feedback about laggy-ness or optimization ideas are welcome. :slight_smile:

Hi. I played your experience and did not see any excessive lag. I have a PC and a good internet connection. Client memory slowly climbs to between 1072 MB and 1082 MB. I did see about 32 “Infinite yield possible” warnings on workspace.Zombies.Zombie:WaitForChild(“Head”). Otherwise seems OK.

I let myself be killed. Memory jumped to 1279 MB. Think this is because of building I entered. More buildings more memory used.

Hope this helps.

Just wanted to add that this is an nice looking build. Don’t know what you made but nice buildings and vehicles.


Thanks a lot for the feedback. :+1: Alle the models are roblox, since I am just myself and cannot do models. Even if I could, I wouldn’t be able to find the time.

The buildings are from the template in roblox studio that is called Suburban. The vehicles and shotgun are also by roblox, and can be found in the toolbox. The zombie is a modified roblox NPC. The trees are from a roblox asset pack, might be from Duvall drive - I don’t remember exactly.

The city, terrain and forest are procedurally generated by scripts.

The only original content (apart from scripts) is the zombie punches which are animations that I made by importing videos of myself. :smiley:

It’s all uncopylocked. The code is not a thing of beauty, though.

My new theory is that the animations are causing the performance problem. Maybe I will record myself walking as a zombie and see if the recent “curve animation” improves performance. Whatever a curve animation might be.

I had a fun time in there with some unintended funnies. Jumped onj the van at the garage and the zombies then started to push it around. Ended up close to a house so jumped up there for safety.

The gun sounds are “poppy” and gutless. The hit registration feels very slow and laggy some reason and the weapon itself feels woefully under powered. Not much would survive a shotgun blast at short range and yet it only seems to do 50% damage max. At longer ranges it is completely ineffective.

It would be good to have other weapons to discover around the map.

1 Like

Hello. I played your Zombie game, really cool dude! Also, I did not experience any lag in my laptop. I tested your game, let those Zombies kill me and still not lagged. If you experience lag, then you should add an anti lag script. Keep it up, dude! :cool:

1 Like

Thanks a lot for the feedback @BadDad2004 and @Katastro5 :slight_smile:

There should be more weapons, not just the shotgun that is in the policecar. I think I found a better shotgun sound and added a little more power.

Sorry, I didn’t even give any advice on how to check for the lag. There are a few simple things you can check. Start the game and monitor the following as time progresses:

  1. Press Ctrl + F7 and watch Memory, CPU, Recv & Ping stats
    If any of these start to increase slowly over time, then they by definition hint at what the problem is
  2. Press F9 and select Memory from the drop down. Monitor both Client and Server memory over a period of time as above. Does it change considerably over time.
  3. Still using F9, select Scripts from the drop down. The Rate (/s) will show you how busy each script is. Not all will be shown, but it will give you a good idea as to which is busiest and indicate where you might have a problem.

It might help you find a problematic script or point you in a general direction.

Thanks. :slight_smile: It seems to be ok-ish now, I am getting <100 ms ping mostly. I guess I will try to leave it as-is for now and start putting some more items in the game, like more weapons and zombies lurking inside the houses.

I really need more city models, too, I was thinking one city would be a smal suburb and the other would have some office buildings.

Maybe a rouge-like procedural generated zombie shooter was a bit too much to take on for just one person. :open_mouth: