Actions

SCHG How-to

Fix Tails subanimation error

From Sonic Retro

(Original guide by redhotsonic)

Fix #1: Pushing bug

When Tails is standing next to a solid object, his tails use their pushing subanimation as opposed to a standard idle subanimation. Also, during the few frames before Tails enters his actual pushing animation, his tails look corrupted. Let's fix that:

Go to "Obj05_Main:" and find this coding:

	moveq	#0,d0
	move.b	anim(a2),d0
	btst	#5,status(a2)
	beq.s	+
	moveq	#4,d0
+

When Tails is next to something he's about to push, his pushing tails animation is set. The thing is, just before he pushes, one walking anim appears, which conflicts both tails animations. So, change it to this:

	moveq	#0,d0
	move.b	anim(a2),d0
	btst	#5,status(a2)		; is Tails about to push against something?
	beq.s	+			; if not, branch
	cmpi.b	#$63,mapping_frame(a2)	; Is Tails in his pushing animation yet?
	blo.s	+			; If not yet, branch, and do not set tails' tail pushing animation
	cmpi.b	#$66,mapping_frame(a2)	; ''
	bhi.s	+			; ''
	moveq	#4,d0
+

Now, as soon as he's about to push, it will still do his one walking animation, but his mapping frame wouldn't have reached #$63 yet, so it won't set the tails' pushing subanimation. That means no more conflicts. Then when he does do his pushing animation, the subanimation will set accordingly without conflicting.

Fix #2: Hurt flashing bug

We all know that Tails has another object attached to him half the time; "Tails' Tails". Used for when he's standing, jumping, etc. Sometimes, his tails are drawn within Tails himself, like when he is walking.

Something that has always bugged me in Sonic 2 is that when he gets hurt, he becomes invulnerable for a couple of seconds, and he flashes, but the object "Tails' tails" does not. When this object isn't being used (like when Tails is walking and the tails are drawn within him) his tails do flash.

To me, this looks strange. This happens in both Sonic 2 and Sonic 3 and Knuckles. I'm about to show you how to fix it in Sonic 2. I will have a guide up on the wiki for the Sonic 3 fix soon. In the meantime, simply go to
Sonic Retro
this forum post
.

Go to "loc_1D288:" and you should see this:

loc_1D288:
	lea	(Obj05AniData).l,a1
	bsr.w	Tails_Animate_Part2
	bsr.w	LoadTailsTailsDynPLC
	jsr	(DisplaySprite).l
	rts

This is where the Tails' Tails object gets animated and displayed. Change all this to:

loc_1D288:
	lea	(Obj05AniData).l,a1
	bsr.w	Tails_Animate_Part2
	bsr.w	LoadTailsTailsDynPLC
	movea.w	parent(a0),a1			; Move Tails' register to a1
	move.w	invulnerable_time(a1),d0	; Move Tails' invulnerable time to d0
	beq.s	.display			; Is invulnerable_time 0?  If so, always display his tails
	addq.w	#1,d0				; Make d0 the same as old invulnerable_time's d0
	lsr.w	#3,d0				; Shift bits to the right 3 times
	bcc.s	.return				; If the Carry bit is not set, branch and do not display Tails' tails

.display:
	jmp	(DisplaySprite).l               ; Display Tails' tails

.return:
	rts

Done.

Fix #3: Balancing fix

Not really a bug, though some people think his tails disappear. I always thought that the tails were behind his head, but if you do not like that, then go to "Obj05AniSelection:" and change this:

	dc.b	0	; TailsAni_Balance	-> Blank

I recommend changing the 0 to a $A, but you can change it to whatever you like.

Fix #4: Looking up fix

Again, not really a bug, but his tails flicker when looking up. Fixing this is just as easy. In the same bit of code that we were in for fix 3, change this:

	dc.b	2	; TailsAni_LookUp	-> Flick

Change that 2 to a 1 and it should be fine.

SCHG How-To Guide: Sonic the Hedgehog 2 (16-bit)
Fixing Bugs
Fix Demo Playback | Fix a Race Condition with Pattern Load Cues | Fix Super Sonic Bugs | Use Correct Height When Roll Jumping | Fix Jump Height Bug When Exiting Water | Fix Spin Dash Code and Add Spin Dash Speeds | Fix Screen Boundary Spin Dash Bug | Correct Drowning Bugs | Fix Camera Y Position for Tails | Fix Tails Subanimation Error | Fix Tails' Respawn Speeds | Fix Accidental Deletion of Scattered Rings | Fix Ring Timers | Fix Rexon Crash | Fix Monitor Collision Bug | Fix EHZ Deformation Bug | Correct CPZ Boss Attack Behavior | Fix Bug in ARZ Boss Arrow's Platform Behavior | Fix ARZ Boss Walking on Air Glitch | Fix ARZ Boss Sprite Behavior | Fix Multiple CNZ Boss Bugs | Fix HTZ Background Scrolling Mountains | Fix OOZ Launcher Speed Up Glitch | Fix DEZ Giant Mech Collision Glitch | Fix Boss Deconstruction Behavior | Fix Speed Bugs
Design Choices
Remove the Air Speed Cap | Disable Floor Collision While Dying | Modify Super Sonic Transformation Methods & Behavior | Enable/Disable Tails in Certain Levels | Collide with Water After Being Hurt | Retain Rings When Returning at a Star Post | Improve the Fade In\Fade Out Progression Routines | Fix Scattered Rings' Underwater Physics | Insert LZ Water Ripple Effect | Restore Lost CPZ Boss Feature | Prevent SCZ Tornado Spin Dash Death | Improve ObjectMove Subroutines | Port S3K Rings Manager | Port S3K Object Manager | Port S3K Priority Manager | Edit Level Order with ASM‎ | Alter Ring Requirements in Special Stages | Make Special Stage Characters Use Normal DPLCs | Speed Up Ring Loss Process | Add beta spindash to Sonic 2 | Change spike behaviour in Sonic 2
Adding Features
Create Insta-kill and High Jump Monitors | Create Clone and Special Stage Monitors | Port Knuckles
Sound Features
Port Sonic 1 Sound Driver | Port Sonic 2 Clone Driver | Port Sonic 3 Sound Driver | Expand the Music Index to Start at $00 (Sonic 2 Clone Driver Version)
Extending the Game
Extend the Level Index Past $10 | Extend the Level Select | Extend Water Tables | Add Extra Characters | Free Up 2 Universal SSTs