Hello everyone. Currently I am making a game that looks almost like a bullet hell (as in bullet curtain game genre, not gun shooting!). This is also my first time doing this in a multi-player game. (Look up to games like Touhou for a better following on what I said)
What I have prepared so far to make this game:
- A client-side script to create a bullet on their side to avoid lagging.
- Some bullet objects stored in ReplicatedStorage
- An object pool prepared in order to not use Instance.new(“Part”) on every bullet create.
- A script that manage position of bullets on each frame.
What I have stuck so far:
- Since these bullets do not move mostly on linear path (ex. their bullet path behavior might change either curve or aim directly at a player on a bezier curve, etc.), a simple Vector cannot be set to these bullets like a gun bullet, instead it might set Vector3 on every set frames. Therefore, I can imagine what the performance will be like when when looping 200+ bullets every frame just to update Vector3 (I might be biased about this).
- Finding strategy to set Vector3 of these bullets on all clients on their client-side but also sync with everyone and the server without delaying issue (ex. looping Vector3 from server to :FireAllClients(vec3)?)
- How to achieve hit detection in server without the need of Touched event (I think of raycast, but I have no idea about the approach). There are some threads talking about doing raycast each frame, each bullets but I can’t figure out about that to optimize performance…
I appreciate any suggestion that you guys can give. Thank you!