[Bmax] How to complicate access to game data files for players?

Started by wookie22, March 23, 2019, 10:24:20

Previous topic - Next topic

wookie22

Hello!

My game levels data are in plain text and png-s so if player look at them he will now what to do. Is there any ready solution to pack these files into some custom format not that easy accessible or I have to create that functionality myself?
Hidden Deep - 2D Action & Exploration Sci-Fi Thriller for PC/Mac/Linux
http://www.hiddendeepgame.com

Derron

The command "incbin" might be helpful.

Anothee option to avoid the most simple "hack approaches":
encode your files (simple cesar shiffre or "xor"). Instead of using LoadImage(filename) you use eg. LoadImage(filestream). Filestream is your custom "extends from TFileStream" which manipulates the read value to "de-xor" on the fly).

Bye
Ron

wookie22

Hidden Deep - 2D Action & Exploration Sci-Fi Thriller for PC/Mac/Linux
http://www.hiddendeepgame.com

Yellownakji

Quote from: wookie22 on March 23, 2019, 10:24:20
Hello!

My game levels data are in plain text and png-s so if player look at them he will now what to do. Is there any ready solution to pack these files into some custom format not that easy accessible or I have to create that functionality myself?


DON'T INCBIN everything!   Everything INCBIN'd will be loaded into RAM + loaded for use.  You're basically doubling memory.

Create a binary format.

Derron

If we talked about some few megabytes then it isn't worth the trouble of creating a binary format.
Else just write your own TFileStream extension as described above.


Bye
Ron

Yellownakji

Quote from: Derron on March 24, 2019, 06:06:58
If we talked about some few megabytes then it isn't worth the trouble of creating a binary format.
Else just write your own TFileStream extension as described above.


Bye
Ron

The standard BMX executable, with sizeable content, can consume up to 250+mb of ram.   Storing everything into a binary, which only takes 5 minutes!, is far superior and you can have 60mb or less mb of ram usage from the get-go.  EVERY optimization matters.

wookie22

I have lots of data so I made my own TStream - it works as it should :)
Hidden Deep - 2D Action & Exploration Sci-Fi Thriller for PC/Mac/Linux
http://www.hiddendeepgame.com

Derron

Quote from: Yellownakji on March 24, 2019, 16:39:12
The standard BMX executable, with sizeable content, can consume up to 250+mb of ram.   Storing everything into a binary, which only takes 5 minutes!, is far superior and you can have 60mb or less mb of ram usage from the get-go.  EVERY optimization matters.

I optimize stuff a lot while yi shouldn't yet. I just proposed different approaches and depending on the amount of data the incbin variant is a viable solution - which saves writing code for half an hour or even more. It depends on the experience/knowledge of the person asking for help.

Incbin has also the advantage to not require pregenerated sata files (btw this generation could be done in a pre.bmk file :-)).

Bye
Ron