Selbi's Parallax Editor

Discussion in 'Engineering & Reverse Engineering' started by Selbi, May 24, 2011.

  1. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    This was actually started up as a tiny gag MarkeyJester and I had in the IRC. Neither of us ever expected it to turn into a real project, but now it is here and ready for duty! The greatest problem of this problem wasn't generating the actual code or creating that preview window, no, finding the perfect way to design a program like this, that is the real deal.
    *Insert huge wall of text, explaining the rest of the history of this program, nobody cares about.*

    That said, here's your download:
    <a href="http://selbi.hapisan.com/ParallaxEditor-v1.0.zip" target="_blank"><span style="font-size:14pt;line-height:100%">Download<!--sizec--></span><!--/sizec--></a>
    Updated DLL (recommended!)

    Along with a screenshot:
    [​IMG]


    The usage should be somewhat self-explainority, which is why I don't feel a step-by-step tutorial should be necessary (if you have trouble with it though, just hit me up on IRC; I'm always online in #ssrg). For a teeny-tiny FAQ look at the ASM boxes below.

    To-Do List for upcoming versions:
    - Implenting support for absolute deformation.
    - Adding more speeds so you can create much smoother movement with multiple blocks. 17 possibilities is not enough, considering most of them are way too fast/slow.
    - Making the S2LVL project loader being able to load Sonic 1 levels.
    - Fixing any bugs and issues this program hid from me.

    Special Thanks:
    - MainMemory, for providing the two DLLs, making my life a lot easier and also for a lot of VB.NET related tips.
    - MarkeyJester, for providing additional information (optimizing, etc.).
    <span style='color:#000000;background:#000000'><span style="font-size:8pt;line-height:100%">- Oerg866, for being a dick. No seriously, you are a dick Oerg and you've once again proven that you can't even change your arrogant and patronizing attitude within a timespan of almost three years. Leck mich, du Penner.<!--sizec--></span><!--/sizec--></span>

    -----------------------------------------------------------------------------------------------

    Where to put the code:

    During private testing, one major problem pretty much all people who were unfamiliar with deformation had, was that they didn't know where to put this code. So here I will explain where that location is:

    In the deformation routine of your choice, locate this line:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #adadad; font-style: italic;">; For Sonic 1:</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF70C</span><span style="">)</span>.<span style="color: #00bfff;">w</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF618</span><span style="">)</span>.<span style="color: #00bfff;">w</span>
     
    <span style="color: #adadad; font-style: italic;">; For Sonic 2:</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFEE0C</span><span style="">)</span>.<span style="color: #00bfff;">w</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF618</span><span style="">)</span>.<span style="color: #00bfff;">w</span></pre><!--gc2--><!--CTsgRm9yIFNvbmljIDE6CgkJbW92ZS53CSgmIzAzNjtGRkZGRjcwQykudywoJiMwMzY7RkZGRkY2MTgp
    LncKCgk7IEZvciBTb25pYyAyOgoJCW1vdmUudwkoJiMwMzY7RkZGRkVFMEMpLncsKCYjMDM2O0ZGRkZGN
    jE4KS53--><!--egc2--><!--g2--></div><!--eg2-->
    And remove everything below that line all the way up to the end of the routine (except for the rts of course). Put your generated code in that location you just deleted.


    How to lock the background vertically in place:

    Due to the current status of this program, being unable to create absolute deformation, moving up/down will make the screen go apeshit in 90% of all cases. It is therefore advised, until a proper function has been implented (which will happen as soon as possible, don't worry), to lock the background vertically in place.

    To do so, once again locate this line:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #adadad; font-style: italic;">; For Sonic 1:</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF70C</span><span style="">)</span>.<span style="color: #00bfff;">w</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF618</span><span style="">)</span>.<span style="color: #00bfff;">w</span>
     
    <span style="color: #adadad; font-style: italic;">; For Sonic 2:</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFEE0C</span><span style="">)</span>.<span style="color: #00bfff;">w</span>,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF618</span><span style="">)</span>.<span style="color: #00bfff;">w</span></pre><!--gc2--><!--CTsgRm9yIFNvbmljIDE6CgkJbW92ZS53CSgmIzAzNjtGRkZGRjcwQykudywoJiMwMzY7RkZGRkY2MTgp
    LncKCgk7IEZvciBTb25pYyAyOgoJCW1vdmUudwkoJiMwMzY7RkZGRkVFMEMpLncsKCYjMDM2O0ZGRkZGN
    jE4KS53--><!--egc2--><!--g2--></div><!--eg2-->
    And put the following line right above it:
    <!--g1--><div class='geshitop'>Syntax Highlighted Code: ASM</div><div class='codemain'><!--eg1--><pre class="asm" style="font-family:monospace;"> <span style="color: #adadad; font-style: italic;">; For Sonic 1:</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span>xxxx,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFF70C</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; lock the background vertically in place</span>
     
    <span style="color: #adadad; font-style: italic;">; For Sonic 2:</span>
    <span style="color: #00bfff;">move</span>.<span style="color: #00bfff;">w</span> <span style="color: #ff0000;">#</span><span style="color: #ff0000;">$</span>xxxx,<span style="">(</span><span style="color: #ff0000;">$</span><span style="color: #ff0000;">FFFFEE0C</span><span style="">)</span>.<span style="color: #00bfff;">w</span> <span style="color: #adadad; font-style: italic;">; lock the background vertically in place</span></pre><!--gc2--><!--CTsgRm9yIFNvbmljIDE6CgkJbW92ZS53CSMmIzAzNjt4eHh4LCgmIzAzNjtGRkZGRjcwQykudwk7IGxv
    Y2sgdGhlIGJhY2tncm91bmQgdmVydGljYWxseSBpbiBwbGFjZQoKCTsgRm9yIFNvbmljIDI6CgkJbW92Z
    S53CSMmIzAzNjt4eHh4LCgmIzAzNjtGRkZGRUUwQykudwk7IGxvY2sgdGhlIGJhY2tncm91bmQgdmVydG
    ljYWxseSBpbiBwbGFjZQ==--><!--egc2--><!--g2--></div><!--eg2-->
    The $xxxx has to be replaced with whatever location you want the background to be at. For references you can use SonED2. One chunk has a size of $100, so if you want the background to start at chunk 3 from the top, you put in $300.

    -----------------------------------------------------------------------------------------------

    Just one final thing I'd like to hint out: See you in 10 more posts, when I reach my 1000. =P
     
  2. FeliciaVal

    FeliciaVal

    Member
    thank you very much for this, Selbi :) now I'll have to deal with it a bit, so maybe I can start making custom backgrounds for my hacks. But im not sure or maybe I didn't read it well...
    does this works with the S1 2005 Hivebrain dissassembly?
     
  3. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    Not only it does work with the 2005 disassembly, but also is this the main disassembly you should use for this program. =P
     
  4. FeliciaVal

    FeliciaVal

    Member
    <!--quoteo(post=589567:date=May 25 2011, 11:32 AM:name=Selbi)--><div class='quotetop'>QUOTE (Selbi @ May 25 2011, 11:32 AM) <a href="index.php?act=findpost&pid=589567">[​IMG]</a></div><div class='quotemain'><!--quotec-->Not only it does work with the 2005 disassembly, but also is this the main disassembly you should use for this program. =P<!--QuoteEnd--></div><!--QuoteEEnd-->
    ok, thank you very much :D I'll try using it around
     
  5. Alriightyman

    Alriightyman

    I am back... from the dead! Tech Member
    354
    3
    18
    Largo, FL
    0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
    Hey this is very cool! I actually think this would be a great tool for learning how BG scrolling actually works! Being able to add little tweeks here and there and see how the code changes is very cool. Great job! :thumbsup:
     
  6. LOst

    LOst

    Tech Member
    4,889
    1
    16
    I had this idea myself way back in 2005. I couldn't do it because I wanted so much more, like support for Sonic 3's fake scrolling, which needs, just like the parralax scrolling, fixed point multiplication and division optimized with bitshifts and addition/subtraction. The task was too great then, and is too great now.
    The scrolling programming requires a human brain optimation in the end. The result is so much better then. No editor can replace that.

    If you have succeeded, I may congratulate you now!
     
  7. Shoemanbundy

    Shoemanbundy

    Researcher
    1,071
    14
    18
    Chicago, Illinois
    selling shoes
    This is something that I wanted forever, it's great to see programs for individual tasks such as this still make it out there. :)
     
  8. Flygon

    Flygon

    Member
    I longed for this sort of application years ago. I am so happy to see one finally made. Great job!
     
  9. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    <!--quoteo(post=590165:date=May 29 2011, 02:46 AM:name=LOst)--><div class='quotetop'>QUOTE (LOst @ May 29 2011, 02:46 AM) <a href="index.php?act=findpost&pid=590165">[​IMG]</a></div><div class='quotemain'><!--quotec-->I had this idea myself way back in 2005. I couldn't do it because I wanted so much more, like support for Sonic 3's fake scrolling, which needs, just like the parralax scrolling, fixed point multiplication and division optimized with bitshifts and addition/subtraction. The task was too great then, and is too great now.
    The scrolling programming requires a human brain optimation in the end. The result is so much better then. No editor can replace that.

    If you have succeeded, I may congratulate you now!<!--QuoteEnd--></div><!--QuoteEEnd-->
    I know excactly what you mean and I also feel like this is the reason why this program will never be able to do generate "real" parallax scrolling code or anything to make smooth fixed point multiplication related parallax. While it is possible of course, you will need to do a lot in order to generate perfect code. So, if at all, fixed point multiplication will be very limited. But I will probably only use simple bit shifting and multiplying/dividing only, though.

    But this program wasn't meant to be a full human replace anyway, but rather a very, very basic tool for beginners, creating simple background deformation for simple background art to give a hack an additional touch and make at least a little nicer. "Powerful" deformation will always be limited to experienced people only.
     
  10. Rika Chou

    Rika Chou

    Tech Member
    5,271
    162
    43
    While this is limited in what it can do, it will still be very nice to see hacks using new deformation.

    So maybe we will see less hacks using non moving backgrounds, or using existing deformation that does not suit the new level.
     
  11. Eduardo Knuckles

    Eduardo Knuckles

    Not a loved one, but the most hated person. Misfit
    414
    9
    18
    Someplace somewhere
    Project S.A.M.G.
    Hey, Selbi. There's one information for you to add to the topic.
    I had problems when I tried to apply my custom deformation code made by this program, but all I've got was a completely locked bg. In the start of my deformation code, after some tries making it over other deforms I got the same problem. I fixed it by change the first ScrollBlock2 into ScrollBlock1. I also suggest other people for make the same fix when having this same problem.

    ~ Thanks for the tool, wich is being a lot useful for me. Also thanks DeoxysKyogre for the patience on help me fixing this tiny problem.
     
  12. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    So, I've been recently asked to work on this program again. It was the only person to have such a request in a long time, and I was about to ignore it, but then, I realized, that it would've been better, if I asked the forum.

    And so, ignoring my horrible sense of tenses in grammar right now, I'm gonna ask you, Retro: Do you want me to work on this program again?

    If the outcome is going to very low, and I have a bad feeling that this will be excactly the case, then I'm not going to do it. You see, I'm not gonna "waste" my time on something only very few people use (no offense to anyone).
     
  13. theocas

    theocas

    Tech Member
    346
    0
    16
    What would be really neat is some sort of drop-down menu that lets you choose some presets for parallax, like the grass in EHZ, the water in GHZ, moving clouds, etc. For example, if you choose the "Water Preset" you'd give it the start Y and the end Y of the water, and it'd do everything else automagically. The choosing of the water could be done on the image using two little 'knobs' that highlight the region.

    That'd be an awesome way to save some time if you use this program a lot, as well as maybe user-definable presets.
     
  14. Rika Chou

    Rika Chou

    Tech Member
    5,271
    162
    43
    I think you should continue work on this. It's really a great tool. If you are able to add more complex and taller backgrounds, I'm sure this will be helpful to a lot of people.
     
  15. Flygon

    Flygon

    Member
    I think continued development of this tool would be grand. Parallax backgrounds really do bring out more from the background.
     
  16. MKAmeX

    MKAmeX

    Member
    279
    0
    16
    California
    Needlemouse, Sonic Boom, Graphic Design
    As I told you on irc once, although I have yet to actually get around to using it, I will definitely abuse it once I do.

    So yeah, I'm with everyone else and you should definitely work on it more if you're up to it. =)
     
  17. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    9
    18
    United Kingdom
    YouTuber
    I think the continuation of this program would be excellent. I just tried it out and it is pretty neat, but seeming as it has it's limits in time, I don't have a use for it. For example, my background is way more than 224 vertical pixels, and that is all. So when I load a project file, it seems I can edit the clouds, but not the mountains I have below and then the hedge I have underneath that, etc. Or is there a way of doing that and I'm being blind?
     
  18. Selbi

    Selbi

    The Euphonic Mess Member
    1,485
    10
    18
    Northern Germany
    Sonic ERaZor
    That's the entire point, if you would've read my first post in detail. =P

    Right now, you can only do what I call "relative parallax" (no idea if there is any real term for it anyway, so please excuse my stupidity if yes). This sort of parallax scrolling modifyes the background positions regardless of your vertical camera position. "Absolute parallax" on the other hand, loads information from an array, based on the camera position, to give more freedom for larger backgrounds. The downsides are, however, that this is much more complex to program, and also has some size limits.

    But seeing that at least some people are interested, I really should consider working on this program again. After all, there isn't really anything else I'm interested into anyway.
     
  19. flamewing

    flamewing

    Emerald Hunter Tech Member
    1,153
    37
    28
    France
    Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
    I would also say to go for it. Programming optimized fixed point multiplication should not be that hard -- you would just have a few lookup tables -- just annoying and boring.
     
  20. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    9
    18
    United Kingdom
    YouTuber
    Because of it's limits, it may explain people's lack of interest. If you can program it to be more advance, and keep updating it, this can be big, a will get a hell of a lot more people interested.

    Right now, I won't be using it, as like you said, it only has a certain height you can edit and only scrolls when Sonic moves and no vertical scrolling, etc. Once it becomes more advance, I wouldn't be able to thank you enough.