I’m creating a party-based game where each party is placed in their own room. What’s the most efficient way to handle this setup? I’ve considered the following options:
- Using separate places under the main game
- Creating multiple in-game rooms
- Showing players locally
Since it’s a card game and parties can last a while with 2–6 players, I want the method to be optimized for performance and long sessions. If you know what method would work best, or if you have a different method, please let me know the pros and cons!
its kind of hard to say without experimenting, if you truly care about performance and fluidity
but the way I’d lay it out would be in these steps
Initialisation
- Clone a template of the base room (With chairs being pre-made/placed)
- Create a way to store all the players within the room (Highly recommend folders in Workspace)
- When a new player joins add them to the Folder or wherever you store them
- Add chairs corresponding to the amount of players there are
Game-Started/In-Game
- Game puts all the players in an order (use a list/table)
- Game has an index value which increases until it reaches the max index (the max amount of people in the game)
- Game chooses a player and waits until they receive info from that player
- You don’t necessarily need to use a loop for this you could instead store a variable containing the Chosen Player via an instance
- Then you have a function that handles player’s turns which is only called from a Remote Event receiving info from the client
- Game processes the data and plays their turn
- Game sends to all clients the data
- All clients process the data and play their turn (Shows UI, plays some VFX, anything)
This is probably the best way I could think of for making a party-based game performant and efficient
However, following this lay-out will not build your entire game, that will require further experimentation from you