Well… after a lot of work and refining, I’ve gotten to a stable point with my file formats. I’ve been creating them for over a week now. They serve the purpose as uncompressed containers for data, which are easy to load. If you don’t want to write the simple load functions, you can just use the standalone library which the program I am making uses. The program is a terrain editor featuring one of my file formats. I’ve also been working on the program over said time period.
My file formats as XMM, XMI, and XMH. They are part of the XM series, obviously. The XM has no real meaning yet. I am open to suggestions on that, but I am thinking about X for uncompressed M for media. I don’t really like the medium part… so there is still stuff on that.
The logo
All file formats
I made a few image files for the formats and I got licenses around. I am using GNU GPL 3, then used their suggested reference for the people to look at GNU GPL 3. I am going to use the logo for the program. I really like the style I came up with. The program so far is a JFrame, which has a menu bar, canvas for opengl, and space to the right of the canvas. I want to fill this stuff up with tools, so with the space I had above the canvas, I put a tool bar. I coded a simple, complex plugin loading system, which took some thought and trial. It was a variation of an old one I made. I am quite happy with how that turned out. I decided to write an article for writing them on JGO and that had got some major hits in just a short amount of time. I currently have 2 project folders for my plugins, as it takes one to lay out the abstraction and another one to extend that abstraction, which links back to my terrain builder.
The goal of these files formats are simple.
XMM is for mipmaps. The file starts with a 2 byte header. The first byte is a boolean (0 or 1), which indicates transparency in any of the mipmaps levels. The second byte is an indicator for how many mipmap levels there are. There can be as many as you want. Then you have the body. The body has two components. A size array and the pixel data. Inside of the array is data that contains width and height information. There are ‘mipmap levels’ (header byte 2) amount of width and heights. The width is 2 bytes. The height is 2 bytes. Each mipmap you add makes this array 4 bytes bigger. They are shorts. After this, there is the image data. Right before the image data, a boolean indicating if that specific image has transparency. This is an extendability thing, and can be useful. As you can see, the file is tightly packed because the header, size data, and image data are all smushed together without byte offset indicators in the header. This file is procedurally loaded. Note the image pixel format is strictly RGBA.
XMI files have been renamed from XMT files. They were originally made out to be textures, but they are just another image file format - a raw one with a 5 byte header. There is no mipmaping or anything going on, so the closest thing to texture here is XMM files. The first byte in the header is a boolean indicating transparency. There is backwards compatibility with XMMs loading XMI files for mipmaps, so basically XMM files are an array of XMI files… with the exception of the next 4 bytes which are two shorts indicating width and height of this image. The width and height are not in that array in the XMM file. So that is that. Following the end of the header is the image data. Note the image pixel format is strictly RGBA.
XMH hasn’t been created, yet. I have all necessary information to make a basic one. The goal for this file format is hold heightmap information. The header is 8 bytes. There are 4 entries in the header. That means each entry is 2 bytes - a short. The first short is for the amount of terrain sections there are in the X direction. The second short is for the Y direction. The 3rd and 4th short are width and length of each triangle. Moving on to the body, there is a bunch of sections, which are loaded in by utilizing for loops and the first 4 bytes of the header. That is as far as structure goes. There is, inside the structures which indicate the terrain sections, a crap load of shorts, which indicate the height of the terrain at that specific point. XMH files are largely speculated by me to be changed a lot to support different, necessary features. I haven’t put much thought into it, but I am now ready to make this file, as I finished the minimum of my program to involve saving to file.
I am using nullsoft scriptable install system (nsis). I gotta say I love it. It is neat and effective. I am using the older version 2.5.1. What it does is load my icons and jar into a program files folder and edits the HKEY_CLASSES_ROOT so that my icons actually show on the files :point: that’s a neat touch that I love. Funny story, while I was doing this, I found my gadgets context option in there somewhere and delete that useless button aswell as a few things that needed to go. The registry offers more than just icons to me. Since I can convert files to my XMI format (currently BMP and PNG are only supported), I can add a right click context menu option to do so. I can also convert from XMI to that format, which is not implemented. I just have the conversion supported. Nullsoft lets me clean up the environment without hassle, and it even refreshes windows icon cache so that my icons actually show on the files
I am currently enjoying my project, which is really a digression from creating my game engine x)