top of page
Search

[127] int8_t Max

  • Writer: Conlan Walker
    Conlan Walker
  • May 3, 2024
  • 2 min read

This week, I refactored the very fundamentals of how the engine works (again), and created the file parser for stored scenes, called scene descriptors.


A scene descriptor is able to store info about a scene's objects, background, tileset configuration, what scenes are connected to its edges, as well as its music and ambient tracks (in addition to the tile ids and collision info!)


All this is done while still being very simple to parse in C, and by extension C++.

To the left is an example of a 68-byte scene descriptor that is just two of these tiles next to eachother:

Really, as long as a scene is within multiples of 4096 bytes in size, I'll be happy with how its memory is handled (assuming that the default block size for NTFS filesystems is 4096 bytes or whatever).




In fact, if the file is reasonably smaller than something to the tune of 512 bytes, theres a chance it'll technically take up 0 bytes on disk.


For example, this is the scene descriptor representation of the scene I showed last week.





As in, this scene:


Since I haven't finished the tool that creates a scene descriptor from Tiled XML map files, I had to type this scene out by hand, which took a fair amount of time. Tile data uses RLE, so It wasn't as simple as just punching in one thing for each tile.



Speaking of the XML map files, here's what they look like when looked at using a text editor.

This format is significantly larger than my own format. This file in particular is over 18 TIMES larger than my own representation of the same data:

I am definitely glad there's a python library for directly parsing XML-based files, so next week I'll finish the converter.



Oh, I almost forgot. Here's the boring code nobody reads:


 
 
 

Recent Posts

See All
[152] Surface Tension

I now have 2 projects going (technically), and on one of them I currently have something that is shaping up to be something resembling a...

 
 
 

Comments


bottom of page