Recent

Author Topic: storing assets for releasing a game demo  (Read 416 times)

DrakkTheSeafarer

  • New Member
  • *
  • Posts: 13
storing assets for releasing a game demo
« on: June 05, 2026, 04:35:05 pm »
Hello,

for my game i am using Pixelorama to create sprites. Sprites are then converted with TexturePacker to a texture atlas (a png file) + an xml is generated file that stores all the sprite settings.

what is the best way to store these assets - when i want to release a game demo? i am developing for Win11 and using SDL3.
SDL3 has a lot of inbuild file system functionality using PSDL_IOStreams. One idea is to create one large file from all assets and to load/unpack/uncrypt all needed assets at app startup (maybe not the best strategy). i lately discovered this great tool https://raylibtech.itch.io/rrespacker. Would it be possible to create something similar with Pascal?

Greetings

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12955
  • FPC developer.
Re: storing assets for releasing a game demo
« Reply #1 on: June 05, 2026, 06:22:27 pm »
I think so. Just need to do the hard work.

Handoko

  • Hero Member
  • *****
  • Posts: 5558
  • My goal: build my own game engine using Lazarus
Re: storing assets for releasing a game demo
« Reply #2 on: June 05, 2026, 06:44:49 pm »
@DrakkTheSeafarer

Yes, Lazarus/FPC is a very powerful software development tool.

I have a set of prove of concept tools written in Lazarus to be used in my game engine for storing any data: audio, image, whatever in a single file and merge it into the executable binary, so I just need to distribute my game in a single file.

In the past I studied dbf file header and roughly understood it then later I managed to write my own file storage module. I wouldn't call it a database system but basically it works like a database but I haven't added the indexing feature so it runs very slow.

I was interested how virus work, learned a bit Assembly language and I'm proficient working with pointer data type.

With these knowledge, I finally wrote the tools. Tested on both Linux and Windows 7, working correctly as I want. I haven't tested on Win10, it may not work because Windows Defender/Security may consider the binary as virus.

The data part is stored as the tail of the executable binary. And when my programs start, it will automatically scan itself to find a certain string in itself which mark as the start of the data.

In Lazarus/FPC/Pascal, the only limitation is your knowledge.

flowCRANE

  • Hero Member
  • *****
  • Posts: 986
Re: storing assets for releasing a game demo
« Reply #3 on: June 05, 2026, 07:30:13 pm »
If you don’t care about hiding assets and making them harder to steal or modify, it doesn’t matter how you deliver them. I delivered some of my games in exactly this format: texture atlases and sounds were loose PNG and WAV files that could be previewed and modified. I didn’t want to hide them, and this made it easier to develop the game and mod it later.

However, you should care about loading assets into memory quickly, which is why creating large binary files containing asset collections is a very good idea—one commonly used in game development. You can also compress and encrypt assets to make data mining and asset theft difficult. But this is largely a futile effort, because if your game is valuable, sooner or later someone will break the security measures and create tools to extract and modify the assets.

If you have only a few assets, it doesn’t really matter how you store them, because they’ll load quickly anyway. However, if you have hundreds of megabytes or even a few gigabytes of assets, I advise against manipulating text files (JSON, XML, and the like), especially frequently at runtime, because parsing them is a waste of CPU time. Use the built-in tools or create your own to generate compact binary asset files, with O(1) access to specific assets via an offset dictionary (also stored in such a file). Also, try to limit the number of installation files so as not to overwhelm the file system—using thousands of tiny files isn't a good idea.
Lazarus 4.6 with FPC 3.2.2, Windows 11 — all 64-bit

Working solo on a top-down retro-style action/adventure game (pixel art), programming the engine from scratch, using Free Pascal and SDL3.

DrakkTheSeafarer

  • New Member
  • *
  • Posts: 13
Re: storing assets for releasing a game demo
« Reply #4 on: June 15, 2026, 06:56:21 am »
Great Thanks for all your suggestions and ideas!  8)

I am currently working on a Editor for bigfile asset collections. And a class that does the job of speedy loading of a big binary file that consist of all used assets with a loadable list of content (offset dictionary). I also decided against the paszlib for compression. Lz4 and ZSTD can help to speed up the loading process especially on modern SSD / NVMe.

Greetings

Handoko

  • Hero Member
  • *****
  • Posts: 5558
  • My goal: build my own game engine using Lazarus
Re: storing assets for releasing a game demo
« Reply #5 on: June 15, 2026, 08:35:23 am »
Don't worry about the compression now, adding this feature shouldn't be difficult. Examples can easily be found in this forum. Besides, modern computers are quite fast unless you're building a triple-A game that contains several GBs in size.

 

TinyPortal © 2005-2018