Loops, Pathswappers, and how to get laid

Discussion in 'Engineering & Reverse Engineering' started by Tidbit, Apr 5, 2010.

Thread Status:
Not open for further replies.
  1. Tidbit

    Tidbit

    Member
    <img src="http://img263.imageshack.us/img263/3748/loops.png" border="0" class="linked-image" />

    Okay I've been wanting to do this for a while now. Every body know how frustrating each one of those 3 things are. This will be the Sonic Hackers guide to life. As shown above, I Tidbit will be discussing three things in this topic. Im making this guide for the newbies and the oldbies to hacking because lets face it, Path Swappers are little vertical and horizontal spawns of satan.

    Loops the classic sonic stapple and how to make one.
    Path swappers, how to use and read them.
    And how to get laid, you'll never fail with my secret.


    <!--sizeo:6--><span style="font-size:24pt;line-height:100%"><!--/sizeo-->=Loops=
    <!--sizec--></span><!--/sizec--><!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->Okay, every Sonic fan knows what a loop is, they're like rings. Its an essencial part of the Sonic series and they never get old no matter how many times you go through one you never get tired of it.

    Okay Loops, when you get down to it are really rather simple. The only annoying part is spriting them, unless you do what I did and import loop chunks, which I wont be going into just because theres an excellent guide somewhere else on retro about importing art. Sadly I forget who wrote it, but I do know its on the wiki.

    <!--sizec--></span><!--/sizec--><!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->-Drawing loops and Solidity-
    <!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->Okay before you dive into the world of spriting loops you have to choose which solidity pieces you'll be using for each block.
    In this guide we'll be using solidity 10 - 1E. You can use other types of solids that form a loop, but we'll be using this set because its the one I am currently using for my hack.
    Assuming that you have SonED2 up goto the tile editor and select a new tile. Now Before you start drawing, click on the "SOLID SELECT" text which is right next to the tile drawing box. upon clicking on it, the left side of your screen will be filled with all the woderful solids that you can use. Find the one marked 10 and right below your block window there is some more wonderful text that says "Solids", click on both of the numbers and they should go from 00 00 to 10 10.
    Theres just one more thing to do before you can draw. I always find this helpful because I don't like having to go over tiles and edit them after drawing them. where it says SOLID SELECT, there sould be an option saying Show Block, click on it. Now you should be seeing the white solid with a clear background. Now when ever you add tiles your block, you will be able to see if you drew the solid correctly.
    After you draw all of the right facing blocks, don't make any more that are facing different directions. Why? Because when you make the chunks you can rotate them then instead of wasting alot of precious block space. You'll only need four chunks for your loop. Okay after you make them, the loops still aren't ready for your level just yet.

    <!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->-In Game Chunk Solidity-
    <!--sizec--></span><!--/sizec-->In game chunk solidity isn't exactly the same as the solidity that you applied to your block pieces. Its pretty much what turns on the block solidity, and is applied to each block in the chunk. You change this attribute right here:
    <img src="http://img519.imageshack.us/img519/6707/guidechunksolidity.png" border="0" class="linked-image" />
    There are 4 selections you can choose:

    - Not Solid : What is says Sonic will fall right through this block.
    - All Solid : No matter what direction Sonic makes contact with the block, he wont be able to go through it.
    - Top Solid : You can jump through the bottom of the block and when you land, it will be solid.
    - L/R/B Sold : If <!--sizec--></span><!--/sizec--><!--sizec--></span><!--/sizec-->collide from the left, right, or bottom of the block, you can't pass.
    <!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo--><!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->

    We will only be using two types of in game chunk solidity: Not Solid, and All Solid.
    Now you'll notice that there are two little attributes that you can change for each block. These correspond to what layer will have the attribute you selected. The first one is for Path 0 and the second one is for Path 1 (I'll talk about paths later). Sonic starts off on the low layer. Okay now for each block on the chunk that faces the left make the first attribute: ALL SOLID,and the second one NOT SOLID. For all the chunks facing the right just do the opposite. So you don't have to select then change and repeat for each block, there are short cut keys:
    G-changes top layer attribute
    H-changed low layer attribute
    So now all you have to do is move your mouse over the block and hit the short cut key you want to use.
    If you want you can push "W" to show all of the solids that you have on. W and E change the layer of solidity that is shown,and Q turns it off. Now when you have this turned on each block becomes color coded depending on what chunk Attribute you have selected.
    There are 3 main colors:
    Dark gray - All Solid
    White - Top Solid
    Yellow - L/R/B Solid
    The Show Solidity option as I call it, is helpful for showing if you placed an incorrect solidity on a block.
    Now, these are only the standard loops you can do, if you play HTZ you'll see some of the other loops you can do with the info I just gave you.



    Ugh...Its time for part 2 *pops some pain killers* okay lets go.
    <!--sizec--></span><!--/sizec--><!--sizec--></span><!--/sizec--><!--sizeo:6--><span style="font-size:24pt;line-height:100%"><!--/sizeo-->=PATH SWAPPERS=
    <!--sizec--></span><!--/sizec--><!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->Path swappers are possibly the most import things when making a level. They are what allow you to do your loops, and a lot of other things like being able to go behind walls so you can access a new path, or even do those double helix things in CPZ. Okay heres a file to <a href="http://forums.sonicretro.org/index.php?showtopic=11090&st=0&p=202171&#entry202171" target="_blank">Download</a> that will change path swappers from ? blocks to 0's and 1's which is a big help when placing them. <!--sizec--></span><!--/sizec--><!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->The only way to truly learn how to use these things is by trial and error.<!--sizec--></span><!--/sizec-->
    <!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->
    There are mainly two types of Path Swappers:
    Normal Path Swappers: Change Both Above high, Below High, and what path Sonic is on.

    Mirrored Path Swappers: These keep sonic on the same path but change whether or not he'll appear above or below something.

    <!--sizeo:5--><span style="font-size:18pt;line-height:100%"><!--/sizeo-->= How to read Path Swappers =<!--sizec--></span><!--/sizec-->

    When placing a Path Swapper there's a small description of each that you've placed. Actually there's a huge on screen description for what ever obj you have selected.

    Most of the descriptions there are self explanatory, but I'll still go over a few of them.
    <!--sizec--></span><!--/sizec--><!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo--><img src="http://img709.imageshack.us/img709/6954/ggggx.png" border="0" class="linked-image" /><!--sizec--></span><!--/sizec-->
    <!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->Object Type ID: Tells the Objects Game ID and type of it (<!--sizec--></span><!--/sizec--><!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->Object Types are basically what tells how the object to act, or to change an attribute.<!--sizec--></span><!--/sizec--><!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->)
    Param field 2-4 : These fields tells what path he will be placed on.
    Param field 4-5 : Whether you will be placed Above high or Below high.
    Now to get the change the second set of digits in the Object Type ID, you use the keys X and S.
    X - changes number by 1's.
    S - changes number by 1's.
    Hold crtl to change the values by 10's.

    <!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->== Above high, Below High and paths ==<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->
    Now you'll notice near the bottom of the descriptions you see some other field param's. FP's 5 and 6 state if sonic will be placed above or below blocks, but this only matters if you've changed the High Low option on your block in the tile editor.

    Now your probably wondering what paths are. Paths are basically what they say they are. They are what makes sonic collide with different chunks. Remember when you were making your loop? And there were the options to change to type of solid for each block, well like I said in the beginning, those correspond to the paths that sonic can be on and blocks he can collide with.

    <!--sizeo:4--><span style="font-size:14pt;line-height:100%"><!--/sizeo-->== Setting up Path Swappers ==<!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->
    Okay now that I've hopefully cleared that up enough, we're going to learn how to set up Path Swappers for your loops.

    Okay now you'll notice in the picture above, that each path swapper has two digits. and each digit can either be a 0 or a 1 or both. These numbers describe what plane sonic will be moving to.
    For example Path Swapper 10 basically says: Path1 -> Path0.
    This is why I went over paths, because this is where you need to know what path sonic is one when he touches a Path Swapper.
    Okay now reference back to my picture again. I am using two Path Swappers. One at the Middle, and the End. Since sonic start off on path 0 you want the Path swappers to be something like this:
    01, 10
    <!--sizec--></span><!--/sizec--><!--sizec--></span><!--/sizec-->Now you might be thinking why would the first Path Swapper be Path1 to Path0? this is in case your on path 1 and try to enter, you'll still be able to, if you don't have a Path Swapper like 10 you may not be able to enter all the time.
    <!--sizec--></span><!--/sizec--><!--sizec--></span><!--/sizec-->To be honest, Path swappers are extremely easy. You just need to keep in mind a few things:
    -What Path Sonic is on and starts on (Sonic Starts the level on path0)
    -Is your loop moving Sonic to the correct path?
    -Am I reading the Path Swapper Description with Sonic's current path in mind?
    You remember those things and you should be fine, but if your loop doesn't always work, take your time and go over the Path Swappers again, you'll fix it.

    <!--sizeo:6--><span style="font-size:24pt;line-height:100%"><!--/sizeo-->=Getting Laid=
    <!--sizec--></span><!--/sizec-->Oh ho ho ho yes. This is probably what most of you read this little guide for and for good reason too!
    My secret has never failed and will allow all you guys and gals to click heels on a dime. There is only one step and it is not showering with old spice or some how managing to make diamonds spring forth from your palm.

    The only step is..........To......Give.....a.....








    .....Tidbit.





    <!--sizec--></span><!--/sizec--><!--sizeo:6--><span style="font-size:24pt;line-height:100%"><!--/sizeo-->=Final Notes=
    <!--sizec--></span><!--/sizec--><!--sizeo:2--><span style="font-size:10pt;line-height:100%"><!--/sizeo-->It took me only about 1 or 2 hours to make this guide, and its my first one that I've ever written. I hope that it was descriptive enough for you to get the idea without having to ask alot in the future or without having alot of headaches like I've got in the past. If theres any thing missing or spelled wrong please tell me so I can fix it.

    I want to thank also all the people who have helped me edit this guide and make it better!<!--sizec--></span><!--/sizec-->
     
  2. DigitalDuck

    DigitalDuck

    Arriving four years late. Member
    4,778
    3
    18
    Lincs, UK
    TurBoa, S1RL
    <img src="http://i42.tinypic.com/zkk49j.png" border="0" class="linked-image" />

    I have been enlightened.

    No, but seriously, this is a good guide. You state everything clearly and concisely. Good job! :thumbsup:
     
  3. Tidbit

    Tidbit

    Member
    Thanks Digital, im glad you liked it.
     
  4. Ayla

    Ayla

    I shat on your desk ^^ Oldbie
    1,760
    0
    0
    West Linn, OR
    Hacking Contest, StH Overlooked, Personal Indie game
    This, as of yet, has been the best contribution you've made to this community. It has made me happy watching you gradually sharpen your skills. =)
     
  5. Thorn

    Thorn

    Tech Member
    328
    0
    16
    Home
    Sonic 2 Retro Remix
    Might I mention a few things for fixing, at least in the path swapper bit...

    First, a minor thing: your description of how to edit the subtype of a path swapper is a bit off. X and S both edit the value by one, just in different directions. Holding Ctrl while hitting these keys edits the value by 10.

    Another minor thing: your picture there has a pretty clear mistake that might not affect your art, but may affect the art of others or even the original game: you have the player going into high plane for a bit when passing through the loop to the right, but not to the left.

    Now, the big issue: your guide admits that you're only using certain loops "because [you] know the PathSwapper Combo for them." As you admit, if you look at levels from Sonic 2, your particular combination won't get the job done every time. Don't guess and check path swapper combinations, or you'll go insane trying both to figure them out and memorizing them per zone. I always tell people to run their finger along the path on screen and to use the Q, W, and E keys to show the different collision planes as your finger hits the appropriate path swappers. This can be combined with the Y and U keys to show how high plane (yellow) and low plane (red) placement works and when to use each. Instead of re-hosting my path swapper visuals, you might have benefited more from reading and linking to <a href="http://forums.sonicretro.org/index.php?showtopic=11090&st=0&p=202171&#entry202171" target="_blank">my original post</a>, which tells you about the low and high plane distinction and makes a note that mirrored path swappers don't work the same way.

    It's cool that you're making a guide on the hardest part of Sonic 2 level design; I'd love to see more Sonic 2 hacks instead of assuming that all questions in the Basic Questions thread are for Sonic 1 if not specified. But the guide you have up now is highly situational and might frustrate people when they move on from the first level, Emerald Hill (where you path swapper combo works), to the incredibly complex second level, Chemical Plant (where it doesn't, and where mirrored path swappers come into play). I think you could stand to cover a lot more scenarios than just your custom loop in this guide. I'm going to sleep right now, so if I've said anything stupid, presumptive, or incorrect from reading your guide half-asleep, you can call me on it and I'll check it out tomorrow afternoon.
     
  6. Tidbit

    Tidbit

    Member
    Thanks for your input Thorn the guide will undergo some editing as soon as this post is finished. About your comment about my path swappers, Im not to sure about what your saying about how sonic doesn't stay on the high plane for long when coming from the left. and well thats because if e stayed on the high plane, he wouldn't be able to go the the right part of the loop. Sonic has to be moved from high to low, for it to work. If im wrong, which I probably am because 03 91 works on both sides as well, then please point it out.
     
  7. Ell678

    Ell678

    Am I Annoying You? Member
    2,345
    1
    18
    Barrow, England
    Sonic Incursion
    While I'm not hacking Sonic 2 at the moment, if I ever do, I will use this. Good contribution!
     
  8. amphobius

    amphobius

    where are the japanese shaman girls, lintahlo? Member
    I'll elaborate on the L/R/B solid, since your explaination is a bit off. It might also help you, in the long run, too. :P

    L/R/B solid basically means that if you collide from the left, right, or bottom of the block, you can't pass. However, you can fall through the bottom of the block. A good example of good use of this solid is in an ingame cutscene—Sonic is standing on an invisible object, then Knuckles/Eggman/Whoever comes along, flicks a switch, and the invisible object is then deleted. Sonic will then fall down a chunk, with L/R/B solids enabled on the bottom, so Sonic can't come back up. <strike>also credit me if you use that idea in a hack</strike>

    Anyway, you definately <b>don't</b> want to give people the wrong idea when it comes to these kind of things, so here I am, being the magical and kind Dalek I am. :)
     
  9. Tidbit

    Tidbit

    Member
    Thanks and changed it.
     
  10. Thorn

    Thorn

    Tech Member
    328
    0
    16
    Home
    Sonic 2 Retro Remix
    <!--quoteo(post=437833:date=Apr 5 2010, 10:33 AM:name=Tidbit)--><div class='quotetop'>QUOTE (Tidbit @ Apr 5 2010, 10:33 AM) <a href="index.php?act=findpost&pid=437833"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->Thanks for your input Thorn the guide will undergo some editing as soon as this post is finished. About your comment about my path swappers, Im not to sure about what your saying about how sonic doesn't stay on the high plane for long when coming from the left. and well thats because if e stayed on the high plane, he wouldn't be able to go the the right part of the loop. Sonic has to be moved from high to low, for it to work. If im wrong, which I probably am because 03 91 works on both sides as well, then please point it out.<!--QuoteEnd--></div><!--QuoteEEnd-->
    This is going to be wordy... brace yourself and don't tl;dr if you plan to fix your tutorial.

    It sounds to be like you think "high and low planes" and "planes 0 and 1" mean the same thing, when they don't. There are two different planes to consider: a plane for art, and a plane for collision. In that sense, "high and low planes" are misnomers, because if you look at the corresponding equate in the 2007 Sonic 2 disassembly, you'll see it called art "priority", which makes much more sense. Being put in high plane (passing through yellow numbers) means that the character will be drawn as if they're always as far in the foreground as possible. In low plane, Sonic will be drawn behind any tile marked as high plane. While on the topic of what pathswappers mean, notice that if you have a subtype of 80 or greater, the player has to be walking/running/rolling on a surface for the swap to occur -- you want these at the tops of loops to prevent the player from simply jumping all the way around.

    There are two errors in your picture. The first is the way you've drawn the loop: the grass is in the foreground on both sides of the loop. This means that as drawn, without considering collision, Sonic could theoretically walk in front of the loop without running around it. This is why low and high planes don't mean squat to you right now: if the loop tiles are low plane, then any player art priority looks right no matter what, when in the actual game, you'll either want to always use low plane or to switch from low to high or vice versa when appropriate.

    The second error occurs if we imagine that the first error is fixed. Given your path swappers, the player will always be low priority when going clockwise around the loop, but will be high plane going the other direction. Since half of the grass underneath your loop is "behind" other tiles in our imagined fix, you're going to create the illusion that when in high plane, Sonic can run right in front of a solid wall, floating in midair as he passes. You don't want that; you want to give the impression that he's running behind the wall on ground that the player simply can't see.

    <div align='center'><img src="http://img714.imageshack.us/img714/9839/sh000000.png" border="0" class="linked-image" /></div>

    Here a loop from Cascade Valley 1 in <a href="http://info.sonicretro.org/Sonic 2 Retro Remix" target="_blank" style="background: url(http://info.sonicretro.org/images/5/50/Reticon.png) right no-repeat; padding-right: 20px; border-bottom: 1px dotted #3366BB; color: #3366BB; cursor:pointer; text-decoration:none;" class="wiki">Sonic 2 Retro Remix</a> that uses both collision plane swapping and art priority swapping for both a loop and a path passing through it. I'll walk you through how the lower, looping path works. Since I'm using the same tiles for the "back" of the loop that I am for the "front", I've set them to high plane so that you can pass behind them when necessary. Because of this, the player is put in high plane so that the high plane tiles don't mask him as he runs through the front, and he's set into plane 0 because that's the plane I chose to use for the collision in the front (in short, he's in plane 0 high). Notice that as the player runs up the right side of the loop, he's still in high plane, so the loop is drawn such that the side passes in front of the path rather than behind. At the top of the loop, the player switches to plane 1 low for the collision on the back of the loop. The path is drawn in front of the loop this time, and since the player is in low plane he will pass behind it, now running on the back of the loop. When he reaches the bottom he's still in low plane, so he exits behind the front of the loop, hence why no grass is seen connecting the back of the loop to the ground afterwards. After the loop is traversed, one last path swapper puts the player in the same art priority and collision plane as he was before the loop. You can try detailing the player's traversal of the loop from right to left on your own, and you can also trace the player's priority and collision plane on the path through the loop in both directions.

    tl;dr Your tutorial is incorrect in some places and otherwise vague. I want to make a video tutorial someday on Sonic 2 level design, since <I>reading</I> this stuff is a lot harder than <I>watching</I> it.
     
  11. iojnekns

    iojnekns

    trouble keeps you runnin' faster Member
    148
    0
    0
    <!--quoteo(post=437956:date=Apr 5 2010, 09:14 PM:name=Thorn)--><div class='quotetop'>QUOTE (Thorn @ Apr 5 2010, 09:14 PM) <a href="index.php?act=findpost&pid=437956"><img src="public/style_images/retro/snapback.png"></a></div><div class='quotemain'><!--quotec-->It sounds to be like you think "high and low planes" and "planes 0 and 1" mean the same thing, when they don't. There are two different planes to consider: a plane for art, and a plane for collision. In that sense, "high and low planes" are misnomers, because if you look at the corresponding equate in the 2007 Sonic 2 disassembly, you'll see it called art "priority", which makes much more sense.<!--QuoteEnd--></div><!--QuoteEEnd-->

    The most common way I've seen people make this distinction is by referring to the collision as <I>PATH</I> 1 and <I>PATH</I> 0, for the collision toggled with W and E. The foreground and background areas accessed with L and P I understood to be PLANE A and PLANE B. Then additionally, each tile within a block can be given HIGH or LOW priority. I know you know all this, Thorn, I'm simply pointing it out for the benefit of Tidbit, since it can feel confusing when referring to paths and priorities as planes and not even being sure which of the three you mean.

    Tidbit, I think that this guide was very well written, had an entertaining, friendly tone and did a good job of communicating information which is difficult to grasp for the uninitiated. Unfortunately, the only minor niggle for me, is that I'm not totally convinced you have a perfect grasp of pathswappers yourself... yet. If you're anything like me, you'll re-read this in a month and realise how much more you've learnt, despite thinking you knew it all.

    Your comment about "knowing the right pathswapper combo," in particular, is a little weird. I advise you to take Thorn's absolutely golden advice -

    "I always tell people to run their finger along the path on screen and to use the Q, W, and E keys to show the different collision planes as your finger hits the appropriate path swappers. This can be combined with the Y and U keys to show how high plane (yellow) and low plane (red) placement works and when to use each. "

    Personally, I always set my foreground zone art to be entirely in the HIGH priority, unless there is a piece of terrain that is a special case. Then I can say to myself "should sonic show in front of this art or behind it?" and "should he be in path 0 or path 1?" Then, with Thorn's pathswapper object definitions, it is an absolutely trivial case of selecting a pathswapper that puts Sonic where you need him to be for that section. To be thinking of them as learning combos for different scenarios is definitely a little off.
     
  12. Tidbit

    Tidbit

    Member
    I thank both of you alot for your advice, and what you said about the high low plane stuff, is exactly what I thought. Also the information about the path swapper combo was something I had wrote in when I first made the guide, I know now that its incorrect and will remove it. Also thanks for the advice about setting all the blocks to High as it is a golden idea.
     
Thread Status:
Not open for further replies.