generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Would walking NPCs lag?

Previous Thread :: Next Thread 
rudolph101 is not online. rudolph101
Joined: 15 Jan 2009
Total Posts: 11873
11 Aug 2016 06:22 AM
I'd love to add NPCs walking around my game, I'm just wondering how much lag this would cause? How many do you think I could realistically add considering I'm planning on building a big fairly detailed city for the game too.
Report Abuse
Evolution_Theory is not online. Evolution_Theory
Joined: 03 Feb 2012
Total Posts: 1770
11 Aug 2016 07:14 AM
No, even an infinite amount of NPC's wouldn't lag if you knew how to do it.


Report Abuse
rudolph101 is not online. rudolph101
Joined: 15 Jan 2009
Total Posts: 11873
11 Aug 2016 09:54 AM
Thank you! I'll certainly try and do it efficiently then. You sure now?
Report Abuse
Dodeca is not online. Dodeca
Joined: 11 Sep 2011
Total Posts: 13649
11 Aug 2016 10:16 AM
Depends on the person's computer
My experience with NPCs is that they don't really lag when theres a lot of them, but they're really slow.
Go play Retail Tycoon, you'll notice that when its a full server with big stores that the NPCs will move slowly.
Report Abuse
mew903 is not online. mew903
Joined: 03 Aug 2008
Total Posts: 22071
11 Aug 2016 10:17 AM
Last time I tried, the animations lagged but they moved at the desired walkspeed. I had about 100 going, though
Report Abuse
rudolph101 is not online. rudolph101
Joined: 15 Jan 2009
Total Posts: 11873
11 Aug 2016 04:15 PM
Hmm, okay thank you very much guys! You've been very helpful!
Report Abuse
67high is not online. 67high
Joined: 07 Jan 2009
Total Posts: 542
11 Aug 2016 04:20 PM
Yeah at retail tycoon when there's a lot of NPCs on full server with large stores I notice there will be lag spikes where the NPCs keep walking straight without turning and their animations slow down.


Report Abuse
Evolution_Theory is not online. Evolution_Theory
Joined: 03 Feb 2012
Total Posts: 1770
12 Aug 2016 01:55 AM
As I said before it's possible to have an infinite amount of NPC's without any lag. All you have to do is just create NPC's in a close proximity to the player instead of having them all over the map. This is how games like GTA do it and it is the best option so far.


Report Abuse
mew903 is not online. mew903
Joined: 03 Aug 2008
Total Posts: 22071
12 Aug 2016 03:28 PM
^ this

An efficient way would be to create NPCs and put them into the hacky local workspace (workspace.CurrentCamera) and only create them within a certain range
Report Abuse
Soybeen is not online. Soybeen
Joined: 17 Feb 2010
Total Posts: 21462
12 Aug 2016 03:47 PM
"even an infinite amount of NPC's wouldn't lag if you knew how to do it."
This is pretty misleading.

The short answer to OP's question is yes, a walking NPC will put a certain strain on processing, but so will literally_every_other_component_of_your_game, such as other moving parts, projectiles, animations, all that stuff. The question is not "does it create lag", it's "how can I minimize the lag caused by doing it."

If you control all of your NPCs movements from one designated script, and code (a reasonable number of NPCs) with efficiency in mind, the effect of a couple dozen walking NPCs should be negligible. You can, likewise, proceedurally generate the NPCs as mentioned above.


Report Abuse
jody7777 is not online. jody7777
Joined: 22 Feb 2009
Total Posts: 1343
12 Aug 2016 03:56 PM
well you could always distribute the pathfinding calculations onto the clients pc's :l


FOR THE CAUSE
Report Abuse
rudolph101 is not online. rudolph101
Joined: 15 Jan 2009
Total Posts: 11873
14 Aug 2016 05:45 AM
Thank you guys! You've been a great help.
Report Abuse
GloomDrone is not online. GloomDrone
Joined: 09 Aug 2015
Total Posts: 679
14 Aug 2016 06:02 AM
yes, actually, it will FPS lag if you are near alot


Report Abuse
Protoduction is not online. Protoduction
Joined: 27 Jul 2012
Total Posts: 1054
14 Aug 2016 06:14 AM
FPS drop is simple from high number of parts being rendered. The fact they are NPC's doesn't change anything

Since NPC's are almost always visual, do create and animate them on each client, based on an array of positions + states on the server. This way you don't create unnecessary ping/connection issues


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image