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: Is this why NPCs lag:

Previous Thread :: Next Thread 
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
22 Mar 2017 09:41 PM
Because the same mechanics are being produced as to shoot a projectile out of a gun, in which the bullet is rendered on the server and SetNetworkOwner has never been called. This makes the bullet lag when it gets near another player.


I assume, this applies to the lag the NPC's get. They do lag when other players are in the game. I forget how much lag is produced when it's only 1 player in the game.

Because when an NPC moves close to two players, you'll see a bit of lag there.


So, a possible solution, would be to call SetNetworkOwner on all of the parts in the NPC. Am I right?



But here's the big question. How do I know which player to set it to? The player it's currently tracking? And I would update the network owner depending on it?


Or would this even fix the problem. Please let me know some advice here. Thank you for reading! I probably rambled on a little bit too much haha, sort of like I'm doing right now gg.
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
22 Mar 2017 10:00 PM
Bumpy
Report Abuse
Thedagz is not online. Thedagz
Joined: 10 Mar 2012
Total Posts: 798
22 Mar 2017 10:02 PM
No Offense

But I don't think you actually know what your doing

Its true that roblox can't run NPC's that well but bullets and NPC's don't normally lag assuming your coding them property and not doing any hardcore simulations with them.

Can you go into more detail on how your bullets or NPC's work?
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
22 Mar 2017 10:04 PM
I think I'm onto something though. Would using SetNetworkOwner on the NPC's smoothen them out a bit? I can see it working nicely if used properly.


Thanks for reply.
Report Abuse
Thedagz is not online. Thedagz
Joined: 10 Mar 2012
Total Posts: 798
22 Mar 2017 10:05 PM
I don't believe so

Is your bullets moved by CFrame? while using RunService?

That will def. smooth your bullets
Report Abuse
opplo is online. opplo
Joined: 09 Dec 2008
Total Posts: 5320
22 Mar 2017 10:06 PM
What's the NPC doing?
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
22 Mar 2017 10:33 PM
A single npc has no effect. If I have 20, there will be a bit of lag. That's why I'm making 20 the max amount


Isn't there some way to smoothen them out a little?
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
22 Mar 2017 10:56 PM
No Offense

But I don't think you actually know what your doing [2]


R$83,236 and climbing.
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
23 Mar 2017 11:08 AM
I don't think you know what you guys are talking about tbh.


If there are alot of NPC's clustered on a map at one time, there will be lag. Lag caused by roblox automatically.


I figured maybe using network ownership would smoothen their bodyparts as they move.


You guys aren't giving good details..


but thanks for the replies.
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
23 Mar 2017 11:16 AM
Yep. My theory was proven to be legit. When the NPC's go towards another player, I notice some lag when they do that on my client. Network Ownership could solve this maybe?
Report Abuse
Isosta is not online. Isosta
Joined: 10 May 2015
Total Posts: 14729
23 Mar 2017 01:00 PM
I know exactly what I'm doing. Network ownership has nothing to do with it. physics is still calculated on both ends, network ownership just has to do with who can actually modify it via script. ur bad.


R$82,419 and climbing.
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
23 Mar 2017 02:37 PM
Rude
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
23 Mar 2017 02:49 PM
But I don't think you actually know what your doing [2]

He does, but the issue isn't that... re-code for efficiency... as that's what I did. You also want to either do it really nicely in a module or do it in a script inside the AI unit as this allows it to update to replication faster making it smoother so a zombie doesn't lag behind or anything like that...
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
23 Mar 2017 03:36 PM
I suppose that makes sense Lua. Thank you for the reply. I will, most likely start remaking the AI's when ever I can. And I also assume pathfinding service causes a spike in performance as well.
Report Abuse
Lua_Basics is not online. Lua_Basics
Joined: 04 Jun 2012
Total Posts: 9977
23 Mar 2017 04:17 PM
It does, but you have to use it conservatively.
Report Abuse
C_Sharper is online. C_Sharper
Joined: 03 Oct 2011
Total Posts: 6405
23 Mar 2017 05:42 PM
I might just use a simple approach, using MoveTo, so I don't have to spend extra memory on calculating paths, which aren't even that good tbh..


Thanks for the info.
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