I’m currently developing a big, RPG-ish, game with lots of weapons, enemies, scripts, events, etc. The problem is I’m afraid to make this game great bc of performance for other players. I’m planning on making this game big with big boss fights, etc, but I’m afraid of the outcome being too hard on performance for players. I know one way is teleport players to other games but I don’t know how to keep the players weapons throughout other games. Any suggestions?
The most apparent way to me would be to handle all graphical effects (that you are sure have only a visual effect) on the client(s).
Sorry I can’t add anything else, I’ve been away for a good bit of time.
Like @aaltUser said, handle the graphical effect on the client. Plus, make all of the effects can be toggled on or off. Players can decide what is best for their gameplay manually.
Make sure to group together parts (not sure if you already did this.)
Optimize the game itself well is the best way of doing this.
Organize your code in good way and make sure all buildings in your game does not have unneccesary things in them. Like if you don’t want a part to have .Touched event then disable the CanTouch property.
Also you can use Datastore to transfer the player’s data over to another place so they can keep the weapons they’re currently using. As long as they are within same universal place.
If you don’t know how to use Datastore then I suggest you look up for it and spend time to learn.
Usually lags come from processes scripts go through, sometimes memory leaks and heavy operations like like moving an object with thousands of parts, you need to know how to optimize code and prevent memory leaks that can use unnecessary resources. Disconnect unused connections, render something only when player is close, replicate things to other clients instead of to the server.
Try avoiding effects related stuff on the server, not only it will be laggy because of latency, the server will have to calculate the physics for them and replicate it. Instead just do it on the client. Only do server stuff for like damages, position updating etc.
For example tweens, if you’re doing tons of tweens on the server, it can take up some resources, so you just have to do it on the client, let the client do the rendering.
For very large maps, you can either use StreamingEnabled, or have multiple places for each section/area of your game. (And, if your places are still huge after you split it up into multiple places, you can use StreamingEnabled on top of that.) If you aren’t familiar with StreamingEnabled, it only loads in parts of the map that are close to the player to make it have a better performance. (I have heard mixed reviews about it, so read through the page on StreamingEnabled.)
Either way, you’ll likely need to use a DataStore to keep a record of the player’s tools, so multiple places likely won’t be an issue. I’ve used DataStore2 before and it has worked very well for me. (Roblox’s new MemoryStore is for temporary data, if that’s what you’re looking for.) DataStore and MemoryStore both work across multiple places/servers, with the primary difference being that DataStore offers permanent storage and MemoryStore offers temporary storage.
In terms of scripting, one tip I can give is to try to replace any infinite loops you can with events instead. This not only makes your game much better in terms of performance, but it will help your code be much cleaner.
Hope this helps!