April 25, 2019, 04:22:59 AM

Author Topic: [Bmax] How to complicate access to game data files for players?  (Read 192 times)

Offline wookie22

  • Jr. Member
  • **
  • Posts: 22
    • Hidden Deep
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

Offline Derron

  • Hero Member
  • *****
  • Posts: 1953
Re: [Bmax] How to complicate access to game data files for players?
« Reply #1 on: March 23, 2019, 10:51:43 AM »
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

Offline wookie22

  • Jr. Member
  • **
  • Posts: 22
    • Hidden Deep
Re: [Bmax] How to complicate access to game data files for players?
« Reply #2 on: March 23, 2019, 11:11:53 AM »
thanks
Hidden Deep - 2D Action & Exploration Sci-Fi Thriller for PC/Mac/Linux
http://www.hiddendeepgame.com

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 171
  • Whoop-de-doo-ba-dooo!
Re: [Bmax] How to complicate access to game data files for players?
« Reply #3 on: March 24, 2019, 04:25:16 AM »
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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 1953
Re: [Bmax] How to complicate access to game data files for players?
« Reply #4 on: March 24, 2019, 06:06:58 AM »
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

Offline Yellownakji

  • Full Member
  • ***
  • Posts: 171
  • Whoop-de-doo-ba-dooo!
Re: [Bmax] How to complicate access to game data files for players?
« Reply #5 on: March 24, 2019, 04:39:12 PM »
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.

Offline wookie22

  • Jr. Member
  • **
  • Posts: 22
    • Hidden Deep
Re: [Bmax] How to complicate access to game data files for players?
« Reply #6 on: March 24, 2019, 04:50:57 PM »
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

Offline Derron

  • Hero Member
  • *****
  • Posts: 1953
Re: [Bmax] How to complicate access to game data files for players?
« Reply #7 on: March 24, 2019, 06:14:13 PM »
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