Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

HTML5 code protection?

A topic by Mike4242 created May 06, 2024 Views: 371 Replies: 6
Viewing posts 1 to 6
(4 edits)

Hi folks!

If a user buys a JS / HTML5 game, then by definition they own the game, and Itch.io allows them to download the source code locally. After having done this, nothing prevents a user from viewing / editing / redistributing that same code.

In case you want to protect your HTML5 / JS code, what are some preferred, standard, Itch.io compliant ways to do so? Obfuscation? Legal disclaimer in code? Bake into OS specific executable?

Thanks in advance, have a nice one :-)

Cheers, Mike

Moderator(+1)

This is true of any game anywhere, including browser games. By definition you can't play it without loading the whole thing in the browser, and if you can do that, then you can save the files. DRM is a fool's errand for this reason. But if you insist, I think the quality guidelines for ads apply.

In case you want to protect your HTML5 / JS code, what are some preferred, standard, Itch.io compliant ways to do so?

Protect from what? Being used as intended by legitimate users? Because that is what you will get. As is what all the other DRM implementors created, when they did it to their works. DRM has been around long enough to give plenty of examples, how legit users now can no longer access their bought product. As a concept if fails on all aspects, as it does not even protect against piracy or plagiarism.

Protection against law abiding and aware of the law users is implicit. You do not need to register a copyright to have copyright. But you can spell it out, if you put your software under specific licenses, if applicable.

Protection against non law abiding people will only (!) hurt the law abiding users. If your stuff is worth anything, the criminals will just steal it anyways, no matter what you do. And they will re-release it without the precious drm. And if your stuff ain't worth stealing, be happy, if people share it, you would not have sold it to them anyways.

Also, how do you buy a html5 game? If I give you money I only have access to all the downloads, even if you set a minimum price for files later. But if you do not have any downloadable files, all this is is a non issue. The downloads you see, are people playing it in the itch app, as it caches the games and that counts as a download somehow.

You can do drm, if you need to, there are no rules on itch against it. But also no support. And from my perspective, not even AAA and AA and A companies do drm in any good or trustworthy way. There are drm systems that, if on a game, will not be bought by some people, because it is just garbage - and not because they cannot pirate the game. Search for "denuvo problems" on the net.

So what makes you think, you, a single amateur developer can implement a drm system that is any good and will do what you want it to do, without harming or bothering and hurting your legit users?

Sorry for ranting here, but there is a thread like this every other week by a developer that has not even anything to show (yet) that looks like it even needs protection. And you probably did not even want to actually implement drm, so this is not specifically meant for you, but for others searching the forum and finding this.

Wanting a little peace of mind after releasing hard work is understandable, as there is always the danger that someone just copies it and claims he made the stuff. Small indie devs face this with cheap knock offs on google play store even. And all really successfull games will sooner or later face not so cheap knock offs that actually are not knockoffs but just imitate the concept. Looking at all the five nights at freddy "inspired" games.

All that being said, it is prudent to watermark some of your assets. For example with a link to you at a place where it is hard to crop out, if you have a banner. But I advise against certain technical measures, like a login server for an offline game. Even code obfuscation might hurt you more, than you would think, as it might trigger antivirus scanners. But that is more a problem of downloadable executeables.

As an afterthought, I can snoop in your code, even without "buying" if you have such a html5 js game, since I can just inspect the game and look at the sourcecode. So maybe be careful what information you put into that code. Small devs are sometimes targets of social scam attempts.

(1 edit) (+1)

Okay, I probably was a bit unclear in my question. I am not in any way considering using DRM, such as copy protection, login walls, online activation etc. I despise it and - as you both - consider it useless.

I was asking specifically about HTML5 / JS games, since per definition, the game is the source code, because of how browsers work. This is obviously not the case for compiled code.

And as for the questions, they are simply:

Do you people prevent others from reading the code, and if yes, then how? (Obfuscate with eg webpack or JScrambler, Convert to native app, “compile” with eg. Ionic, React Native or NativeScript?) Does the itch.io platform have any best-practices or guidelines on the topic? (I can’t find any, so expect “no”)

Cheers, Mike

I doubt that the people that might do such things, read here. In the meantime, maybe just browser popular paid web games here, and try to snoop in the code. If you can't but it is the type of game were the source would be unprotected, you have seen examples how to do or if and what to do.

I suspect https://itch.io/games/top-sellers/platform-web/store the ones with the highest incentive to make the web version somehow that you cannot simply download the source code, since they want to sell the download version.

To be honest, I was not even aware, that the source code of html5 games can be read. With comments and all. (That is what I meant above, there is no need to "buy" your game. Being able to play it, is enough to have access to something that your browser uses to run the game)

Moderator

Obfuscating code is outside the scope of itch.io quality guidelines, since we don't have any requirements on licensing or code availability. And I make everything open source anyway.

This topic has been auto-archived and can no longer be posted in because there haven't been any posts in a while.