Import art to SonED2
From Sonic Retro
So you want to import your own art into SonED2?
Please note, I have been modifying Sonic 2, and have absolutely no experience in the same process for Sonic 1. I am by no means an expert in SonED2 myself, and this is not the definitive method of importing art. This is the method which I developed through sheer trial and error, so if you think I am ‘wrong’, feel free to correct me for the benefit of anyone who might try and learn from this guide. I’ve tried to make this as straightforward as possible for beginners, so if you feel patronized, I apologize.
A stray click in SonED2 is likely to change something. Probably something which will come back to haunt you. There is no undo button and if you hit ctrl+z and delete some art trying to undo, you can’t undo that either. It is important to save frequently until you are confident enough with the program that you understand what your clicks will do.
Preparing the Art
Obviously, you will need to draw this new art, first and foremost. At this point, you may have already drawn the artwork and are banging your head against a brick wall. Equally you may not have started yet. In either case you should take into consideration; SonED2 imports image files from the .pcx format, not the most common image format in the world. In short this means you cannot just use MS Paint for drawing. I use Paint Shop Pro, which even shows the palette of the image on the colour selector, so it is worth exporting existing level art, erasing the image, and working from this file to preserve the palette.
SonED2 will import the art into 128x128 ‘chunks’, 16x16 ‘blocks’ and 8x8 ‘tiles.’ It does this automatically, working from the left to right, down the image. To make for a clean import, you should make sure the image file you are importing is perfectly lined up (I recommend using a configurable grid to achieve this, and guess what... PSP has one). Any repeated chunks, blocks or tiles are skipped over after their first entry. It is of course possible to break down your art into individual 128x128 chunks and import them in one by one, although there is no distinct advantage of doing this. If you are using a very large image, then it goes without saying that you should ensure that the dimensions of the image are multiples of 128.
Each individual tile (8x8 squares) can only take colours from one palette line, so if your art contains colours from across the palette, the colours will be taken from their equivelant place on the palette line you are using. If this is the case you may want to consider revising your art. SonED2 tries its best to auto-configure the palette when you import the art, choosing which line to use based on the top left pixel of the tile.
Replacing the existing level
Assuming you have taken into account all these things and your art file(s) are ready, you will want to choose a level to overwrite. Open the level in SonED2, (in the /soned2proj/ directory of your disasm, Emerald Hill would be ehz1.sep)
and hit ‘I’ to reach the chunk selector screen. At this point you will want to remove all of the existing art for the level, so select a chunk and hammer ctrl+z repeatedly until every single chunk has been removed. Chunk 001 is the blank tile by default, so either preserve it or ensure that the first chunk that you import is the blank chunk you will be using. Next click on the ‘block selector’ text on the right of the palette display, and repeat the process for blocks, and finally tiles, the menu for which can be accessed from jsut under the palette display.
Importing Art and correcting colour issues
Once the level has been “hollowed out” as it were, hit, file > import from image > chunks. Chances are, your art is there, though patchworked and miscoloured.
Next you must go through the painstaking process of correcting the palette. Here you will need to use the block selector, left click on the first block to bring it into the tiny window on the left of the words “block id,” and the right of the palette display. Moving the mouse here you can select one of the four tiles used to make up the block by double right clicking and then altering their properties with the tiny arrows on the right. Alternatively you can hover the mouse over the area in question and alter the settings with keyboard shortcuts. In this case, use H+N to change which palette line each tile uses, hovering over each one in turn. This is quite a long process, particularly if you have a large amount of art to import so you may want to deal with the planes at this point too. Above the palette line selector there is a plane selector which specifies whether the tile is high plane (foreground) or low plane (background). Bear in mind that blocks have the same properties regardless of whereabouts they appear, so you should have some idea of whether you want sonic to consistently run in front of or behind the tile. There is nothing to say you can’t return to configure the foregrounds/background aspect of the art at a later stage when your level has taken shape and the ‘bigger picture’ is clearer to you.
At this point, you can hit L and paste in some makeshift level layout, although you will notice that SonED2 is trying its best to load a level that you have decimated. You might want to clean this out with a blank tile, although this is not vital yet. You might be tempted to save, build and play your new s2built.bin, complete with level art. What you will find is that you fall clean through your nice looking new art. You will need to add collision to your art before you can play on it.
Go back to the chunk selector screen by hitting ‘I’ and choose a chunk to solidify. At this point it would be sensible to choose a flat surface such as a piece of floor or the similar. Left click on the chunk to bring it up in the editor on the bottom left of the screen. By double right-clicking on blocks in this chunk window, you can bring them into the block editor in the same way as you did earlier when fixing the palette. With the chunk still selected in the bottom left, you should click the Solid Select text located just under the tile selector and select the final solid which SonED will inform you has the Solid ID of FF and also an angle of FF. For now, simply double right click the blocks on your art which you require to be solid and click the digits on the left of “Solids” in the block menu (the one used to fix the palette line previously. They should both read FF for now.
The first value refers to the solid used for the block in the first path and the second for the solid in the second path. This will be explored in more detail when we tackle loops and more complex scenery, but for now, all that matters is that both paths are solid and flat. As with all the other detail in this block menu, these settings will be consistent regardless of whereabouts the or how many times the block occurs. Finally, once all the solidities have been assigned to the blocks in the chunk (empty space should be left as 00 ideally, although providing you leave them “not solid” in the step we are about to cover, the solid assigned to the block is irrelevant), you should go through the blocks again in the chunk window in the bottom left and assign each block a collision setting, by either double right-clicking the blocks and using the tiny arrows, or hovering over the blocks and using the G+B and H+N keys to change the first and second paths respectively. Again, for this exercise you will want to set both paths to “all solid.” To check you have competed this successfully you can push W to view the solidarity in the first path and E to view the second. At this point, the blocks of the ground on which you intend to stand should be a solid black colour with the angle FF displayed in the middle in both paths. Said chunk should now have functioning collision in-game.
Slopes and Solidity Graphs
Ok so, we have seen a piece of art right through to the game, but a level built up of purely square furniture would be dull as hell right? You are likely to want to create slopes for your beautiful new level. Having imported the art in the same way as detailed earlier, rather than assigning the Solid FF to the surface on which you’ll be standing (everything underneath, the sides and bottom for example, you should still use FF) you will want to use a sloped solid. You can use the “Show Block” option to display the currently selected solid in the graph in the centre of the screen over the currently selected block, but chances are, they aren't going to line up perfectly, so you are going to have to create your own. Select solidity graph DC, the first blank one in the solid selector, and select a block from your chunk, and use the graph in the centre, building the columns of white to show where your block is solid and therfore where sonic can stand. Once you are satisfied with your graph, you will also want to assign the graph an angle (like everything else, expressed as a hex value). This value dictates how sonic will react when he touches its surface, how or if he will roll down it, or to quote the documentation;
|“||A value of 0xFF is used for flat ground, but otherwise, all angles MUST be even values. The range of 360 degrees is represented by values between 0x00 and 0xFF (256 values), with 0xFF being 359 degrees, 0x00 being 0, and 0x40 being 90. Values starting at 0x00 and rising are used starting at the bottom of a circle and moving clockwise (left-side slopes use values between 0x00 and 0x3F from bottom-up, right side are 0xFF to 0xC0 from bottom-up).||„|
— SonED2 Documentation
I opted to use angle F8 to create a gentle, right hand slope.
Having created your new graph and assigned it an angle, you should apply it to the block using the same process as before. Assign the solidity to the block in the block menu next to the palette display (which you would have previously set to FF) and configure the block to be “All solid” in both planes (or whichever setting is relevant to your task.) When you hit W or E to display the collision for each path, you should note that the angle of your new solid is displayed over the block. You will need to repeat the process for each new block that does not match an existing solid.
Loops and Path Swappers
Having followed this guide you should now be developing an understanding of how SonED 2 works and should be able to tackle most problems by experimenting with what you know already. Unfortunately, as you may have gathered if you have already tried making a loop by extrapolating the information on slopes, loops are slightly more complicated.
Firstly you will need to ensure that your loop conforms to the solidity graphs already in existence used for making loops, otherwise sonic’s path around the loop will not match the artwork and he may run through some scenery, an undesirable consequence. To this end, when creating my first loop I used a circle template which I based of exported art from other loops. To avoid problems, it is worth ensuring that your loop art is consistent with the template.
Now, I am aware that loops are not always the same perfect circle, and might have differing entry and exit points, but we will use this symetrical circle to guide you through the principle of inserting a loop via SonED2. If you were to try and create your own solidity graphs for this circle you would note that they would strongly resemble solidity graphs 49 through to 52, 4D being the turning point. These should correspond with the bottom right chunk of your loop, and assigning to them to the block is as straightforward as with all the other collision we have covered so far. For simplicity sake, I am going to assume at this point that you are using symetrical art for the loop, (if you are using more diverse art for your loop, you can still follow, you will simply have to insert each of your four chunks of the loop as a bottom right corner piece, and use the relevant piece at the relevant time.
In order to assign collision information to the other angles of the loops, you are going to need to select the curve, a block at a time, by double right clicking, and then pasting the block into its equivalent place in the next chunk. Initially, I would recommend creating the bottom left hand chunk of the circle. Taking the first block, the one using angle FC, you should select the bottom left hand chunk in the chunk selector, and paste your selected block in its equivelant place. Next you need to manipulate the draw direction using the M+J keys, or the small arrows above the chunk window, until your art is facing the right direction.
Having repeated the process to build up a full loop, you should set the paths accordingly so that sonic enters the loop using the first path, and exits on the second path. Once you’ve done this a few times you can get a little more creative with your loops, but initially you will just want to use W and E to check that your paths are working correctly.
Again, you may have jumped the gun, and built this incarnation of your loop to check that it works. Unfortunately you will find that you are able to successfully traverse the first half of the loop, but you will notice that you do not change paths at the mid-point of the circle, and therefore, cannot complete the loop. In order to tell the game that Sonic is supposed to swap paths at a point in the loop you will have to use the object editor window of SonED to place a path swapper. At this point, your guess is as good as mine, as I have so far had limited success with path swappers, as there seems to be a lack of documentation on the subject available. Through trial and error, I have found a combination of path swappers that seems to work, although it has brought inconsistent results. Open the object window by hitting O in SonED2 and double left-click to create an object (double right-click deletes said object.) A further double click on the object will bring up a list of objects from which you want to select “path swapper” which is option number 3. Now hovering over the object, you will see a multitude of information appear in the tope left hand corner of the screen. We are interested in the Object Type ID, which should currently read 03 00 00. ( You should not that other objects placed in the area may well interfere with the path swappers, particularly if the object debris from a previous level is lingering. You should clear away this mess for best results.) Use the S and X keys to modify the second digit to 10, and place this swapper at the top of the loop as shown in the above picture. This swapper appears to change the path from the first to the second (although I can only guess at what else, or under what conditions). You will also need to place a swapper at the exit of the loop, so that Sonic is placed back into the first path an is able to use any subsequent loops. I have been using 03 11 00 for this purpose, although again, this comes with mixed results, primarily, Sonic often fails to run back through the loop, although he is capable of using the entrance to the next one (ie, they work forwards, but not backwards). You will probably want to open other levels in SonED and see how they work to gain a better understanding of path swappers. I am eager for someone to correct me on this issue.
That brings me to the end of this guide. There are, undoubtedly more things you can do with SonED2, these are just the bare basics. I have tried to be as clear as possible, and hopefully it might help out a few of those who are struggling with level editing, and encourage a few moar to try.