Should I make a minigame local or on the server?

Hi, I’m relatively new to coding in roblox, and completely new to the dev forum, so I apologise in advance if I posted this in the wrong subforum!

So I’m trying to make a cooking minigame in which you take the order from a customer (that is generated by the game) and you have to prepare the food. I’m not sure wether I should generate the order on the server, send it to the client, let the client handle the minigame animations and interactions etc, send the completed order to the server and have it check if it’s correct, or just have everything handled by the server.

The main things I’m worrying about are performance and exploiters, would handling all this on the server cause lag? Or would handling the minigame on the client cause a breach that exploiters could use to automatically send the complete orders to the server?

Which approach is better? Is there anything more efficient that I should do instead? Thanks in advance and I’m sorry if what I’m trying to say isn’t clear! :smile:

3 Likes

I’d make it on server if it’s something like a whole bunch of mini games something how @TypicalType type does it less like @Smellysuperfart’s Where’s the Baby. Also exploiters will be able to get though just as easily without an anti exploit script. Also I believe this should be under design support. Just ask the Top Contributors they know best.

1 Like

Hi! Welcome to the Developer Forum! :smiley:

Okay, so in your post you’ve given two options to consider. Let’s look at the pros and cons of both!

Everything on the server:

  • Client can’t easily manipulate the game to reward themselves (not easy to exploit)
  • Less confusing as you don’t have to worry about sending data between the client and server
  • Could put more stress on the server, and this could cause negative effects depending on how much the server is doing.

Client handles game, reports back to server

  • Less work for the server to do
  • Can add more effects on a single player’s screen
  • Involves logic behind controlling both server and client
  • Could be easily exploitable

Right. These sound like great options but they both have negatives, which we don’t want.

I think the best option here is a variant of the second option - let the server handle when each order is made and finishes, and let the client handle everything like animations. The most important thing here is to keep your mind thinking about how you structure your code. You want to minimize the amount of vulnerabilities that a theoretical exploiter could take advantage of.

I would generate orders on the server, send the necessary information to the client, have the client send a message to the server to say it’s done and then have the server validate this to check for exploiters. For example, the server could check if a certain amount of time has passed and determine if the client performed the minigame too fast. If they have, they have exploited.

If the player has to pick different ingredients then consider letting the server know everytime the client picks up a new ingredient so it can keep a track of the food each player has. If the client tells the server it has finished making a hamburger, but the player hasn’t picked up the burger or the bun (or the… ham? :laughing:) then they are exploiting.

To conclude, letting the client handle some of the work isn’t a horrible idea and can lesson the work done by the server. But, you should also double check everything the client tells the server (Dont trust anything the client says!). You could check a certain amount of time has passed or the player has the right ingredients to proceed.

Hope you find a good solution, good luck!

4 Likes

Thank you! Your answer will help a lot in developing my game. :smile: