Sonic and Sega Retro Message Board: Some changes and fixes for Sonic 2 - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 15 Pages +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last ►
    Locked
    Locked Forum

Some changes and fixes for Sonic 2

#31 User is offline MoDule 

Posted 12 June 2012 - 03:20 PM

  • Posts: 308
  • Joined: 03-October 07
  • Gender:Male
  • Project:Procrastinating from writing bug-fix guides
  • Wiki edits:52
On the subject of the ARZ boss, I've got another that I don't think anyone's mentioned. It's hard to trigger accidentally, but if you defeat the boss while a character is standing on one of the two pillars at either side of the screen, that character will suffer from the walking on air glitch.

The Fix:

Locate the label loc_30B4A. The code should look like this:
loc_30B4A:
	move.b	#1,(Screen_Shaking_Flag).w
	addi.w	#1,y_pos(a0)
	cmpi.w	#$510,y_pos(a0)
	blt.s	BranchTo2_JmpTo37_DisplaySprite
	move.b	#0,(Screen_Shaking_Flag).w
	bra.w	JmpTo55_DeleteObject

Now add the following lines so it looks like this:
loc_30B4A:
	move.b	status(a0),d0
	andi.b	#standing_mask|pushing_mask,d0	; is someone touching the pillar?
	beq.s	Pillar_Lower			; if not, branch
	move.b	d0,d1
	andi.b	#p1_standing|p1_pushing,d1	; is it the main character?
	beq.s	+				; if not, branch
	andi.b	#$D7,(MainCharacter+status).w
	ori.b	#2,(MainCharacter+status).w	; prevent Sonic from walking in the air
+
	andi.b	#p2_standing|p2_pushing,d0	; is it the sidekick?
	beq.s	Pillar_Lower			; if not, branch
	andi.b	#$D7,(Sidekick+status).w
	ori.b	#2,(Sidekick+status).w		; prevent Tails from walking in the air

Pillar_Lower:

	move.b	#1,(Screen_Shaking_Flag).w
	addi.w	#1,y_pos(a0)
	cmpi.w	#$510,y_pos(a0)
	blt.s	BranchTo2_JmpTo37_DisplaySprite
	move.b	#0,(Screen_Shaking_Flag).w
	bra.w	JmpTo55_DeleteObject

Everything up to the label Pillar_Lower is new and what it does is check if any character is interacting with the pillar and clears their interaction bits if necessary.

A little more:

Alternatively, if you want the pillars to stay solid even while the are being lowered into the ground, change the code to this:
loc_30B4A:
	move.w	#$23,d1
	move.w	#$44,d2
	move.w	#$45,d3
	move.w	x_pos(a0),d4
	move.w	y_pos(a0),-(sp)
	addi.w	#4,y_pos(a0)
	bsr.w	JmpTo26_SolidObject
	move.w	(sp)+,y_pos(a0)

	move.b	#1,(Screen_Shaking_Flag).w
	addi.w	#1,y_pos(a0)
	cmpi.w	#$510,y_pos(a0)
	blt.s	BranchTo2_JmpTo37_DisplaySprite

	move.b	status(a0),d0
	andi.b	#standing_mask|pushing_mask,d0	; is someone touching the pillar?
	beq.s	Pillar_Lower			; if not, branch
	move.b	d0,d1
	andi.b	#p1_standing|p1_pushing,d1	; is it the main character?
	beq.s	+				; if not, branch
	andi.b	#$D7,(MainCharacter+status).w
	ori.b	#2,(MainCharacter+status).w	; prevent Sonic from walking in the air
+
	andi.b	#p2_standing|p2_pushing,d0	; is it the sidekick?
	beq.s	Pillar_Lower			; if not, branch
	andi.b	#$D7,(Sidekick+status).w
	ori.b	#2,(Sidekick+status).w		; prevent Tails from walking in the air

Pillar_Lower:
	move.b	#0,(Screen_Shaking_Flag).w
	bra.w	JmpTo55_DeleteObject


Explanation:

For an object to have solidity, which for instance allows the player objects to stand on top of it, it has to call one of the SolidObject routines. These routines handle player positioning and flags in such a way so as to make the object appear solid. When a character stands on an object, its on-object status bit is set. When this bit is set, the character no longer follows the level's terrain, but instead walks in a straight line along the object's surface, ignoring gravity. Walking off the edge of an object will cause the SolidObject routine to clear the on-object flag and make the character subject to gravity again. Should an object stop calling SolidObject while a player is standing on it, that player's on-object bit won't be reset and this causes the walking on air glitch. In the case of the ARZ boss's pillars, SolidObject is called in every state except the "moving down" state which is triggered when the boss is defeated. This causes the pillars to eventually vanish without making sure the player's on-object bits are cleared.

#32 User is offline Esrael 

Posted 12 June 2012 - 07:54 PM

  • Posts: 175
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Esrael Neto Assembler Editor / Sonic 2 Delta

View Postredhotsonic, on 12 June 2012 - 07:37 AM, said:

....


Am I the only one finding this new code not working? I thought on the last hit, the gunge was meant to fall on him, then he runs away, not still blow up. And sometimes, he drops it on himself then carries on attacking.

I tried Delta, and it does the same thing. =/



Download Sonic 2 Delta with SaveStates

This only work when Bottle are full filled with gunge and you hit the boss in correct time.
To show it working I have made two savestates.
Run this version with Gens and Load the Savestates.
This post has been edited by Esrael: 12 June 2012 - 07:54 PM

#33 User is offline Esrael 

Posted 13 June 2012 - 06:56 AM

  • Posts: 175
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Esrael Neto Assembler Editor / Sonic 2 Delta

View PostMcAleeCh, on 12 June 2012 - 02:11 AM, said:

I remember finding the graphics for that extra boss behaviour in the old "MD8123" Sonic 2 proto back in my "Knuckles Prower" days - I had no idea that the graphics existed in the final, or that code that referenced them was commented out, though! Amazing find, and great to see your tweak to return it to what was almost certainly the intended behaviour. = ) Never thought I'd see this in action!

One thing, though - the existing code seems to display the art slightly too far to the right for some reason. If you check out the old .GIF animation I made back when I originally found the graphics to show how it might look in action (currently viewable on the Sonic CulT S2 Proto Lost Sprites page), you can see that the graphics are actually designed to perfectly mask Robotnik's body, even including the small bits you can see through the shine in his Eggmobile's windscreen! For some reason though, the code you've found looks like it gets this alignment wrong by a few pixels - the whole graphic is 3 pixels too far to the right. Is there any way of shifting the goo-covered Robotnik sprite to the left by 3 pixels in order to fix this? = )



View PostKingofHarts, on 12 June 2012 - 03:23 AM, said:

Fix that, and we can add that little tidbit to the wiki page. I'll be waiting for the update. :)

BTW Esrael... I thought you were awesome before, that is just even more amazing. Thats going into my Sonic 2 hack.


Fixing the alignment is easy.
Just edit mappings into following file:

Obj5D_MapUnc_2EADC: BINCLUDE "mappings/sprite/obj5D_a.bin"

The last 3 mappings in the file is animation:
Change from

               0001E00A004A0025FFF0
               0001E80D00530029FFF0
               0001E80D005B002DFFF0


To

               0001E00A004A0025FFED
               0001E80D00530029FFED
               0001E80D005B002DFFED



#34 User is offline redhotsonic 

Posted 13 June 2012 - 01:21 PM

  • Also known as RHS
  • Posts: 1518
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24

View PostEsrael, on 12 June 2012 - 07:54 PM, said:

View Postredhotsonic, on 12 June 2012 - 07:37 AM, said:

....


Am I the only one finding this new code not working? I thought on the last hit, the gunge was meant to fall on him, then he runs away, not still blow up. And sometimes, he drops it on himself then carries on attacking.

I tried Delta, and it does the same thing. =/



Download Sonic 2 Delta with SaveStates

This only work when Bottle are full filled with gunge and you hit the boss in correct time.
To show it working I have made two savestates.
Run this version with Gens and Load the Savestates.




The thing is, mate, I thought he was only to do this once. And only on the last hit, and instead of exploding. I thought that was the theory? If not, shut me up! =P



Also, Module, nice fix. Never knew about that one. Probably because I'm hitting Eggman and Tails is too stupid to stand on the poles =P

#35 User is offline ICEknight 

Posted 13 June 2012 - 03:33 PM

  • Posts: 10105
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
That animation looks cool, but I can see why they didn't use it. It won't turn around when Robotnik's ship does, leaving the goo-with-eyes occasionally floating away from Robotnik's head.

They might not have considered fixing it a top priority, being in the rush they were.

#36 User is offline E-122-Psi 

Posted 13 June 2012 - 06:48 PM

  • Posts: 1708
  • Joined: 29-December 09
  • Gender:Male
  • Wiki edits:41

View PostEsrael, on 13 June 2012 - 06:56 AM, said:

View PostMcAleeCh, on 12 June 2012 - 02:11 AM, said:

I remember finding the graphics for that extra boss behaviour in the old "MD8123" Sonic 2 proto back in my "Knuckles Prower" days - I had no idea that the graphics existed in the final, or that code that referenced them was commented out, though! Amazing find, and great to see your tweak to return it to what was almost certainly the intended behaviour. = ) Never thought I'd see this in action!

One thing, though - the existing code seems to display the art slightly too far to the right for some reason. If you check out the old .GIF animation I made back when I originally found the graphics to show how it might look in action (currently viewable on the Sonic CulT S2 Proto Lost Sprites page), you can see that the graphics are actually designed to perfectly mask Robotnik's body, even including the small bits you can see through the shine in his Eggmobile's windscreen! For some reason though, the code you've found looks like it gets this alignment wrong by a few pixels - the whole graphic is 3 pixels too far to the right. Is there any way of shifting the goo-covered Robotnik sprite to the left by 3 pixels in order to fix this? = )



View PostKingofHarts, on 12 June 2012 - 03:23 AM, said:

Fix that, and we can add that little tidbit to the wiki page. I'll be waiting for the update. :)

BTW Esrael... I thought you were awesome before, that is just even more amazing. Thats going into my Sonic 2 hack.


Fixing the alignment is easy.
Just edit mappings into following file:

Obj5D_MapUnc_2EADC: BINCLUDE "mappings/sprite/obj5D_a.bin"

The last 3 mappings in the file is animation:
Change from

               0001E00A004A0025FFF0
               0001E80D00530029FFF0
               0001E80D005B002DFFF0


To

               0001E00A004A0025FFED
               0001E80D00530029FFED
               0001E80D005B002DFFED




Alternatively just load the mapping file along with the CPZ Boss art file on SonMapEd and nudge the last three sprites three pixels left.

Or if you're feeling really lazy just replace the mapping file with this one:

http://www.sendspace.com/file/4hiy86

These are brilliant fixes by the way, don't forget to put them in the How To section in the wiki (maybe list the bugs in the game's Bug List page as well).
This post has been edited by E-122-Psi: 13 June 2012 - 06:50 PM

#37 User is offline ICEknight 

Posted 13 June 2012 - 06:59 PM

  • Posts: 10105
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
I think the "oozed" Robotnik animation deserves its own wiki-ed guide, seeing how it can also be fixed after being restored...


Speaking of, I'm surprised that it survived hidden up to the final version. Does it work and have the same mapping problems in the many prototypes with a working CPZ boss?
This post has been edited by ICEknight: 13 June 2012 - 06:59 PM

#38 User is offline KingofHarts 

Posted 13 June 2012 - 07:08 PM

  • WHY CANT I EDIT THE WIKIIII????
  • Posts: 1543
  • Joined: 07-August 10
  • Gender:Male
  • Project:Sonic 1 Complete (SHC 2016 Entry)
  • Wiki edits:1

View PostE-122-Psi, on 13 June 2012 - 06:48 PM, said:

These are brilliant fixes by the way, don't forget to put them in the How To section in the wiki (maybe list the bugs in the game's Bug List page as well).


I'll get on it as soon as I can. I would've liked to earlier today, but something came up. (Technically I AM on business trip today)
I'll try to get to it as soon as I can get back online.

#39 User is offline Esrael 

Posted 13 June 2012 - 07:53 PM

  • Posts: 175
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Esrael Neto Assembler Editor / Sonic 2 Delta

View PostICEknight, on 13 June 2012 - 03:33 PM, said:

That animation looks cool, but I can see why they didn't use it. It won't turn around when Robotnik's ship does, leaving the goo-with-eyes occasionally floating away from Robotnik's head.

They might not have considered fixing it a top priority, being in the rush they were.


To fix this
find:

loc_2E790:

	subi.b	#1,anim_frame_duration(a0)
	bpl.s	loc_2E7B6



and add the following code:

loc_2E790:

;-------------------------------------------------------------------------------                
                cmpi.b  #$25, mapping_frame(A0)
                blt.s   _CPz_2
                move.w  (MainCharacter+x_pos).w, D0
                sub.w   x_pos(A0), D0
                bgt.s   _CPz_1
                bclr    #$00, render_flags(A0)
                bra.s   _CPz_2
_CPz_1:
                bset    #$00, render_flags(A0)                   
_CPz_2:                
;-------------------------------------------------------------------------------  
	subi.b	#1,anim_frame_duration(a0)
	bpl.s	loc_2E7B6



This post has been edited by Esrael: 13 June 2012 - 08:02 PM

#40 User is offline Mercury 

Posted 14 June 2012 - 04:59 PM

  • His Name Is Sonic
  • Posts: 1725
  • Joined: 13-November 08
  • Gender:Not Telling
  • Location:Location Location
  • Project:AeStHete
  • Wiki edits:130
Hey, Sonic 2 fixes!

One thing that's always bothered me a lot (and it isn't fixed in 3&K, either) is the camera jump when Tails rolls up.

You see, because of the change in size of Sonic's collision box when he rolls up, the camera has an offset of 5 pixels to compensate. But Tails doesn't change in size as drastically, since he's so small to begin with. However, the camera code is the same for both characters, making it jump by 4 pixels if you roll while playing as Tails. It's not much, but once you notice it, you can't unsee and it starts to give you a headache.

Anyway, to fix it, just add the lines between the semicolons:

loc_D78E:
	btst	#2,status(a0)
	beq.s	loc_D798
	subq.w	#5,d0
	;
	cmpi.w	#2,(Player_mode).w	; Player_mode is $FFFFFF70
	bne.s	loc_D798
	addq.w	#4,d0
	;

loc_D798:



If your disasm doesn't have the same labels, you can find this code by searching for "subq.w #5,d0".

#41 User is offline Esrael 

Posted 14 June 2012 - 10:22 PM

  • Posts: 175
  • Joined: 24-July 03
  • Gender:Male
  • Location:Brazil, São Paulo, Guarulhos
  • Project:Esrael Neto Assembler Editor / Sonic 2 Delta
Did someone noticed that Bottom part of Background in CNz in 2 Player Mode don't scroll for Tails?
How To fix this:

Find This
; ===========================================================================
byte_D270:
	dc.b   4
	dc.b   4	; 1
	dc.b   8	; 2
	dc.b   8	; 3
	dc.b   8	; 4
	dc.b   8	; 5
	dc.b   8	; 6
	dc.b   8	; 7
	dc.b   8	; 8
	dc.b   8	; 9
	dc.b   0	; 10
	dc.b $78	; 11
; ===========================================================================



and add the following data:

Bg_Scroll_CNz_Data_Player_2: 
       dc.b    $08, $08, $08, $08, $08, $08, $08, $0C, $00, $78, $00, $00  



and find:
        move.w   #bytesToLcnt($1D0),d2
	lea	 (byte_D270+1).l,a3

; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


sub_D216:




and change to:
        move.w   #bytesToLcnt($1D0),d2
	lea	(Bg_Scroll_CNz_Data_Player_2).l,a3

; ||||||||||||||| S U B R O U T I N E |||||||||||||||||||||||||||||||||||||||


sub_D216:



#42 User is offline Alriightyman 

Posted 15 June 2012 - 10:17 AM

  • !!!!!!!!!!!!!!!!!
  • Posts: 350
  • Joined: 27-November 07
  • Gender:Male
  • Location:Largo, Fl
  • Project:0101001101101111011011100110100101100011 00000010: 0101001100000011 01000101011001000110100101110100011010010110111101101110
  • Wiki edits:5
How the hell do all of you notice these things?!?!?!? I love all these previously unknown fixes!

#43 User is offline Jayextee 

Posted 15 June 2012 - 10:21 AM

  • Comic Mischief
  • Posts: 3178
  • Joined: 22-October 07
  • Gender:Male
  • Location:Kathmandu, Nepal
  • Project:I DONE MAKED GAMES.
  • Wiki edits:27
I don't recall, has anyone ever fixed the collision? -- when Sonic (or Tails) is colliding with two objects at once, only one registers? This is why Sonic walks through certain badniks in ARZ when he's scattering leaves, and why he can't collect dropped rings in lava without jumping.

#44 User is offline MoDule 

Posted 15 June 2012 - 10:38 AM

  • Posts: 308
  • Joined: 03-October 07
  • Gender:Male
  • Project:Procrastinating from writing bug-fix guides
  • Wiki edits:52

View PostEsrael, on 14 June 2012 - 10:22 PM, said:

Did someone noticed that Bottom part of Background in CNz in 2 Player Mode don't scroll for Tails?
(Etc...)

Cool. I never managed to fix this one in a way I was satisfied with. What the hell was the original code trying to do, anyway?


View PostAlriightyman, on 15 June 2012 - 10:17 AM, said:

How the hell do all of you notice these things?!?!?!? I love all these previously unknown fixes!

For me, it's observing the games obsessively.

View PostJayextee, on 15 June 2012 - 10:21 AM, said:

I don't recall, has anyone ever fixed the collision? -- when Sonic (or Tails) is colliding with two objects at once, only one registers? This is why Sonic walks through certain badniks in ARZ when he's scattering leaves, and why he can't collect dropped rings in lava without jumping.

Not a very difficult fix, I think, but it probably wouldn't be feasible without s3k's faster collision checking.

#45 User is offline redhotsonic 

Posted 15 June 2012 - 01:05 PM

  • Also known as RHS
  • Posts: 1518
  • Joined: 31-January 05
  • Gender:Male
  • Location:United Kingdom
  • Project:Sonic Bash!
  • Wiki edits:24

View PostAlriightyman, on 15 June 2012 - 10:17 AM, said:

How the hell do all of you notice these things?!?!?!? I love all these previously unknown fixes!


I normally find bugs with my hack "Sonic 2 Recreation". When I notice these bugs, I look to see if it's in the original game, which 95% of the time, it is. Because I fix it for S2R, I might as well tell people how to fix it for the originals, otherwise everyone will have the same bugs.



View PostJayextee, on 15 June 2012 - 10:21 AM, said:

...and why he can't collect dropped rings in lava without jumping.


eh? This shouldn't happen. I've tried this many times, and it works okay to me. In both HTZ and MTZ.






Anyway, seeming as we've moved on from bosses, I have another bug to show:




How to fix Spindash's height collision




Posted Image

Here's Sonic standing with an arrow heading towards him. Obviously, the arrow is going to hurt him.



Posted Image

Here's Sonic ducking with an arrow heading towards him. Obviously, the arrow is going to miss him.



Posted Image

Here's Sonic spindashing with an arrow heading towards him. This should miss him. But in Sonic 2, it doesn't! Bug? I think so! Here's how to fix. (again, I'm using Xenowhirl's 2007 disassembly)




Go to "TouchResponse:" and find this bit of coding:

	cmpi.b	#$4D,mapping_frame(a0)	; is Sonic ducking?
	bne.s	Touch_NoDuck		; if not, branch
	addi.w	#$C,d3
	moveq	#$A,d5
; loc_3F592:
Touch_NoDuck:



What it's doing here, is comparing if Sonic is ducking. If so, do NOT branch, and shorten his y_radius (to $A) and edits his y_pos before carrying on with the routine. It only does this with the ducking though. Because of this, when you spindash, it's still branching to continue with the routine without making any edits to his y_radius, so Sonic's y_radius is still the same as Sonic's standing y_radius ($13). When Sonic rolls, his y_radius is changed, but that's set elsewhere. Anyway, change the coding you see above, to this below:

	cmpi.b	#9,anim(a0)		; is Sonic spindashing?
	beq.s	Duckinganddashing	; if so, branch
	cmpi.b	#$4D,mapping_frame(a0)	; is Sonic ducking?
	bne.s	Touch_NoDuck		; if not, branch
Duckinganddashing:		; So, Sonic is spindashing or ducking
	addi.w	#$C,d3
	moveq	#$A,d5
; loc_3F592:
Touch_NoDuck:



Now, it's doing an extra check to see if Sonic is spindashing, and if so, it will branch to a new label and shorten his y_radius. If not, it will then ask if you're ducking and if so, it won't branch and shorten the y_radius. If you're not ducking either, it will branch to "Touch_NoDuck" and carry on with the routine.

The codes above run the majority of the time of the game, so this affects most of the objects.




You need to do the same for "Touch_Boss:" So go to that label and change this bit of the coding:

	cmpi.b	#$4D,mapping_frame(a0)
	bne.s	loc_3F68E
	addi.w	#$C,d3
	moveq	#$A,d5

loc_3F68E:



To this:

	cmpi.b	#9,anim(a0)		; is Sonic spindashing?
	beq.s	Duckinganddashingboss	; if so, branch
	cmpi.b	#$4D,mapping_frame(a0)
	bne.s	loc_3F68E
Duckinganddashingboss:
	addi.w	#$C,d3
	moveq	#$A,d5

loc_3F68E:



This part of the code only runs when there is a boss present.



Two more, we need to do it again at "loc_170D0:" Go there and change this part of the coding:

	cmpi.b	#$4D,mapping_frame(a0)
	bne.s	loc_17104
	addi.w	#$C,d3
	moveq	#$A,d5

loc_17104:



Change it to this:

	cmpi.b	#9,anim(a0)		; is Sonic spindashing?
	beq.s	Duckinganddashingrings	; if so, branch
	cmpi.b	#$4D,mapping_frame(a0)
	bne.s	loc_17104
Duckinganddashingrings:
	addi.w	#$C,d3
	moveq	#$A,d5

loc_17104:


This code runs in the Ring Manager part of the coding. This only affects the rings collision.




One more, but I'm not sure if this is important. It's part of the Specialbumpers routine for CNZ. But I don't see how you can hit the bumpers whilst spindashing. But in case you want to implement it anyway, go to "loc_174DE:" and change this part of the coding:

	cmpi.b	#$4D,mapping_frame(a0)
	bne.s	loc_17508
	addi.w	#$C,d3
	moveq	#$A,d5

loc_17508:



to this:

	cmpi.b	#9,anim(a0)		; is Sonic spindashing?
	beq.s	Duckinganddashingbumps	; if so, branch
	cmpi.b	#$4D,mapping_frame(a0)
	bne.s	loc_17508
Duckinganddashingbumps:
	addi.w	#$C,d3
	moveq	#$A,d5

loc_17508:




Done. You should start to see results like this:

Posted Image



Cheers,
redhotsonic

  • 15 Pages +
  • 1
  • 2
  • 3
  • 4
  • 5
  • Last ►
    Locked
    Locked Forum

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users