Trying to make a pvp bullet hell here
For the current example, I am firing 1 star that travels and then splits into 25 stars; 26 bullets in one shot in total
Currently this doesn’t lag on it’s own. However, when you have 8 players constantly firing this, it can get very laggy (even if each one fires only once a second) because that is 208 bullets at once, and this isn’t counting if they used other stuff as well. Although the lag isn’t severe at 208 bullets, in a normal server including everything else it would cause extreme lag that would harm gameplay experience.
My current system uses a module script that transforms inputted server data into a table, which is then fired to a client script that takes the info to render the bullet visuals. Because it is a PvP game, i made the server make invisible, real bullets and have the clients simply make a version with all the visuals (particles, trails, meshes) and just weld it to the moving server bullet, while the server does the actual moving, as the projectiles vary greatly in trajectory and it would be impossible for the server to do sanity checks that are effective against exploiters if the server doesn’t have the bullets themselves (hence why this isn’t fully client based).
I am wondering how I should make it less laggy, such as if it is possible to do it fully client-sided and have it not extremely vulnerable to exploiters, or if there is some method i should implement, or if I should change how i am moving the bullets/creating them.
Sidenote: this might also have PvE aspects, so it would be appreciated if the solution could also allow PvE (because in a full client sided system, this is very hard to do)
EDIT: Object Pooling has shown some success, but wondering if there’s other things I can do