Which sort of structure is better for my game?

2 Example Modules I'm going to reference: InventoryService - Keeps track of all player's inventories with functionality to add/remove items. HotbarService - Keeps track of all player's hotbars with functionality to add/remove/use tools.

So originally I had the full functionality of both the inventory and hotbar of a player all on the client side (ReplicatedFirst). I then thought that this might be a vulnerablity since you never want important data to sit on the client. I also thought that adding new features and additions to the game was very hard since the two most used services were on the client side. Because of this thought, I put the InventoryService and HotbarService onto the server side, modified them to hold all player's data, and called them using this structure: Client triggers action, fires remote event/function to server, server accesses service and changes data while client does UI work. It might just be me, but I think this caused a bit of a delay for the player when taking things in and out of their inventory. Would it have been better to keep all these services local on the player? Or is my current structure the better way to go? Would it be better to give the player fast and clean UI with the expense of not waiting for the server to process the data quick enough?

2 comments

0

Let the client do the stuff, but let the server check if the client is actually doing something 'possible' if not, let the server do it

0

So you're saying it's okay to store the client's inventory on itself, then when it tries to do something check with the server to validate it?