Sonicâ06 - Greenflower Zone Mod Technical Write Up
On April 27th of 2020 I released the Version 1.1 update for my Greenflower Zone mod for Sonicâ06, a few days before release, I got the idea to do a technical write up on the process that I went through making this mod, as it is a strange one that has morphed over the span of almost a year, evolving and growing with theâ06 Modding Scene itself.
Original Proof of Concept
Back in May of 2019, I started toying around with some old Sonicâ06 tools, thanks to my interest in modding the game rising following improvements in Xenia which made the game more playable within it. As Iâd previously done Greenflower Zone Act 1 for Shadow The Hedgehog in February of the same year, I decided to use it as an experiment for importing stage terrain intoâ06; as I already knew the rough process for converting a model to an XNO thanks to me trying to put one of my Sonic Forces Avatars over Sonic.However, we didnât have a way to do collision at this point, so my initial plan was to use the common_stopplayercollision object to kind of fake the collision so I would at least be able to walk around it. Unfortunately, the character doesnât treat that object as ground, so they just float above it. Yet I still decided to place some objects around by manually typing in coordinates based off the object placements Iâd previously done for the Shadow port.
Initial Collision Experiments
Shortly afterwards, Melpontrooffered to convert a collision mesh for me, while we didnât have surface tags on it, it was a good enough job to let me experiment more with the stage, which I did by continuing to copy and paste object coordinates from the Shadow port, again, all in plain text XML files. As a result, objects werenât rotated correctly due to Quaternion Rotation being literal satan and I would have to check an object in game to even see if it was close to being correct.
SonicGLVL
At some point, I hit upon the idea of using SonicGLVL (the Sonic Generations Level Editor) to visualise the object placements. This mostly came about due to me remembering that object rotations in Generations SET Files are also Quaternions, so I could copy and paste their values to get the rotations correct. While I was still hand typing everything, this made it easier to determine object placements, especially considering Shadow The Hedgehog could spawn multiple Rings from one Ring object, a featureâ06 lacks, as a result, I had to guess the right coordinates for the other Rings with no way to visually check it without booting up the game.
Surface Properties and Sticky Walls
A few days after Iâd done more SET work, I sent Melpontro a version of the collision with various meshes tagged by type, allowing him to create collision with various Surface Properties, resulting in proper footstep sounds for surfaces. However, this also led to an issue caused byâ06âČs unusual tagging system for collision meshes.
Walls inâ06 need to be tagged as such, resulting in quite a bit of trial and error until we got it mostly working. With Act 1 done to a good enough state for a proper work in progress, it was time to move on to Act 2.
WinForms and HedgeLib
Around the time of working on Act 2, I decided to start cobbling together various small C# programs using HedgeLibto try and help me with the process, while I was roughly familiar with bits and pieces of theâ06 SET Format thanks to my previous work on the Sonicâ06 Randomiserthere was still a lot of things I didnât know.
One of the first things I wrote was something that would load a SET File and allow me to see all the parameter values of the objects within the SET. This allowed me to document what I thought the parameters for certain objects do (while also discovering a frustrating quirk in HedgeLib). As time passed, work continued on Act 2, while I also started creating an original layout for Shadow, designed under the mindset of playing the stage backwards. Before I got sidetracked working on something else.
The Mod Managerâs early beginnings
Over time, I gradually became frustrated with having multiple copies ofâ06 and accidentally cross contaminating them with various mods thanks to me copying them to the wrong install. While Hyperhad a GitHub page for a Sonicâ06 Mod Manager, it didnât actually work, leading to me to write a small C# Command Line application to copy and remove the Greenflower files for me. This eventually led to me creating a small GUI for it with the ability to load multiple mods together, which would soon be expanded upon.
Around the same time, I also experimented with Melpontroâs old Emerald Coast stage mod, managing to get it running on Xenia, while also figuring out howâ06 handles volume objects such as camera volumes. I also brought back a joke Sonic Forces mod at this point, Chair The Sonic, which would evolve into Furniture Adventure 3 before I killed the joke thanks to it going far enough to become unfunny.
Greenflower did take a backseat at this point, only really being used to test Vertex Colours for underwater colouring, as well as experimentation with the gameâs dynamic lighting system. Though it would soon be used as a testing ground for something.
The GLVL Converter
On the 2nd of June, I posted this image to my Twitter, based on the wording of my tweet, it sounded like I already had a system in place to convert Generations objects toâ06. However, I would have still had to do all the parameters manually in an XML. This process seeked to change that, with me manually creating GLVL Templates for objects as I needed them and writing code to auto convert them (shamelessly ripping off the GensToForcesSETConverter in the process). At a future point, I wrote a tool that would autogenerate the templates for me, although the object parameters were just labelled as Parameter1, Parameter2 and so on.
Throughout the process of experimenting with and understanding objects, Greenflower was used as my test bed, as I was too lazy to make a proper test stage for myself at the time and didnât really have easy access to the unused test level recreations.
The Mod Manager and Tropical Jungle Extra
While working on the SET Conversion experiments, I continued to work on my Mod Manager alongside it before creating a new experiment to mess around with the DLC system and the converter. I started creating a layout for the third section of Tropical Jungle for Sonic, as he does not normally visit that segment of the stage.
Greenflower took a massive backseat at this point, as most of the focus went into Tropical Jungle Extra, before me and Hyper teamed up to create a better Mod Manager out of both of our work. After releasing Tropical Jungle Extra, I worked on a similar concept for Silver and the first section of Dusty Desert, although this never saw the light of day, nor did my short lived attempt at creating a DLC episode for Knuckles.
Lost in Translation and Camera Experiments
At some point in July, I started tinkering with Greenflower again, rebuilding the SET files from the ground up with our new templates and the GLVL Converter, while also experimenting with using dynamic cameras for some parts, at some point I also inserted the music thanks to our XMA workarounds. However, thanks to me having no ability to experiment with the collision, I drifted away from it again and started working on a new project, messing around with Google Translateâs API. This project became Sonic The Hedgehog: Lost in Translation.
I was still working on the Randomiser at this point, so my attention was very divided, with Greenflower slipping down the priority list. At this point, I was also aware of SRB2 2.2âČs intent to redesign the zone from the ground up, which pushed it even further down while I waited for it.
The Collision Converter
Towards the end of the month, I remembered Sajidâs previous attempt to write a Collision Converter for me using LibS06, after requesting that code, Skythprovided me with the line to make it work, which I tested on a shoddy import of the Sonic Adventure 2 version of Green Hill Zone Act 1.
With a Collision Converter in hand, I started experimenting with other stages, creating a version of Westopolis forâ06, as well as some other experiments that didnât go very far. Before eventually jumping back into and finishing Lost in Translation.
At this point, Greenflower was still on the backburner, with me only really using it to see how the Sonic Adventure HUD mod would look with it and also putting it into theâ06 demo for the hell of it.
More focus was placed into the Mod Manager around this time, with us rewriting it (leading to the creation of the Aldi Mod Manager jokes).
Mortar Canyon
For some silly reason, I started messing around with Mortar Canyon from Sonic Forces, there isnât really much to say about it, other than the fact that I needed to use the Switch terrain, as the PC terrain behaved unusually.
SRB2 Version 2.2
Following the release of Sonic Robo Blast 2 Version 2.2, I tested opening and exporting the Greenflower Act 1 terrain for it from Zone Builder to see if it still worked, and it did. As a result, I started messing with it again, although my priority at the time was on my Tropical Jungle mod for Sonic Forces. Issues with the Zone Builder export also lowered my motivation to work on it, although I continued to experiment in the background, trying to find fixes.
About a week later, I toyed around with the Zone Builder source code, finally managing to correct the issue, which was caused by Zone Builderâs OBJ exporterâoptimisingâ the exported terrain by throwing out certain vertices.
With the source for Zone Builder, I also experimented with having 100% accurate object placement, writing a small hack to export the Thing Placement into a text file which I could then use to write into a SET file with HedgeLib. However, object heights are handled incorrectly in Zone Builder, requiring me to fix certain objects manually.
As I finished up work on Tropical Jungle for Forces, I started working more on Greenflower in the background, while also experimenting with some dumb jokes. However, I soon hit another motivational block, The water and grass edges...
Nonami the Material God
Thanks to poor documentation of the XNO format, we had no clue how to make transparent objects look good or how to make translucent objects at all. As a result, I kinda trailed off for a while. However, on the 2nd of March, Nonami showed an image on the Lost Legacy Discord server of translucent water in their Emerald Coast mod and also told us the byte to hex edit to enable it. A quick test later, and I had translucent water
I soon moved the level over to the Kingdom Valley slot, as I wanted to use the breakable wall object that stage has, which meant I needed that slot for the sound, before following up with creating Vertex Colours for the underwater terrain.
Hyper later took over some work on the Skybox and Grass Edges, experimenting with hex edits and texture upscaling to help smooth out the transparent edges while I worked on creating the SET files for the other characters He also worked on fixing up the fence collision for me, as the way it exported from Zone Builder caused Sonic to be able to fairly easily clip through them.
Eventually, I decided (with very little thought behind it) to make various elements of the stage grindable, before following it up with (incredibly tedious to make) Light Dash splines. Eventually, me and Hyper screwed around with it in Multiplayer late into the night, giving us the inspiration to start trying to create a Prop Hunt gamemode for â06 too.
With most of the motivational stumbles out of the way, I decided to tackle the flowers and trees by recycling models from Sonic Lost World and Sonic Generations, a process which proved extremely tedious, as the XNO Converter we use only allows for one model at a time. A fact which didnât help when I needed to export every single flower and tree one by one.
The Act 1 Release
On the 18th of March 2020, I decided to FINALLY release a version of Greenflower, with it soon being updated to correct a few small issues Iâd overlooked. After a small break, I started working on Act 2. Thanks to my workflow developed for Act 1, Act 2 went fairly smoothly at first, as I already knew what I needed to do to make the grass edges and water look good. I could also copy the Skybox from Act 1 with no problems, which was nice.
The Act 2 Retargeting Whack-a-Mole
When it comes to level layouts forâ06, easily the biggest annoyance comes from objects such as Springs. Inâ06, Springs can target other objects by their IDs, which is a really nice feature. However, if the object IDs get changed around, then the target will no longer match up, as a result, I had multiple points where I had to comb over the act to make sure every Spring still targeted the correct object. This was an issue that was much more pronounced in Act 2, due to there being many more Springs in it.
To make matters worse, the object IDs shown in SonicGLVL seem random, so to get the ID of the object I wanted to target, Iâd have to convert the SET and look for the object there to get the correct ID. Towards the end of development, I hacked something together that would make the GLVL IDs match the converted ones, making it much easier to handle, if still tedious. My insistence on deleting unneeded objects in the various other character SETs is the primary reason for this headache.
Another problem I noticed a lot in Act 2 were seams in the terrain where Zone Builder didnât export the terrain correctly, while these were (mostly) easy to fix, it was tedious every time. As it involved the following process.
-Remove the Skin Modifer-Edit the affected meshes so theyâd join up correctly-Reapply the Skin Modifier-Export the edited meshes-Import them one at a time-Edit the collision-Export the collision-Convert the collision
Not hard, just tedious, as with a lot of the work that needed to be done on this project.
Specular Mapping
At some point, I toyed with the idea of adding a small specular map on the windows and roofs of the various houses scattered around the zone. After multiple attempts which blew up in my face, Nonami pointed me to a shader that would do what I wanted, creating this nice, actually fairly subtle effect which was also added to Act 1 for consistencies sake.
However, attempting to add this trick to the water did not go well at all...
Developer Time Trial
At some point when working on Version 1.0 of Greenflower, I changed the text for the Hard Mode selection on the stage select to Not This One. Thanks to me not bothering to make a Hard Mode SET thanks to me finding them to be a waste of time.
In Version 1.01, I did sneak a small SET in that would be loaded if you selected the option, but it otherwise served no purpose.
While messing with the Town Mission timer for Prop Hunt, I realised I could use it to create a Developer Time Trial mode, by simply recording my best time and setting it as the Timerâs value. Originally I intended to record runs for all nine characters, but a limitation of the DLC system prevented me from neatly adding them for the amigo characters, so it was cut down to just Sonic, Shadow and Silver.
These also use slightly modified SETs, mostly to remove the Bronze Medals, Starposts and Voice Triggers.
Bronze Medals
When initially importing the SETs, I decided it would be a cute idea to replace the Emblem and Emerald Tokens in SRB2 with the very underused Bronze Medals. As it turns out,â06 actually has a counter for these medals that goes unused in the final game, activating the counter was a simple as adding OpenMedal(_ARG_0_, 15)to the main event in the stageâs Lua file. While the medals serve no purpose in Greenflower, I felt like enabling the counter just to show an unused piece ofâ06 off while also encouraging exploration in the form of Medal Hunting.
Closing Words
While it may not seem like too much on the surface, I personally am actually quite happy with how Greenflower has turned out. Its long development time and various restarts have given it the chance to fully take advantage of our advancements in the Sonicâ06 modding scene. While there is still a lot left for us to learn, Iâm content with this projectâs release state and am ready to move on to something new in the future.
Greenflower forâ06 has being nearly a year in the making, and Iâm glad to have been able to see it through. A special thanks goes to the people who helped me in this modâs creation, it wouldnât look as good as it does without Nonamiâs XNO research and it may not even have gotten finished if Hyper hadnât helped me test it and thrown some ideas my way.
Hereâs hoping we can do some more qualityâ06 mods in the future and realise some of the potential this game never got to show (and maybe do some silly stuff along the way too!).