I've been thinking a bit about one of my other projects and how to encode basic information so I don't need to either hard code it or have an external definition file.
The general idea is this. You have a room with several different states including footprint (which includes width of the room and how many floors it occupies). Each room has several states -- empty, idle, active, busy, burned and flooded.
The image file for the room is stored as a 32-bit image, 8 bits per channel with four channels (RGBA).
Rooms need a few bits of information -- the locations of the slices within the overall image of each 'state' of the room, the width and height of the room, its build cost, maintenance cost, room type and a few other things.
It occurred to me that almost all of this numeric in nature and can be encoded into the RGBA values. Width/Height is easy enough using the Red and Green components assuming you never have anything that exceeds 255. OR, you can interpret each pixel as a 32bit value giving you up to 2,147,483,647 for signed values (and 4,294,967,294 for unsigned values). In terms of the above, this should be more than sufficient. Hell, even words can be encoded this way when using the ASCII code page only (values 0 - 255), allowing for a single pixel to store up to 4 characters (though this would suffer from a problem with localization to other languages).
I guess what I'm wondering if this is worth the effort? It would eliminate the need for external definitions separate from the image files themselves and could encode all pertinent information within the pixel data itself. It would also be fast as there would be no need to parse and interpret a text file though a basic utility would be needed to encode the more complex data (fairly simple to develop, honestly).
Thoughts?