|
| 30 Apr 2014 02:28 PM |
Hey guys, does anyone here know how many npcs, (zombies) in this case that the game engine can handle added 20 players max before it begins to lag? My game is on halt at the moment due to this question. I dont want to build a game around something that wont work.
Thanks. |
|
|
| Report Abuse |
|
|
teslobo
|
  |
| Joined: 27 Mar 2010 |
| Total Posts: 18828 |
|
|
| 30 Apr 2014 02:38 PM |
It depends on all aspects such as the amount of parts in the game, the intelligence of the AI etc. Assuming we're talking about your everyday zombie that walks towards a person getting near enough, I'll put it into perspective: In 2010, there was a game that had 400 zombies in the map at any given time plus 8 players without any lag. Since then the engine has grown far more powerful to the point you could probably host a number of zombies in the range of thousands- maybe tens of thousands if you provide enough space between zombies. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 02:51 PM |
| Hmmm interesting. thanks for the info. If I have to downsize my game I probably will. |
|
|
| Report Abuse |
|
|
morash
|
  |
| Joined: 22 May 2010 |
| Total Posts: 5834 |
|
|
| 30 Apr 2014 04:08 PM |
| If your a new developer developing a starting game, you should do probably no more than 40 spawning zombies. If your an experienced developer developing a more advanced zombie survival game, then don't worry about having to much zombies since they will either destroy all players or the target. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 05:03 PM |
| Also, if you're having trouble with lag, think about enabling Streaming and spread your game out more. With Streaming enabled, the game generates a certain radius around each player like Minecraft does, so spreading out actually reduces lag. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 05:03 PM |
| Loads a certain radius, not generate, sorry. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 08:08 PM |
| That sounds useful. How do you enable streaming? |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 08:18 PM |
| Thanks for the replies guys. I was also about to ask about Streaming. I was unsure how it was used but this seems to make more sense. And yes I am new to developing. Some things I will openly admit, I do use free models, I dont know how to script and I am having trouble getting vehicles and weapons to work properly..... *sigh* |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 08:20 PM |
| Vehicles are easy. Wheels are made by Cylinders with a hinge on one end, then you need to insert a Vehicle seat. After you have that, create another part which is going to serve as the chassis of the vehicle, the Vehicle seat and wheels have to be on the same part, after you've got the scale and stuff right, you can add all your wheels and the vehicle seat on it, then add whatever else you'd like. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 08:24 PM |
| well, some free models that is. all the buildings I will be making myself. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 08:33 PM |
| Wow, you joined in 08. Did you not get into or something since then? Anyway, I think you missed one of my replies when you posted your reply. Up there. ^ |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 08:52 PM |
| Ive been very busy for the last few years, not really having much time to play sadly. also I always rush myself, end up losing patience early. This time im going to try to stick to the game. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 09:20 PM |
| If you want to have allot of zombies i recommend removing the cleanup/part removal script from the zombies themselves and have one firing off in workspace that counts zombies in workspace spawns them automatically when the count lowers then every 1-2 seconds removes all zombies under 1 hp that way it illiminates lets say 40 lines of code per zombie 40 zombies in the game, 1600ish lines of code running at once, Instead it can be replaced with just about 50-70 lines of code, I can help you out if need be i currently have a script made that does it in my zombie CTF game |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 10:59 PM |
| Thanks for the information! Help on that would be great. I dont think I will add zombies until the buildings are more complete so i can judge where to put my npcs. Add me? I could use some insight on development |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 11:04 PM |
| I have set it so everyone can enter it. Its very unfinished, full of free models and needs some TLC but its a work in progress. The buildings are all going to be made by me. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 11:28 PM |
| Could always collab with another player on a place, also keep in mind to constantly save, it sucks to lose work. |
|
|
| Report Abuse |
|
|
|
| 30 Apr 2014 11:47 PM |
| yea I save often. Ive lost quite a lot in the past (including hard drive crashing) |
|
|
| Report Abuse |
|
|
| |
|
|
| 01 May 2014 09:23 AM |
| That depends on how good your CPU is, as AI is processed by the CPU. Primarily what causes performance issues with many NPCs on-screen is AI, so to have many rendered and being processed at the same time, you need to really dumb down the AI so it can work on the average players CPU. |
|
|
| Report Abuse |
|
|
|
| 01 May 2014 12:04 PM |
| my cpu can handle a lot. Fx6350 AMD 6 core 3.4ghz.. also running 8gb of ram. it can handle pretty much anything thrown its way. I just need to know the best way to utilize the functions of the studio to maximize my potential. |
|
|
| Report Abuse |
|
|
|
| 01 May 2014 02:32 PM |
AI is not processed by the CPU. All scripts are processed in the server and all local scripts by the player. Also speaking about zombies, if you want non-laggy zombies then you should make your own AI script or at least edit an existing one for maximum efficiency. Many of the current zombie scripts are horribly laggy in comparison to others. Another huge factor that contributes to lag is part physics. The less moving parts you have, the less the physics engine has to handle. When you can anchor blocks do it.
@HILLBILLYY's post, the number of lines in a script generally doesn't affect it's performance. It's what the script does that makes it either laggy or not laggy.
@teslobo's post, 400 zombies with the regular zombie script is absurd. The creator must have used a few techniques in order to bring down the lag. tens of thousands of zombies is unthinkable. If you had a map that consisted of a baseplate and 1000 zombies you would probably crash. 1 zombie = 6 parts. 1000 zombies = 6000 parts. 6000 parts being handles by the physics engine at the exact same time? 10000 is likely impossible currently. |
|
|
| Report Abuse |
|
|
|
| 02 May 2014 12:04 AM |
| Im probably going to adjust the amount of zombies as I continue to develop the map. Right now I plan on having roughly 20 to 30 zombies spread out evenly on a massive map. They wont be close together so it should help with lag issues. |
|
|
| Report Abuse |
|
|
|
| 02 May 2014 08:51 AM |
20-30 zombies won't cause any sort of performance issue at all. I benchmarked my modest PC and I found that I could load around 100 NPCs with AI before the frame rate dropped below 60 FPS.
It really just depends on how well the AI is scripted. I'm sure if those were 100 poorly scripted NPCs my computer would be crying for mercy. |
|
|
| Report Abuse |
|
|
powertool
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 3771 |
|
|
| 02 May 2014 12:35 PM |
Remember that ImplicitNgine is quite a rudimentary physics engine. This makes it a very powerful engine when it comes to simulating up to thousands of parts simultaneously. However, it won't do tens of thousands and DEFINITELY not hundreds of thousands. Anchored parts are mostly ignored for physics, they only allow things to collide with them.
However, scripting is quite the issue. Just be efficient when scripting, see if there's an easier/more efficient way to do what you're doing, especially with loops.
While true do wait() stuff wait() stuff wait() stuff et cetera et cetera et cetera isn't only painful to debug, it's hard to read through and hard to compile.
While wait() do for i=1,something do stuff wait() end end is a lot more efficient, and a lot easier to read.
So the idea is just to be efficient and follow good coding practices.
|
|
|
| Report Abuse |
|
|
|
| 02 May 2014 08:46 PM |
| Yes but the number of lines in the script running wait(1) do so every second every zombie is checking itself to see if its dead, That makes lag. But if you have 1 script look threw workspace every few seconds it saves alot of lag and less processing |
|
|
| Report Abuse |
|
|