"Multi-Layered" Parallax in Sonic 1?

Discussion in 'Engineering & Reverse Engineering' started by BlackHole, Jun 23, 2009.

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

    BlackHole

    You're going to need MORE than help. Member
    3,842
    177
    43
    England
    Sprites for Cybernetic Outbreak
    I've been wondering this since I played Sonic 3's Carnival Night Zone, where in the background you can clearly see buildings overlapping other, more distant, buildings. This made me wonder if that effect can be created in Sonic 1, seeing as Sonic and Knuckles, of which a disassembly exists, also does it, or if the Sonic 1 engine can not handle it. I'm no good with the technical side of things, so I cannot try it personally.

    The reason I call it multi-layered is because it looks as though it uses more then one layer.
     
  2. Rika Chou

    Rika Chou

    Tech Member
    5,271
    162
    43
    HTZ in S2 has the same effect. I'm sure it could be done in S1 if you know ASM well enough.
     
  3. Sik

    Sik

    Sik is pronounced as "seek", not as "sick". Tech Member
    6,719
    0
    0
    being an asshole =P
    You certainly can do it. What the game does is just changing the tile graphics as the scroll moves. Mushroom Hill and the gumball bonus stages also have this effect.
     
  4. muteKi

    muteKi

    Fuck it Member
    7,614
    20
    18
    <!--quoteo(post=322440:date=Jun 23 2009, 12:54 PM:name=Sik)--><div class='quotetop'>QUOTE (Sik @ Jun 23 2009, 12:54 PM) <a href="index.php?act=findpost&pid=322440">[​IMG]</a></div><div class='quotemain'><!--quotec-->You certainly can do it. What the game does is just changing the tile graphics as the scroll moves. Mushroom Hill and the gumball bonus stages also have this effect.<!--QuoteEnd--></div><!--QuoteEEnd-->

    In other words it's an animated pattern, much like the oil in Oil Ocean or the tubes in Metropolis -- actually it's more like the backgrounds in some of the later levels of Headdy which have a similar effect that isn't based on horizontal position.

    Actually pretty much all the stages in S3K have the effect somewhere.
     
  5. saxman

    saxman

    Oldbie Tech Member
    If you take a look at Hill Top, you'll see that the section that scrolls "behind" the big mountain tops actually just wraps around itself. Every pixel that disappears from the left side will reappear on the right. It's arithmetic they do that draws it differently depending on the camera position.

    This could absolutely be done in the original Sonic the Hedgehog. Now how to go about doing it is a different question altogether, and it's one I don't have the answer to. But it's definitely possible without a single doubt.
     
  6. MarkeyJester

    MarkeyJester

    A D V A N C E Resident Jester
    2,078
    211
    43
    Japan
    Yes it is 100% possible, just to prove we aren't bullshitting you, here's a small proof of concept:

    <a href="http://www.2shared.com/file/6426136/4f8ed876/s1built.html" target="_blank">http://www.2shared.com/file/6426136/4f8ed876/s1built.html</a>

    Play MZ act 1 please and observe.

    EDIT: Apologies for the messed up graphics, couldn't be bothered to fix it
     
  7. BlackHole

    BlackHole

    You're going to need MORE than help. Member
    3,842
    177
    43
    England
    Sprites for Cybernetic Outbreak
    Nice MarkeyJester. Could you possibly give us common members the code please? Or perhaps you could add it to the wiki, as it would make a rather good addition.
     
  8. MarkeyJester

    MarkeyJester

    A D V A N C E Resident Jester
    2,078
    211
    43
    Japan
    I haven't really decided on whether it's a sacrifice I'm willing to make just yet, I guess you'll have to wait until I'm sure that I wont get my arse kicked for giving out such coding =(
     
  9. BlackHole

    BlackHole

    You're going to need MORE than help. Member
    3,842
    177
    43
    England
    Sprites for Cybernetic Outbreak
    Well, if it could give you an arse kicking, then it doesn't matter. I'll try to figure it out myself, as I can see you used Marble Zone for a reason.
     
  10. MarkeyJester

    MarkeyJester

    A D V A N C E Resident Jester
    2,078
    211
    43
    Japan
    I'll asume you think it's due to the animated tiles in MZ XD, funny enough no, I used MZ because on a blank DisASM I need to sepereate the title screen art and the GHZ art and patch the GHZ arts 1 & 2 together, couldn't be bothered to do all that just to get a point through, so I went for the next zone, however it would be a great place to start, seeing at it already has animated tiles designed for that level, but it will take abit of moding to get it to read the camrea's X position other than a continusly running timer (Edit: TWO continusly running timers if I'm not mistaken), anywho, I'll leave you to it. good luck!
     
  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.
    Definitely awesome!
    I hope can see this code available for us soon. But yeah, this appears be hard to work on in a very detailed background.
    Well, is great to see that this thing is possible.
     
  12. Tets

    Tets

    one rude dude Oldbie
    835
    9
    18
    I always wondered how they faked the parallax scrolling in Sonic 3 and Knuckles. It's actually a lot simpler than I imagined it was.

    Not to derail the topic, but I've also been wondering how the water surface effect is done in Hydrocity and Launch Base, in places where you can see the water surface stretch into the background.
     
  13. nineko

    nineko

    I am the Holy Cat Tech Member
    5,928
    116
    43
    italy
    Tets: <a href="http://forums.sonicretro.org/index.php?s=&showtopic=10880&view=findpost&p=276281" target="_blank">http://forums.sonicretro.org/index.php?s=&...st&p=276281</a>
    Same deal, tiles overwritten in real time.
     
Thread Status:
Not open for further replies.