Physics degrading when moving objects are near player?

  1. What do you want to achieve? Keep it simple and clear!
    An efficient and capable tower defense like system where enemies follow a path.

  2. What is the issue? Include screenshots / videos if possible!
    The pathing works fine until a player approaches and the npcs / enemies start overshooting corners. (see video linked)

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Increasing the frequency of checks to see if the current destination node is reached, decreased frequency of trajectory adjustments to reduce strain on the server.

Additional info:
The current system uses defined nodes and a single server side script per enemy that has 2 loops, 1 checking to see if the next goals is reached (and advance if so), this runs very fast to prevent overshooting, the second one is slow and adjusts the trajectory every so often to prevent navigation mistakes.
I’m wondering if a single script iterating over all enemies would be better in this case.
The video linked shows footage of a test with about 500 enemies.
The navigation does not use path finding / agents / moveto, it just uses a linearvelocity that is calculated when a node is reached.

The title makes it sound as if this is caused by network ownership

I’m not very familiar with network ownership, do you have some suggested tweaks or any links to docs that could help diagnose this issue?

1 Like

Heya! If it is indeed that you could hop over to the Network ownership devhub page.
:SetNetworkOwner or something should work.

looks like roblox automatically assigns it to the players if there are more than ~270 moving enemies, would it be okay to force all enemies onto the server or would this be a bad idea
maybe the physics can be optimized so the server does not offload to the playes?

You could always not render the physics if there aren’t players by the moving objects.

Going of off this, I would set the NetworkOwnership to nil for all moving objects, making it on the server’s network.

Setting the network owner to nil does solve this issue, thanks! I will of course still be optimizing physics etc. since the server seems to start struggling at 500 enemies (which is a lot already)

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.