0

In working to make a HTML5 browser game, I can't help but consider the fact that a game like that can't be competitive or valued based on the ease of editing the code of the game through dev console.

For example like this: https://www.youtube.com/watch?v=lQaTW3vCqC0

The user changes around values of variables and then resumes the scripts causing the game to be directly effected.

I'm thinking of possible ways to avoid such manipulations:

Any insight or additional thoughts would be great.

Community
  • 1
  • 1
RenaissanceProgrammer
  • 404
  • 1
  • 11
  • 30
  • people did that years ago on NES/SNES, they even sold "game genie" which was like a bookmarklet version of a devtools hack. you need to police and validate user input server-side. same with games as order forms. – dandavis Oct 09 '14 at 22:31
  • JS uses reference-based security, so if the outside world cannot ref the private game state, only call methods to affect it, it cannot be altered in devtools. ex of an un-modifiable value: (function(a){return function(){return a}}(5)); – dandavis Oct 09 '14 at 22:33
  • @dandavis I think if you set a breakpoint on that function you can still modify the value of `a`. – Qantas 94 Heavy Oct 10 '14 at 01:57
  • 1
    possible duplicate of [What good ways are there to prevent cheating in JavaScript multiplayer games?](http://stackoverflow.com/questions/5250403/what-good-ways-are-there-to-prevent-cheating-in-javascript-multiplayer-games) – Qantas 94 Heavy Oct 10 '14 at 02:07
  • Thanks everyone! Qantas that link is very helpful, and definitely more along the lines of a solution I was looking for! – RenaissanceProgrammer Oct 10 '14 at 16:01

1 Answers1

0

Being that JavaScript is a client side language, you'll be hard pressed to provide total security from having it manipulated.