Hi, I want to publish my game. To my understanding, if I want to upload to itch, I need to upload what’s inside the bin/Windows/x86/Release folder after zipping it. My problem is that the Content folder that is present here still contains the name of every asset in the game (names of the xnb files), which I want to hide.
I tried looking into obfuscation, but I can only obfuscate assemblies, which isn’t what I’m trying to do.
Is there a way to at least hide the names of the files?
Not entirely, though compressing everything into an archive is an option, albeit maybe too much to be worth it. High-level engines typically go this route, but even they can’t fully hide assets because the game needs to know what to load. Even obscure archive formats in older games/consoles have been cracked and opened. What is your goal in hiding the files?
My two cents: instead, include a license with your game that restricts what the player can do with the game assets.
No worries Xnb is a binary format, people who will play your game, most likely will not dare to touch your game content and reverse engineer it… just to see the actual raw content ^_^Y
The issue is that there is still the name of the files, like car.xnb, which I want to hide. I guess I could juste put random names to prevent that but I would need to change every file reference in the Content load and the code would be really messy. But Iguess I will do that if there is no other way.
My goal is just to avoid the player spoiling themselves and find secrets by looking at the content of the Content folder, it’s not much of a licence issue. I don’t really see how I could use an archive.
Oh, in that case you can simply rename your assets. You can use abbreviations (Ex. “SecretLevel1” → “SC1”) or some other internal name. This would be the easiest and quickest thing to do.
I like to have constant strings defined for each asset name so if it needs to be renamed, I just change the value of that string and have it propogate to all the instances the asset is loaded. I’m not sure how large your game is, but if you want to rename the asset I’d recommend going about it this way.
The files end up added to the exe after the code so that it runs without any issues and the only hard part is getting the file streams for loading content.