Sonic 1 water guide!

Discussion in 'Approved' started by Tornado, Sep 17, 2009.

  1. theocas

    theocas #! Member

    Joined:
    Apr 10, 2010
    Messages:
    375

    That's weird, I entered something in there. Here is the complete post again:

    I made a copy of the lz_heigh.bin and renamed it to ghz_heigh.bin so GHZ could have a different water height than LZ, since GHZ is called DMZ (Dark Marsh Zone) in my hack and should not be flooded, just have a small bit of water. What values do I need to edit to accomplish this? BTW Selbi, I love your Text Generator Tool!
     
    Last edited by a moderator: Apr 18, 2010
  2. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,435
    Location:
    Northern Germany
    Well thanks, that has nothing to do with though though. =P


    Anyway, just duplicating a file won't get you anywhere. The compiler doesn't check for every file in a specific folder, you need to "include" the file first. In case your file is a .bin, you need to use "incbin" instead, like so:



    incbin misc\ghz_heigh.bin
    even



    The "even" is necesary in some way (dunno why, but it is). But even if you add this code, nothing will happen, because you didn't tell the game to use those things. Take a look at "Level_ClrVars3", it will definitly help you at understanding this.


    That's it for now, if you didn't get it, I'm sorry, but you really shouldn't ask for something you can't do at least in some way alone.
     
  3. theocas

    theocas #! Member

    Joined:
    Apr 10, 2010
    Messages:
    375
    I did that, I just don't understand the format of that bin file.
     
  4. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,435
    Location:
    Northern Germany
    It's the default water height for each LZ level. Unchanged it looks like this:



    Code:
    00 B8 03 28 09 00 02 28
    To understand this, look at this:



    Code:
    00 B8 - LZ1
    
    03 28 - LZ2
    
    09 00 - LZ3
    
    02 28 - LZ4 (SBZ3)
     
  5. theocas

    theocas #! Member

    Joined:
    Apr 10, 2010
    Messages:
    375
    If I understand this corecctly, the 2 bytes tell us the water height in Y values used by Debug? So FF FF gets us a level full of water, and 00 00 no water at all.


    The water code gets the acts right in GHZ, or do I have to remove the last 2 bytes?
     
    Last edited by a moderator: Apr 19, 2010
  6. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,435
    Location:
    Northern Germany
    Almost, it's just the other way around: If you have 00 00 the entire level is filled with water and with FF FF, it's still there, but at the very bottom of the level.
     
  7. theocas

    theocas #! Member

    Joined:
    Apr 10, 2010
    Messages:
    375
    Thanks for your help Selbi!


    EDIT: GHZ 1 just doesn't want to accept the changes here. I filled the file with FF FF, but it just doesn't want to see the changes in Act 1. Act 2 works fine, just act doesn't.


    EDIT 2: I forgot to incbin the right file, but once I fixed it, I still get the water's 'drag' when I am not in it and I also drown when I am out of the water.
     
    Last edited by a moderator: Apr 20, 2010
  8. liamsonichacker

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    Hey, thanks mate :) nice tutorial you made there
     
  9. LGBTEcks2

    LGBTEcks2 Newcomer Exiled

    Joined:
    Feb 12, 2010
    Messages:
    15
    Location:
    Brazil
    I can't understand, can you help me?
     
  10. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,435
    Location:
    Northern Germany
    Yes, I can. Look at the time difference between my post and your one, then read Rule 09 again. This should certainly help you.
     
  11. Tornado

    Tornado Active Member Member

    Joined:
    Dec 1, 2008
    Messages:
    30
    Location:
    Hydrocity - Angel Island
    Look at the code, I made a change at the end!


    I'm back!
     
  12. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    Pinned. This is a handy bit of information for all hackers of S1. =P
     
  13. KCEXE

    KCEXE Active Member Member

    Joined:
    Jun 18, 2011
    Messages:
    26
    Location:
    9th Circle of Hell, Florida
    I agree, this is handy!
     
  14. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
  15. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    There is a "pattern load cues" list in Sonic 1, which has lists of graphics to load, where in VRAM to load them, and in what order. Unfortunately, I don't know which disassembly you are working with, so I cannot help you any further.
     
  16. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    Hi Master MarkeyJester, i work on the Hivebrain 2005.
     
  17. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    "_inc\Pattern load cues.asm" is the file you will need to edit.

    In the list "PLC_LZ:" you will find:

    Code:
            dc.l Nem_Splash        ; waterfalls and splash
            dc.w $4B20
            dc.l Nem_Water        ; water    surface
            dc.w $6000
    As well as:

    Code:
            dc.l Nem_Bubbles    ; bubbles and numbers
            dc.w $6900
    You can copy and paste these into the "PLC_GHZ2:" list, though you will need to change the first value in that list:

    Code:
    PLC_GHZ2:    dc.w 5
    From 5 to 8, since you now have 3 more entries in the list now.

    The final thing to keep in mind now, is that other art "may" already be loaded to the VRAM addresses the water wants to go. I suggest putting these three entries at the end of the list, so that if any GHZ art screws up, it's easier to find. I do believe that GHZ already uses up quite a substantial amount of VRAM, you more than like will need to remove something else before you can put those water graphics in.

    Also, you don't have to call me "master", as interesting as that sounds, it's not really the image I want d=
     
    Pacca and Ashuro like this.
  18. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    It's working but yes, i have to remove something else because there is many tiles of water surface instead GHZ tiles...
    How can i remove something?
    For exemple, i want to remove the palmtree art.. is it ok, and is it enough?

    Ok sorry!
     
  19. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    The palmtrees are part of the level graphics, so I wouldn't bother with that.

    Check "PLC_GHZ" and "PLC_GHZ2" lists, each one has a pointer name, and a VRAM address, for example:

    Code:
    		dc.l Nem_PplRock	; purple rock
    		dc.w $7A00
    If you wanted to remove the purple rock graphics, you delete those two lines from the list, then change the first value in the list:

    Code:
    PLC_GHZ:	dc.w $B
    B is the number of entries in the list, since you've removed one from the list (in this example the purple rock), subtract 1, so B - 1 = A

    Change the B to an A.

    If you delete another entry from that list, subtract 1 again, A - 1 = 9.

    Change the A to a 9.

    If you delete another entry, subtract 1 again, 9 - 1 = 8.

    Change the 9 to an 8.
     
  20. Ashuro

    Ashuro Anti-Cosmic Metal Of Death Member

    Joined:
    Sep 27, 2014
    Messages:
    550
    Location:
    France
    I understand, I have to remove objects and not of art!
    Ok, the most difficult choice...
    And about B - 1 = A, I know all that ;)