Moving massive amount of objects without too much lag

was running a few simulations of a bullet hell game-esque system (a test with about 150 bullets). my current system leaves all visuals client side, so the server only has to move invisible bricks around. however, it seems that it is still very laggy, and it may be caused by the sheer number of moving parts. however, a bullet hell by nature would probably have a huge amount of bullets, so i am wondering how else i could make it significantly less laggy (besides reducing bullet number)

The only thing I can think of is to optimize your bullet code so that you aren’t moving any parts on the server at all… and the client only renders a bullet if it’s actually visible and possibly even within a distance of say 100 studs

would it be more effecient for the server to create a bunch of variables and then just make the server update the variable objects and have all the clients move the objects whenever the variables update according to the variable’s data?

I can’t say I’ve ever tried that, but when I created an fps game I had the server and client do separate raycasting, where the server’s was purely for determining if something got hit, and the client’s was purely for determining how far the bullet could move, which also connects to the idea of before you move the bullet, you would check if the new location is on the client’s screen

seems like the first method and the second method (server moves nothing, server just edits data) are both laggier than having the server do the work, which i find very strange??? i don’t know why,

i’m also thinking that .touched event isn’t very effecient, however region3 is also extremely taxing so i don’t know how to go about making a lightweight hit detection system

no i don’t have a custom physics script for the bullets

Use raycasting, are you not already using it?

not exactly sure how i would use raycasting, would i send a raycast in the direction the part faces or?

Edit: was able to move around 400 objects without much lag (used raycasting for hit detection), thanks for telling me to do that

Glad to help :slight_smile:

Let me know if you need anything else.

how exactly would i go about making it work for large projectiles, though?