Prevent exploits on single player rhythm minigame

I’m trying to find clean, efficient ways to prevent exploiting being done on my rhythm minigame.

My idea for the time being is

  1. If you quit / leav, you get no money / no reward
  2. If you make it the end of the song, I then check on the server to see if enough time has passed (time from when you started - time from the song finished, and check based on the songs length)

However problems can still arise, such as exploiters could still fire the remote event every 2 minutes (or however long a song is) and they could also insert an unreasonably high score. I’m unsure how I could corrolate the highest possible score someone could get, as that amount of notes per song is random, based on song length and the songs PlaybackLoudness.

Code that generates the notes. The notes are generated as the track plays, and thus I can’t predetermine the amount of notes, and thus max score until the song has finished :grimacing: and this is done on the client too :grimacing: so exploiters could just send a high “max score” through the remote event (if I wanted to pass the highest possible score from client-server)

local PlaybackLoudness = DiscoDancerSounds.Beats.PlaybackLoudness

local Ranges = {
	Blue = NumberRange.new(140, 184),
	Red = NumberRange.new(185, 249),
	Green = NumberRange.new(250, 304),
	Yellow = NumberRange.new(305, 340),
	Other = NumberRange.new(341, 9999999)
}

for color, property in pairs(Ranges) do
	if PlaybackLoudness >= property.Min and PlaybackLoudness <= property.Max then
		print("CREATE NOTE")
	end
end

I’m not sure if it’s possible to prevent exploiting in a singleplayer client-based game like this. Personally, I would just screw the anti-exploit and not put any leaderboard or such; just keeping the game fully singleplayer. You could try to add a bit of serverside real-time checks but this would make game unplayable for users with higher ping.

I guess you should verify the player when once the player hits #100 leaderboard or something, by YouTube or Discord or whatever so. Then, you should show them as qualified player, and whitelist them.

I’m more worried about them getting infinite cash. Based on their score they get cash, however they could rig their score to get massive cash

What benefits does cash give? Do they get position on leaderboard or anything that would affect other players?

Doesnt affect other players. But I dont want players to just easily get inifnite cash tho.

Well there’s not much you can do. Just ignore the exploiters, at this point they’re just runing their own experience.

as in exploit, a macro or a cheater? it varies greatly depending on what you are trying to patch

Personally, I would screw the anti cheat system since It’s a singleplayer game. It doesn’t harm other players and they won’t probably gain anything from it.

But you can make it so when they press a key, it fires an event or something, to verify if the button or part exists.

1 Like