Something doesn't add up...

Discussion in 'Engineering & Reverse Engineering' started by AeroGP, Jun 8, 2008.

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

    AeroGP

    Member
    130
    1
    18
    Los Angeles, CA
    Sonic for GameMaker: Studio
    I've been reading information about collision in Sonic 2. I was eventually able to understand the basics, but there's a question I'm still not sure off:

    Sonic 2's collision array doesn't contain any collision blocks that would match, for instance, the top-right corner of a loop. Actually, there doesn't seem to be anything like that in the array. Sonic 1's collision array, on the other hand, does.

    I'm assuming Sonic 2 does something special to save space on making predefined versions of such collisions. I just don't know what it is they do. It would suck if they were hard-coded based on each level, but at least I would be certain of what it means to replicate that.

    Viewing Solidity Paths in SonED2 didn't help, especially since the numbers shown to be from the index, compared to the associated numbers in the collision array, didn't make much sense to me (I.e. some of collision array blocks share the same number, according to the SolidityBlock graph). It at least confirmed my readings on loops (A second index stores collisions for the left side of the loop, and the game just toggles through them using the "loop" chunk)

    Emerald Hill Zone shows the top-right collisions of the first loop to have an array spot of A8, B8, and 98. The SolidityGraph doesn't even have those numbers. What's going on?
     
  2. JoseTB

    JoseTB

    Tech Member
    700
    44
    28
    Flipping anyone? It's as simple as that - the block is being flipped for certain parts of the loop path, either vertically, horizontally, or +90ยบ using it's "brother" in the second collision array. This is defined in the highest bits of the blocks at the collision layout (I don't remember the details right now, but you get the idea)
     
  3. AeroGP

    AeroGP

    Member
    130
    1
    18
    Los Angeles, CA
    Sonic for GameMaker: Studio
    Please remember the details, I need to know them.
     
  4. iojnekns

    iojnekns

    trouble keeps you runnin' faster Member
    148
    0
    0
    Your guess is correct, Sonic 2 flips and mirrors (and both) solidity graphs to represent the full range of a loop. The numbers that show on the solidity viewer are the angles represented in hex, not the solid ID. The same solid ID, if flipped represents a different angle.
     
  5. AeroGP

    AeroGP

    Member
    130
    1
    18
    Los Angeles, CA
    Sonic for GameMaker: Studio
    Okay, so the numbers aren't even from the Collision Index - they're from the Angle Array, correct?

    How do I view the Collision Index in SonED2, then?

    Also, when does the game flip/mirror the blocks, and how does it know which to flip/mirror?
     
  6. iojnekns

    iojnekns

    trouble keeps you runnin' faster Member
    148
    0
    0
    If we are talking about the same numbers (seen by hitting W or E), yes they are from the angle. If you press 'solid select' you will get the collision array display up the right hand side, (although you must have already seen this in order to conclude that theres only a quarter of the loop represented by those solidity graphs). If you select one, underneath the 'solid select' you can see the ID and the angle as well as the actual height map just to the right. These are then applied to blocks in the Block selector menu (you can apply a different solid to the foreground or the background. Notice that in both the block selector menu and the chunk selector menu (this is confusing, I don't mean the strip of art down the right but the menus, the former being in the top centre, and the latter being on the lower left, there are draw direction options (draw normal, draw U-down, draw b-wards, draw U+B). These can be fiddly because you will have to orientate the art to the direction and the collision direction you want together. The game knows when to flip and when to mirror because these blocks can reoccur drawn in different directions even in the same chunk, so it can do a whole loop using only height maps 49 - 52.

    I've tied myself in a knot trying to explain that, so maybe I've missed the point of your question. If you need help feel free to PM me.
     
Thread Status:
Not open for further replies.