I appear to be the local experienced custom streaming guy. Let’s talk some more about custom streaming!
Reinventing the Wheel
This is one of the major problems with trying to use local parts to optimize things. Basically, you have this predicament where…
- You use local parts for everything, so enemies spawned locally cannot be seen by other clients, BUT
- Enemies should be able to be seen by other clients, as well as whatever state they have, AND
- Enemies should be simulated on the server to prevent exploiting or other client cheating.
In order to achieve all of the above, you are likely going to have to spin your own custom method of representing your streamed planets in the memory of the server, but without using instances. This means you have the rather colossal task of reinventing the wheel, or in other words, rebuilding some of the functionality we normally take for granted when using instances, like…
- State replication on changes.
- Collisions, pathfinding, raycasting, and other features that depend on geometry.
- Physics, including mass and forces
- Anything else you might need that you don’t get.
Now, this is by no means impossible, nor do you have to implement every single thing I stated above. It will, no matter how much you need to rebuild, be a lot of work.
Why a custom streaming solution generally doesn’t provide a tangible performance benefit
Custom streaming will only get you a performance benefit compared to just using Roblox instances in very specific circumstances where…
- Your world is really, really big, and would otherwise have to be represented with many millions of parts.
- You have gameplay that is simple enough to translate into raw lua data structures, and your programming ability allows you to highly optimize these routines.
- You are using clientside parts to alleviate physics load on the server while keeping the game server authoritative.
Please see my other custom streaming post for additional reading on why pulling your own custom streaming is generally not a good idea.
The Moral of the Story
A wise computer science professor once said to me,
Premature optimization is the root of all evil.
While this might be a bit dramatic, I find it often ends up true in most cases. Unless you’re building something that has an incredible performance requirement, its best to avoid thinking too hard about optimization until features are created. You can always optimize clean code, but you can’t always extend optimized code easily.
Edit: experience → experienced