Rain in GHZ

Discussion in 'Discussion and Q&A Archive' started by liamsonichacker, Feb 7, 2011.

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

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    This may sound a little odd but, what I am trying to accomplish,


    is making it rain in GHZ.


    But I don't know where to start.


    Any ideas?


    Thanks in advance.
     
  2. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    It's an interesting idea, and the first thing you might want to look into is how the waterfalls in GHZ are also done, using the same technique in the art to simulate rain with a rotating pallet? That's just a basic idea though, I've seen a hack before which had snow in GHZ, but involving custom objects via ASM.
     
  3. M.N.K.

    M.N.K. In the River of Darkness... Member

    Joined:
    Feb 22, 2009
    Messages:
    506
    Location:
    Earth...
    are you referring to the hack called sonic 1 quick winter adventure? if so then yes it did have snow in it. as for liam's question, maybe you should try asking him and he might just help you out.
     
  4. liamsonichacker

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    Myself I did not think of that, (Silly me).


    I would be using my own art to do this.


    When it has been completed I will release it onto the site for anybody to use.


    But when I have a Rough idea on what to do, do I make a separate ASM File,


    or use the main one?
     
  5. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    Atmospheric are extremely easy to add. I quickly described the principle under a screenshot I posted some weeks ago with sparks in marble zone.


    First of all, you have to keep in mind object are resource hungry, you won't be able to have tons of water drops on the screen as different objects, but you can have several drops in one "sprite" (which isn't a sprite from the vdp's standpoint, but that's not the point). You'll need to optimize the object as much as possible.


    With that in mind, all you need is:


    - some free vram to store the art


    - art & mappings for your drops, and obviously the entry in the pattern load cues


    - a new object, as basic as possible with initialization (of course), then only vertical & horizontal speeds, presence on screen detection, some basic subtraction/addition tricks to send the object to the other side of the screen when it leaves it


    - a loader that runs once at the beginning of the levels and loads as many instances of the object in memory as necessary to achieve the right effect.


    Refining it would possibly be the longest part actually, everything else is a matter of minutes.
     
  6. liamsonichacker

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    Ok, I think that this idea is way out of my league, the only thing I know how to do there is the art part


    =(
     
  7. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    It's really easy: find a simple object, copy it, simplify it to the bare essentials, customize it, make it load in your level, improve, enjoy.


    edit: otherwise, there's another old method buy you won't like it: replace the background with rain, set it to high priority, have it move in the right direction. I think that's the way it was done in some games, such as ghouls'n'ghosts, but you lose the background. On the other hand, I think it could be much less hungry resource-wise... but no background is really bad ^^'
     
    Last edited by a moderator: Feb 7, 2011
  8. liamsonichacker

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    OK, so say if I were to copy bubble so to speak and save it as a different object,


    how could I get it to generate through out the level?
     
  9. SpirituInsanum

    SpirituInsanum Well-Known Member Member

    Joined:
    Feb 11, 2010
    Messages:
    642
    You precisely don't need to. You only have to make a routine that creates them at the beginning of the level, then add something to the code so when they leave the screen on one side, they appear on the other side.
     
    Last edited by a moderator: Feb 7, 2011
  10. Hanoch

    Hanoch Well-Known Member Member

    Joined:
    Aug 3, 2008
    Messages:
    312
    Location:
    Israel
    You could also use the window plane (it overlaps the FG but not the sprites) and make that scroll down like rain.


    In my hack im also trying to make rain (for testing) what I did was making the rain art/object and putting it at the level high above, then I added a code to load the object in a distance of $80 pixels from each other and another code to reproduce the rain after a few frames. It still lags the game, but thats because I forgot to make a check to see if the object's out of the screen (on X axis only).


    And to arrange that code, just make the rain maker one object and the rain that falls a different object. The rain maker creates itself X pixels away, but only once to avoid mass object overflow. The rain that falls is also created by the rain maker and disappears after its out of the left/bottom boundaries of the screen (or else it wont even come down)


    If you have no idea how to do that, use an object that just displays (like the ghz rock) replace the art and mappings with your rain art and mappings and add a code to make it move diagonally (or down if that's your intention). To check if it left the boundaries, you could check for Sonic_LevelBound for some code (although it checks for plane boundaries only, I dont think it ever checks for screen based boundaries).


    All of that is the rain's code.


    Next theres the rain maker. It doesn't need art, or mappings. I dont think it even needs to display, just make an object that's completely still, but it checks if it leaves the left screen boundary and if it is, remove it.


    And finally to make the object load stuff you need to use SingleObjLoad.




    tst.b (flag) ; is the flag set? (replace flag with a clean ram address or an object SST from $29(a0) to $3F(a0))


    bne.s routine ; if yes, branch


    jsr SingleObjLoad ; load an object


    bne.s routine ; if ther'es no room to load an object, branch


    move.b #$objectID,(a1) ; load objectID as the object (replace with object number)


    move.w 8(a0),8(a1) ; have the X pos the same as this


    move.w $C(a0),$C(a1) ; have the same Y pos as this


    st (flag) ; set the code so the routine wont run again (replace flag with the same thing you put above)


    routine:


    [code to display the object, or remove it upon reaching a boundary]


    rts



    This code is to load the rain object in the place of this, but the rain object will move itself upon loading so no need to worry.


    To reproduce the rain maker the Y pos needs to be the same, but the X pos needs to be larger:




    moveq #0,d0 ; clear d0 if it has anything in it


    move.w 8(a0),d0 ; move the X pos of this object into d0


    add.w #$XX,d0 ; add XX bytes to d0 ; replace XX with a positive value, smaller than $80 (IIRC thats how far an object can get without being erased)


    move.w d0,8(a1) ; put the newly made value into the X pos of the next rain maker object



    To make an object move, you could use a handful guide that explains how to make objects, its here on SSRG i'll get you a link.


    Edit:


    http://info.sonicretro.org/SCHG_How-to:Work_with_Objects


    I guess its not in SSRG anymore.
     
    Last edited by a moderator: Feb 7, 2011
  11. liamsonichacker

    liamsonichacker Mad Level Skillz ;) Member

    Joined:
    May 29, 2009
    Messages:
    50
    Location:
    Leicester, UK
    That my friend has just earned you 5 points.


    Your a big help, thanks alot mate =)
     
  12. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    I've seen rain made in a hack before, however I think it hasn't been release, so I can't mention the hack name or who made it, but it was extremely well done and very simple too! That person used the method PsychoSk8r suggested with the palette, but it wasn't just rain, it was thunder too (I'll stop there or I'll probably ruin it). But the way it looked was very (and exclusively) surreal, and I don't recall any real games for the Megadrive actually producing a similar effect like that at all.


    Side note, this has become my most favourite thread on SSRG so far, you're all collaborating together finding new methods of producing rain, while trying to bypass the limitations of the Megadrive. And all of these suggestions are both plausible and thought out properly. Nice work guys! Have a point each!
     
  13. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    It is good to see people sharing ideas using logic as the main way of getting the point across rather than just code, it can result in so much.


    This thread has inspired me to have a whack at this myself, as it is something I think I'd enjoy doing.


    If I get it done, I'll share a ROM, and ofcourse the code with you all.
     
  14. wonderfulwardy

    wonderfulwardy Active Member Exiled

    Joined:
    Nov 22, 2010
    Messages:
    37
    Location:
    Billericay, Essex, UK
    So it's true what I once said to PSY. If given the chance, you could practiclly create almost anything 2D Platformer-wise with 16bit hardware.


    Here's a question though, What do you think can't be done? Anyone here ever played Braid? It was a time manipulation 2D Platformer that came out on PC and XBLA.


    I would love to see someone like Aquaslash attemped some of these ideas for Silver in his S Factor game. For a start, it can't be hard to freeze time could it?!? It'll be like pausing the game and every object in sight except for Silver himself. Someone please shut me up, I take ideas way too far sometimes.

    even me? :D
     
    Last edited by a moderator: Feb 7, 2011
  15. MarkeyJester

    MarkeyJester ♡ ! Member

    Joined:
    Jun 27, 2009
    Messages:
    2,867
    You're going off topic here.
     
  16. Spanner

    Spanner The Tool Member

    Joined:
    Aug 9, 2007
    Messages:
    2,570
    I believe Jayextee used deformation to apply a snow effect to a level. This might be what MarkeyJester was referring to earlier though.
     
  17. wonderfulwardy

    wonderfulwardy Active Member Exiled

    Joined:
    Nov 22, 2010
    Messages:
    37
    Location:
    Billericay, Essex, UK
    lol, sorry Markey... seems I have a tendancy to do that alot. :D


    If so, I don't mean to. It's just how I am. I'll try my best to not screw up but can't promise anything. :D
     
  18. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    Ofcourse, I'll be sharing the code with everyone, that is if I get anywhere with it before anyone else does, as I'm not climbing in knee deep just yet. =P
     
  19. OrdosAlpha

    OrdosAlpha RIGHT! Naebody move! Root Admin

    Joined:
    Aug 5, 2007
    Messages:
    1,793
    Location:
    Glasgow, Scotland
    Fantastic Dizzy on the MD has rain in game. Occurs randomly as well.
     
  20. PsychoSk8r

    PsychoSk8r HighKnights Member

    Joined:
    Aug 9, 2007
    Messages:
    271
    Location:
    Birmingham, UK
    Holy shit, I fucking remember that.


    You just brought back so many childhood memories. Fuck.
     
Thread Status:
Not open for further replies.