Questions about the HUD in Sonic 2...

Discussion in 'Discussion and Q&A Archive' started by ThomasThePencil, Nov 30, 2014.

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

    ThomasThePencil resident psycho Member

    Joined:
    Jan 29, 2013
    Messages:
    910
    Location:
    the united states. where else?
    So, I've had some questions about the HUD in Sonic 2. In my hack I've wanted to rearrange and re-style the HUD to look more modern. However, since the HUD does not have a single mappings file and instead has multiple mappings files, I can't exactly do that reliably...

    ...which brings me to my questions:

    1) First and foremost, is it possible to change the HUD into a normal object with an ID?

    2) If the above is possible, I'll go a little further: Is it possible to have that object be able to maintain functionality if the individual parts are moved around (I was thinking possibly with subtypes but I'm unsure)?
     
  2. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    Sonic The Hedgehog had the HUD originally controlled by an object (via SST), Sonic The Hedgehog 2 decided on directly writing the sprite data into the sprite table to save on needless processing time.

    Yes, you may have the HUD displayed as an object, and yes, it's main functionality (art flushing, time control, etc) can be maintained separately despite the sprite pieces themselves being controlled via an object.
     
  3. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    You don't need to make it a normal object, I've been able to extensively modify the HUD with dynamic elements in a hack without changing it into an object, you just have to look at how it sets up the mapping it displays and duplicate it.
     
  4. KingofHarts

    KingofHarts Well-Known Member Member

    Joined:
    Sep 30, 2012
    Messages:
    53
    Location:
    Chi-Town
    I'm with MainMemory... IN FACT, I'd argue that Sonic 1 hackers doing extensive stuff with their hacks would wanna do the same to their HUD and make it a non-object entity.
     
  5. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    I'm not sure exactly if it was Sonic 1 or Sonic 2, but I remember opening up the HUD mappings in there, and shifting them left/right until they were at my desired screen positions. Of course this meant trial and error, but if you just wanna move stuff around, that'd be the easiest way to do it.
     
  6. redhotsonic

    redhotsonic Also known as RHS Member

    Joined:
    Aug 10, 2007
    Messages:
    2,969
    Location:
    England
    The best way (or the way I found best anyway) was to open the mappings in SonMapED (or a relevant mappings editor), save (or convert it, whatver) into an ASM format. So now you have it in ASM, not BIN.

    Then you can edit the mappings in ASM. When I first started to learn mappings for things like this, I just changed a bit here, saved, see what had changed, etc. After I knew what did what, I made comments showing this represented y_pos, this represented x_pos, etc. A bit like what Irixion suggested.
     
  7. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    There's also this.
     
  8. StephenUK

    StephenUK Working on a Quackshot disassembly Member

    Joined:
    Aug 5, 2007
    Messages:
    1,026
    From what I remember (and it may have changed since I last looked at a recent disassembly) the mappings for the HUD in S2 were never split and always remained in ASM for within the disassembly. As RHS said though, you can split these out and modify them as you need to and add any elements you want without turning it into an objecthe. As MainMemory said, you just need to look at how the mappings are set up. Back when I did my time travel hack, I modified the HUD to contain all the elements I needed to display without converting it into an object. It's actually pretty simple.
     
  9. MainMemory

    MainMemory Well-Known Member Member

    Joined:
    Mar 29, 2011
    Messages:
    922
    No, all the mappings except the springs' have always been binary, except in the case of the title cards and score tally, which was changed recently, and the MapMacros branch of the GitHub disassembly that I linked to part of there.

    To be more on topic, it is entirely possible to have HUD elements using completely separate mappings than the score/time/rings/lives (I even have DPLCs for some things in my current hack, which are processed in HudUpdate).

    If you need to convert mappings to another format, you can use the tool I made.
     
    Last edited by a moderator: Dec 1, 2014
Thread Status:
Not open for further replies.