How do I add act transitions to Sonic 1?

Discussion in 'Discussion and Q&A Archive' started by FireRat, Jan 11, 2010.

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

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    I need to know how to make transitions between zones (in true style Sonic 3) in the game Sonic 1


    I can not make it "release" the camera. And if I do, all levels do make this function, and the "sonic got trough" title card works with many bugs. :)

    Help me please!




    NOTE: This post may contain very bad grammar.
     
    Last edited by a moderator: Jan 12, 2010
  2. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    Uhm, where is your question now? You said, you need transitions and you said you have bugs, but you didn't say which bugs you have or showed us your code, nor told us what you actually want. Which means, there's for no way we can help you, yet. =P
     
  3. Qjimbo

    Qjimbo Well-Known Member Member

    Joined:
    Feb 27, 2008
    Messages:
    850
    Location:
    Vancouver, BC
    I believe what he means is that there's no title cards between acts, in the same way Sonic 3 "loads" act 2 after you beat the miniboss.


    If I remember rightly there was a hack of Sonic 2 that did this released a couple of years ago. I'll see if I can dig it up.


    EDIT: Alriightyman's S3 Edition hacks do it, however the hack I was thinking of had the dynamic loading feature and nothing else. I'll fire a PM off to Alriightyman anyway.
     
    Last edited by a moderator: Jan 12, 2010
  4. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    In Sonic 3, then killing the boss of Act 2, and prison capsule break, appears the message "SONIC GOT TROUGH" showing Time Bonus and Ring Bonus. But in my game, this message disappears (The same happens in all levels)


    For reference, this is the source code:



    Code:
    loc_C610:				; XREF: loc_C61A
    
    		move.b	#$E,$24(a0)
    
    		bra.w	Obj3A_ChkPos2
    
    		move.b	#$2,$24(a0)
    
    		bra.w	Obj3A_ChkPos2
    
    
    
    ; ===========================================================================
    
    
    
    loc_C61A:				; XREF: Obj3A_ChkPos
    
    		cmpi.b	#$E,($FFFFD724).w ;I suppose that this one is the code that check if it is the level SBZ2
    
    		beq.s	loc_C610
    
    		cmpi.b	#$2,($FFFFD724).w
    
    		beq.s	loc_C610
    
    		cmpi.b	#4,$1A(a0)
    
    		bne.s	loc_C5FE
    
    		addq.b	#2,$24(a0)
    
    		move.w	#180,$1E(a0)	; set time delay to 3 seconds
    
    		...........
    
    

    Code:
    
    Obj3A_ChkPos2:				; XREF: Obj3A_Index
    
    		moveq	#$20,d1		; set horizontal speed
    
    		move.w	$32(a0),d0
    
                    clr.b   ($FFFFF7AA).w
    
                    clr.b   ($FFFFF728).w
    
    		cmp.w	8(a0),d0	; has item reached its finish position?
    
    		beq.s	Obj3A_GHZ3	; if yes, branch
    
    		cmp.w	8(a0),d0	; has item reached its finish position?
    
    		beq.s	Obj3A_SBZ2	; if yes, branch
    
    		bge.s	Obj3A_Move2
    
    		neg.w	d1
    
    
    
    Obj3A_Move2:
    
    		add.w	d1,8(a0)	; change items position
    
    		move.w	8(a0),d0
    
    		bmi.s	locret_C748
    
    		cmpi.w	#$200,d0	; has item moved beyond	$200 on	x-axis?
    
    		bcc.s	locret_C748	; if yes, branch
    
    		bra.w	DisplaySprite
    
    ; ===========================================================================
    
    
    
    locret_C748:
    
    		rts	
    
    ; ===========================================================================
    
    Obj3A_GHZ3:				; XREF: Obj3A_ChkPos2
    
    		moveq	#$20,d1		; set horizontal speed
    
    		move.w	$32(a0),d0
    
    		cmp.w	8(a0),d0	; has item reached its finish position?
    
    		beq.s	Obj_N_GHZ3	; if yes, branch
    
    		bge.s	Obj3A_Move3		neg.w	d1Obj3A_Move3:		add.w	d1,8(a0)	; change items position		move.w	8(a0),d0		bmi.s	locret_C748_P		cmpi.w	#$200,d0	; has item moved beyond	$200 on	x-axis?		bcc.s	locret_C748_P	; if yes, branch		bra.w	DisplaySpritelocret_C748_P:              rtsObj_N_GHZ3:		addq.b	#2,$24(a0)		clr.b	($FFFFF7CC).w	; unlock controls		move.w	#$8D,d0		jmp	(PlaySound).l	; play FZ music; ===========================================================================local_C766_N:				; XREF: Obj3A_Index		addq.w	#2,($FFFFF72A).w		cmpi.w	#$2CC0,($FFFFF72A).w		beq.w	DeleteObject		rts	; ===========================================================================
    
    
    
    Obj3A_SBZ2:				; XREF: Obj3A_ChkPos2
    
    		cmpi.b	#4,$1A(a0)
    
    		bne.w	DeleteObject
    
    		addq.b	#2,$24(a0)
    
    		clr.b	($FFFFF7CC).w	; unlock controls
    
    		move.w	#$8D,d0
    
    		jmp	(PlaySound).l	; play FZ music
    
    ; ===========================================================================
    
    loc_C766:				; XREF: Obj3A_Index
    		addq.w	#2,($FFFFF72A).w
    		cmpi.w	#$2100,($FFFFF72A).w
    		beq.w	DeleteObject
    		rts	
    ; ===========================================================================
    
    
     
    Last edited by a moderator: Jan 12, 2010
  5. Irixion

    Irixion Well-Known Member Member

    Joined:
    Aug 11, 2007
    Messages:
    670
    Location:
    Ontario, Canada
    I still don't get your question.


    You want act to act loading like S3K? You'll have to rewrite or port the code for the act complete object, and how the game handles level loading. This is no easy task.
     
  6. Selbi

    Selbi The Euphonic Mess Member

    Joined:
    Jul 20, 2008
    Messages:
    2,429
    Location:
    Northern Germany
    While Irixion just pointed it, there's no easy task to do it, you can do something alternate: You can put together all your level layouts and simply do something like SBZ2, where the leevl goes on just after you passed the sign post. It should work.
     
  7. Alriightyman

    Alriightyman I'm back! Member

    Joined:
    Oct 3, 2007
    Messages:
    156
    Location:
    USA
    Sorry about the crazy bump! I haven't logged on here in a long time. The Q™ pm'ed me about this, which I just got today, so I thought throw in my 2 cents. I think what he is looking for is the transitions from XXZ act2 to XXZ act 1. And actually to make the Level Results screen "go away" is already coded in Sonic 1. Scrape Brain Zone Act 2 uses this. I don't have a disassembly to look at right now, but if you look through the results object code you should find something checking for SBZ2. Just duplicate that and check for other acts as well. And you will have to change the music it plays and what not.


    Like Irixion said, ACT Transitions™ are not an easy task to add to a hack. In my hack, for example, I had to re-edit the Title Cards™, the Level Results Screen™, the way the art for the title cards was handled, ect. just to make it work . But, basically what is going on during a level transition is the level changes, it re-loads the collision, rings manager, resets the object manager, loads the new level layout, set up the water, ect. and then subtracts the size of act 1 from the camera, sonics position, the signposts position, the monitor's position. All this is triggered by a flag, and then cleared so it doesn't set load this again. That's about all I can remember right now, it's been a while since I looked at a disassembly. Hope some of that makes sense, as I am bad at explaining things. :)
     
  8. FireRat

    FireRat Do Not Interact With This User, Anywhere!!! Exiled

    Joined:
    Oct 31, 2009
    Messages:
    535
    Ok Thanks!
     
Thread Status:
Not open for further replies.