@Rahkiin - That is a good idea, as the file format docs that come with Sphere may be a bit outdated (especially the map and spriteset ones). If they're not documented on the forums for some reason, ask Radnen and Flying Jester for their findings on parsing Sphere formats (especially version inconsistencies) since they've worked with them more recently than I have. Lord English may also have a couple of notes after making some edits to Radnen's Sphere Studio. alpha123's worked with the most recent version of vanilla Sphere, but that may have been quite some time ago. The Web Sphere Utilities repo has my code for parsing the formats but it's all in web-compatible JavaScript. Pick your poison
Keep support for older versions, or rather find some way to implicitly convert older versions to newer versions on load in the editor (eg, if old version then popup "<X> was made using an older version of the Sphere editor, would you like to convert it to the current format?").I still recommend double-checking with at least Radnen (if you haven't looked at the Sphere Studio repo for reference) and Flying Jester as Radnen worked out some inconsistencies with the newest file versions and Flying Jester is trying to expand the formats in conjunction with the other TurboSphere expansions to Sphere.
struct TILE_INFORMATION_BLOCK byte obsolete1_; byte animated; word nexttile; // For animated tiles word delay; // number of frames to wait until next tile switch byte obsolete2_; byte blocked; // 0 = no obstruction data, 1 = old obstruction data, 2 = new obstruction data word num_segments; word name_length; // see the name below the header segment byte reserved[20];end structstring name; // strings are stored after the data block has name_length size
if(version == sphere_1_6) load_sphere16_shim()if(version == sphere_1_5) load_sphere15_shim()