Timeline for (XNA) Possible to hide, compress, or rename .XNB files?
Current License: CC BY-SA 3.0
7 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Aug 4, 2014 at 7:32 | comment | added | Michael Hoffmann | Also, regarding one of your questions- you would not want to combine all of your resources by type as you mentioned, unless you're going to be using every single texture/sound/whatever in your game at the same time. Ideally, you want to deserialize what you need for a level or a menu or whatever, and then dispose of it as soon as you don't need it. This keeps the RAM as free as possible. You said you're new to C#- I recommend some reading on C#'s automatic garbage collection, and XNA's ContentManager, which does lots behind the scenes to keep loaded assets from being garbage-collected. | |
Aug 4, 2014 at 7:25 | comment | added | Michael Hoffmann | If you want to get really advanced, you could use the content pipeline to compile your content at run-time from hard-coded variables, and then change the name of the output file or hide it or whatever you want. Presumably, you would then use the content pipeline again later in the game to unhide/rename the files and deserialize them. This solution is very security-friendly, but it would require your players to install the content pipeline with your game instead of just the XNA runtime. | |
Aug 3, 2014 at 0:13 | comment | added | BlackAfricano | Awesome answers thanks you guys! Thanks for being so welcoming to a new member. Mainly, just the knowledge that it was possible is helpful for me but the examples are great. | |
Aug 1, 2014 at 16:14 | comment | added | Lex Webb |
To expand on the answer above, you can load textures and other resources into their XNA representation from a filestream, as you would usually load any file. You can then use Texture2D.FromStream() to simply load the files into a texture variable. This way, you can compress/hide the files any way you choose. Here's a pastebin of the contentManager i'm using for my engine. pastebin.com/0j6TAdHh
|
|
Aug 1, 2014 at 3:58 | comment | added | fastinvsqrt | If you click on the link I gave you, Microsoft has a bunch of pages on creating your own processors and at least one example project. Plus a quick Google search revealed quite a few examples posted on blogs. | |
Aug 1, 2014 at 3:41 | comment | added | BlackAfricano | Alright thank you for the answer! Would you happen to know if there is a tutorial for this process somewhere? Or will I have to figure this out on my own. Being so new, I'm not sure the second option will happen for a while! | |
Aug 1, 2014 at 3:16 | history | answered | fastinvsqrt | CC BY-SA 3.0 |