Tips and Tricks Hacking/Modding

Discussion in 'Discussion & Q&A' started by insulfrog, Aug 12, 2007.

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

    insulfrog Active Member Member

    Joined:
    Aug 10, 2007
    Messages:
    40
    Location:
    Boston, Lincolnshire, England
    I'm unsure on where to put this topic since there is no 'general hacking' section on the forums. Admins/Mods, please feel free to move this topic if you think this topic is in the wrong place. Thank you :) .


    Have you got a neat trick that you incidently found or a tip that you would like to share? If you have, you can post it here, I'll start: -


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


    Make the most of the space: -


    When you see the original levels of most Sonic games, there is a lot of unused space. You can fill this space with either the main level route, a secret/bonus area or a secondary route.


    [​IMG]


    Or, like I have done here in my hack, extend the level route without increasing the level's boundries to give the impression that the level is longer than it actually is.
     
  2. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    When editing levels, try not to add more rings than there currently is. Adding more rings will extend the data of the ROM and it will overright certain parts.


    Use the amount of rings there already is.
     
  3. Shadow Fire

    Shadow Fire Well-Known Member Member

    Joined:
    Aug 6, 2007
    Messages:
    303
    Here's a handy hint.


    MAKE BACKUPS!


    The worst thing that could possibly happen is that you've been hacking away and done lots of work, only to screw it up, or have your hard drive crash. The best thing to do is to make regular backups and keep them in a safe place.


    Oh, and this topic seems rather useful, so I'm pinning it.


    Topic pinned.
     
  4. JcFerggy

    JcFerggy Well-Known Member Member

    Joined:
    Aug 9, 2007
    Messages:
    53
    Location:
    Nova Scotia, Canada
    Not always true. Sometimes when you make a level that twists and turns so much, it gets boring and un-pleasant to play, so sometimes its better to have a level that is more straight-forward, at least for the first few zones.
     
  5. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    Another important tip. When posting information about your hack on this forum (and others), give as much information as you can. And ALWAYS listen and take on-board what other people say about your hack.


    Remember: You want your hack to be enjoyable for everyone, not just for yourself.


    As for ShadowFire's back-up tip, try backing up everytime before editing.
     
  6. Sephiroth

    Sephiroth WHY SO CURIOUS?!? Member

    Joined:
    Aug 11, 2007
    Messages:
    507
    Location:
    Qatar, M.E.
    This is probably something that has gotten me in trouble a lot when it comes to HEX but I can safetly say this for ASM too.


    QUADRUPLE CHECK YOUR WORK!


    Nothing hurts more than messed up coding, whether you typed 02 instead of 42 or typed $FFFE instead of $FFFFE. You must check and check and check!
     
  7. Chaos Hedgie

    Chaos Hedgie I'm 30 years old, with a OC. You'll live. Member

    Joined:
    Aug 12, 2007
    Messages:
    141
    Location:
    Flint, Michigan
    So, how did megamix do it then?
     
  8. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Sonic 1 uses a different system, where the rings are actually part of the object data of a zone. Sonic 2 onwards used a different system for rings, and due the the limited amount of RAM space available for it, it spills into the camera values (iirc) which is what causes the dodgy camera wrap and the distorted level layouts.
     
  9. Chaos Hedgie

    Chaos Hedgie I'm 30 years old, with a OC. You'll live. Member

    Joined:
    Aug 12, 2007
    Messages:
    141
    Location:
    Flint, Michigan
    Ah, I see. Thanks for explaining that Stephen.
     
  10. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    Correct me if I'm wrong, but isn't it possible in Sonic 2 to use actual ring objects (object #25) instead of the regular ring formations to get around this problem?
     
  11. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    If you change the object into it, yes. If you add an object as #25, no idea.
     
  12. muteKi

    muteKi LOLCRAB Member

    Joined:
    Aug 27, 2007
    Messages:
    48
    To my knowledge, the ring objects don't count toward the "perfect" ring collection total available in Sonic 2; hence you can use them without overloading the RAM. I don't see any reason then that adding a ring object would cause any serious problems (maybe sprite overloads?).
     
  13. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    I suppose if you add too many, there's a chance of overflowing the SST, since I think that only has space for $70 objects, but since sprite loading is camera based, that shouldn't really be a problem.
     
  14. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    I believe you're right there. I think there's and offset for every level which says how many rings for perfect. EHZ is 255 (I think) so if you put more rings in EHZ, and get 255 or more, you'd get a perfect score.
     
  15. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    The counter is located at $FF40, but what I really don't understand is that the counter is word-sized, so if you look at it from that perspective, having more than 255 rings in a level shouldn't be a problem (in fact, any amount of rings under 65536 would fit in the counter). I think Stephen's explanation is the actual reason for not being able to have over 255 rings in a level, not the perfect ring counter limitation.
     
  16. muteKi

    muteKi LOLCRAB Member

    Joined:
    Aug 27, 2007
    Messages:
    48
    Yeah, what I meant was along the lines of just having so many objects to deal with at a time that it slowed the game down significantly, like when you lose your rings in 2-P mode. Still, it's not really big issue assuming normal level design.


    But it really shouldn't make any other difference as you can place as many rings as you want in debug mode without the game crashing.
     
  17. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Ring objects can be used in zones, but as has already been said, they will not add to your Perfect count. Not many people tend to go for a perfect ring count though, so I suppose it doesn't really matter either way. I double checked, and the ring layout data does spill into the camera data when too many rings are added. As a result, when the level layout is loaded, the tiles are loaded in completely the wrong place and the background is placed out of position.


    The SST can contain $7F objects at any given time (according to the S2 disassembly). Objects are only in SST when they are on the screen or within a certain distance from being on the screen. This means you'd need $7F objects on screen at a given time. If this value was exceeded (in theory), the data would spill over into the primary collision data for the zone. I said "in theory" though, because I don't think the game could load that many objects onscreen in one go without it grinding to a complete halt and crashing anyway. Feel free to try though.
     
  18. shobiz

    shobiz Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    198
    Location:
    Karachi, Pakistan
    While I do think $7F objects is too many for the Genesis to handle at the same time, most calls to loc_17FDA (allocObject in Aurochs' disassembly, or the Sonic 2 equivalent of SingleObjLoad) are followed by a bne to some label. This may be me completely misunderstanding the code, but wouldn't the bne only activate on the condition that SingleObjLoad wasn't able to find a free slot in the SST? In that case, weren't the programmers planning for this case?
     
  19. muteKi

    muteKi LOLCRAB Member

    Joined:
    Aug 27, 2007
    Messages:
    48
    If both players lost rings in 2-P mode, its absence could really have complicated matters, but I think even then that only comes out to about 50 items on screen, not even half the limit.
     
  20. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    Well I haven't studied the ring loss code in detail, but I know characters can only spawn a maximum of 50 rings at a time. If both characters took a hit with 50+ rings, that would create 100 rings. Each ring, being an object, would result in $64 objects, leaving a maximum of $1B objects possible to be displayed (27 objects). Taking into account the HUD, any possible monitors and badniks on screen, and stuff like that, it MAY be possible to reach $7F, but I still think it's unlikely. If anyone wants to tast the overflow, just drop 127 rings in debug on screen. If after 127 rings it won't drop any more, then you know it's capped. Remove the cap, try again and test the results. If it all fucks up, you know why they put the cap there.
     
Thread Status:
Not open for further replies.