Actions

SCHG How-to

Create Splines For Sonic Generations

From Sonic Retro

(Original guide by Faseeh)

SCHG: Sonic Generations
Main Article

Objects
Collision Properties

File Index
BB

BB2
BB3

How-To
Import Levels

Create Breakable Objects
Create Splines

This is a step-by-step guide on how to create splines for Sonic Generations.

Required Tools

- 3DS Max (which you would have already for importing the stage)

- Your stage's Max file

- Dude's Spline Exporter, which comes with GLVL and is stored in the export_scripts > 3dsmax and is called splineExporter_auto

- Dario's SonicGLVL (which you already have if you imported your stage)

- Generations Archive Editor by MainMemory

- Notepad++ (for editing XMLs easily)

Before you Begin

You need to have your stage imported so that you can check how it works and such. You need to know that splines are necessary for 2D Sections, rocket sequences, ziplines/pulleys, loops, quickstep sections, corkscrews, rails and sometimes ramps.

Step 1: Getting Ready to make the Spline

So, for example you have a curved path that you want to make a quickstep section. For example this section here from Frog Forest. right click that model, and convert it to Editable Poly. Once that's done, on the right tab, you should see a box with a rainbow inside it. Click that, scroll below and you will see a Selection tab with 5 different buttons/image. One being three twinkles, another being a triangle, another being a bean-shaped figure, another being a square and the final one being a cuboid. The bean-shaped figure is used to select borders, the triangle is used to select edges.

Step 2: Making the line for the Spline

Try to select the border first. So click that bean-shaped figure and select till where you want that one line to extend to. To select more than one selection, hold Ctrl and left-click. Now, go to the Edit Borders tab on the right, which should be below the Selection tab. Click 'Create Shape from Selection'. Name it whatever you want for now, and let it be Smooth.click okay and you will see a white line appear at the place you selected.

Now what if you couldn't use the Border tool to select? Use the Edge tool and manually select all the selections you want of one side of the border of the place which you want Sonic to run on and then click 'Create Shape from Selection'.

Step 3: Fixing the Spline

Well, if you used the Edge tool, you would only have one line and you wouldn't have much problems, you may have the perfect line. You may still want to do the moving part to make sure the spline is connected and to make sure the hidden lines appear.

However if you used the border tool, your spline may have a weird starting point or it could have unwanted curves, extra lines and such. Like shown in this picture. Before you start fixing, I suggest you right click the shape/spline and click the square you see beside the Move command. Now, take note of the X value. And then now change that value and make sure the spline is all alone in a far away. This will let you observe all its problems, fix it and then bring it back. Now, what you do is go to the Modify tab. The shape should be an Editable Spline so what you do is choose the button with 4 twinkles in the Selection tab, that's the Vertex button. here you can delete the points. So if you can delete the points of the unnecessary lines, you can delete the unnecessary lines too. You could use the segment tool but this is more effective.

When you are done, you should have something like this. Now, click the shape/spline again and move it back to where it was by clicking the box beside the Move command and then entering the value that was originally there, the one that you took down.

Step 4: Are we there yet?

Now, some times one spline will work. For rails, yes. For ziplines and rockets, it's just right. But for quickstep sequences, two are necessary. Loops may have stuttering issues if you don't have two splines. So when you have two splines, Sonic will run in the middle of those two and you won't have spline activation problems. If you have one, Sonic will run/grind on that. Sometimes you may need to make a whole new spline for the other side. Sometimes you can just rotate and move the one you already made. But remember, if you make a new one, both need to have the same number of vertexes. If they are different, the game will crash.

Take into note, for quickstep splines, the splines are the last two paths Sonic can run on.

If you made two splines, click one of them and attach them to the other by using the attach multi. command in the Geometry tab. Now they'd be attached and one shape.

Step 5: Making them fit for Generations

You can name the splines whatever you want, but you have to end off their name accordingly and no two shapes/splines should share the same name. End them with one of the following suffixes depending on their use:

@SV = Side View path. Used for setting 2D modes.

@GR = Grind Rail. Allows Sonic to use the particular spline as a grind rail. No collision needs to be added to the grind rail for this to work.

@QS = Defines a set of quickstep paths. Needs the "Forward" mode set in-game to be detected. Notice that these also need to be defined in "Stage.stg.xml", and the Quickstep spline is merely a guide for the game to create the real quickstep paths offset from it, by a certain distance and number of lanes.

@DP = Defines a dash path, used for Dash mode. In Dash Mode, Sonic normally steers along the spline when going at high speeds, and he can't go off the sides of the spline. This is useful for boosting sections that might involve a lot of curves and such.


For example, MySpline01@GR would define that particular spline as a usable grind rail in-game.

Certain objects such as Rockets and CPZ pipes can use splines that don't need particular naming. Instead, they use an internal ID defined by "Stage.stg.xml", and are identified as "Guide Paths". You can use any number you want for the ID, just make sure to not override any other ones that are already defined.

Step 6: Importing into GLVL

Now, open Generations Archive Editor and go to your mod folder. Open your stage's #_____.ar.00 and the extract the path.xml on to the mod's folder.

Go back to Max and select ONLY your splines/shapes and navigate to the Utitlies tab on the right (it has a hammer icon). Click MAXScript and then choose Run Script. Navigate to Dude's Spline Exporter and then choose it in the drop-down menu below. Now click 'Export' and replace the path.xml in your mod folder. Let it replace and now, open the #_____.ar.00 in Generations Archive Editor again and then delete the path.xml there and add in the one in the folder.

Now click save and let it be the padding number it is and generate the .arl file. Your splines will now be visible in GLVL. Don’t close Generations Archive Editor just yet!

Step 7: Defining Quickstep and Path Splines

  • Take into note the commands for the paths and quickstep sequences may not be in the exact format. It is recommended that you actually check a level in Generations' path.xml and copy from there.

Skip this step if you don’t have a path spline or Quickstep spline. Camera splines are defined the same way as zipline/rocket paths. Now, extract the Stage.stg.xml from that ar.00 on to your mods’ folder. Open that and the path xml in Notepad ++. Don’t do anything to the path.xml. Now you can see that the stage.xml has a lot of things there already. Ignore those. So when you scroll down, you may see things like

    <Guide>
           <Name>GuidePath001</Name>
           <ID>1</ID>
   </Guide>

Copy this and add as much of them as the number of zipline/rocket paths you have. Add those and I recommend that you change the number in the name to the same as the ID you used in your max file for the lines you did for the zipline and rocket paths. Change the ID number to that number too of course. Now for quickstep splines, after all the Guide stuff,

    <SingleForward>
                   <Name>_____ @QS</Name>
                   <PathNum>3</PathNum>
                   <Space>3</Space>
   </SingleForward>

Copy as many of this as you have the number of Quickstep splines. Now for the name, it’s the name you used in your Max file. If you forgot, you can copy it from your path.xml. The path number is the number of paths which Sonic can run on. For the space, it’s the space between the number of paths, tweak that to your interest. After this, save both of these files and then delete the Stage.stg.xml in the Archive Editor and add the one in the mod folder, the one you edited. Now save and generate the arl file.

Step 8: Activating them in GLVL

Now, if you open your stage in GLvl, you can see white lines. Those are the splines you made, now how do you activate them? Navigate to Changers in the GLVL toolbox. These are to be placed at the place where you want them to activate the spline, and they need to be in contact with the spline. Forward refers to Quickstep. 3D refers to your free movement, 2D refers to your 2D sections and Dash is your sequence with the @DP spline. Sometimes you place it and it will not work. This is because your changer may be on the wrong rotation, rotate it 180 degrees and then it will work.

If you want a path to be autorun but did not use the @DP tag? Simple! Navigate to Collision Triggers in the toolbox in GLvl and you will see collision names with Autorun. AutorunSimpleCollision means the player still can control jumps and such. AutorunCollision doesn’t allow that. You also need to put a Finish and Start trigger so that it works properly and they both need to be of the same type. If it didn’t work, it just means your changer is on the wrong rotation and just rotate 180 degrees and then it will work.

That’s it! This is how you create splines for custom levels in Sonic Generations. Hope this guide was helpful. If you have any question, feel free to contact the author.

Notes

Cameras can use splines too. You need to determine the path in the Terrain.stg.xml just like you would for any path ID, for zip lines and rocket paths.

For zip line, camera and rocket paths, drawing a line from point A to B is enough. So, draw a simple line and give it a number from 60-100 and export it with the other splines.

Sometimes when you make splines, some lines may get hidden below the terrain, just move the spline to see if it’s all connected and then undo the move action.

For stage/terrain loading paths, it's pretty simple. These will improve performance on custom levels a lot. Simply draw a line in 3DS Max from the start of the stage, all the way to the end. Extract the StageGuidePath.path.xml from your #_____.ar.00 and now, export the one line with Dude's Spline Exporter and replace the StageGuidePath.path.xml and then delete the StageGuidePath.path.xml in the Generations Archive Editor and add the new xml and save and generate the .arl file. You may want to fiddle with the draw distance number in your stage's Terrain.prm.xml, try to find what you think fits and looks good, and doesn't take a terrible toll on performance.