Sonic and Sega Retro Message Board: MoDule's bugfix guides Vol. 1 - Sonic and Sega Retro Message Board

Jump to content

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

MoDule's bugfix guides Vol. 1 more to come

#1 User is offline MoDule 

Posted 15 May 2011 - 07:27 PM

  • Posts: 308
  • Joined: 03-October 07
  • Gender:Male
  • Project:Procrastinating from writing bug-fix guides
  • Wiki edits:52
During my hacking escapades I tend to be reminded of bugs I've known for a long time. Sometimes I can find their sources and try to fix them. Here's a few guides I put together for common bugs I haven't seen fixed anywhere.

How-to:Fix bugs relating to Super Sonic
This is a big one. Here you'll find fixes for a whole bunch of Super Sonic related bugs, the most important one being the one where you get stuck in the air after completing a level. Most of the others are mostly cosmetic, but do make the game behave the way it was supposed to.

How-to:Use correct height when roll jumping
I posted about this before. Basically, when you jump while rolling Sonic might jerk upward a few pixels upon landing. When this happens you can't jump until he lands again. This one has been annoying me for a while.

How-to:Fix jump height bug when exiting water
This one's been bothering me ever since I was a kid. Sometimes when you try to jump out of water Sonic only jumps really low. After I finally figured out what causes it, fixing it was pretty easy.

I also added explanations of every bug for your reading pleasure.
This should hopefully be educational.

There's more to come, I've just spent multiple hours writing these and it's really late.

Edit: Next batch:

How-to:Fix camera y position for Tails
This one's always really bothered me and I don't even use Tails that often. The camera's vertical position is pretty jerky for Tails. The way this fix is done, no special code will ever be necessary to handle the character changing height, at least as far as the camera is concerned.

How-to:Fix bug in ARZ Boss arrow's platform behavior
Not that noticeable or problematic, but it's still nice to have it fixed. The arrows that the ARZ boss fires trigger the walking in air bug that happens when Sonic doesn't get released from a platform properly.

How-to:Collide with water after being hurt
When Sonic gets hurt he doesn't interact with the water surface. I put this one down as a design choice, since it's debatable weather the original behavior was intentional or not. The Advance series indicates that at least one person thought it wasn't.
This post has been edited by MoDule: 24 May 2011 - 05:29 PM

#2 User is offline flamewing 

Posted 16 May 2011 - 12:05 PM

  • Emerald Hunter
  • Posts: 831
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
Nice to see these all collected, it should really help the beginners.

I did spot an error in your error correction guides: in the Super Sonic part, on the deceleration bug, you substitute a value that is too low (3) compared to what it is for normal Sonic (6).

#3 User is offline Travelsonic 

Posted 16 May 2011 - 12:30 PM

  • Posts: 661
  • Joined: 01-March 05
QUOTE (MoDule @ May 15 2011, 08:27 PM)
This one's been bothering me ever since I was a kid. Sometimes when you try to jump out of water Sonic only jumps really low. After I finally figured out what causes it, fixing it was pretty easy.


Hello Sonic CD's Tidal Tempest Zone - the only place where I've noticed it, bugs the living hell out of me.

#4 User is offline ICEknight 

Posted 16 May 2011 - 03:04 PM

  • Posts: 9289
  • Joined: 11-January 03
  • Gender:Male
  • Location:Spain
  • Wiki edits:18
Thanks for posting those. The explanations were a nice read even for those of us who haven't worked much with disassemblies.

Are you going to include any Sonic 3 fixes? I hope somebody can eventually fix those annoying moonjumps when Sonic gets off the underwater rotating cylinders.

#5 User is offline MoDule 

Posted 17 May 2011 - 02:59 AM

  • Posts: 308
  • Joined: 03-October 07
  • Gender:Male
  • Project:Procrastinating from writing bug-fix guides
  • Wiki edits:52
QUOTE (flamewing @ May 16 2011, 07:05 PM)
I did spot an error in your error correction guides: in the Super Sonic part, on the deceleration bug, you substitute a value that is too low (3) compared to what it is for normal Sonic (6).

Fixed, thanks. For some reason I thought 6 was the normal value and divided that by 2.

QUOTE (Travelsonic @ May 16 2011, 07:30 PM)
Hello Sonic CD's Tidal Tempest Zone - the only place where I've noticed it, bugs the living hell out of me.

Me, too. You can't imagine my joy when I finally figured out what was causing it.

QUOTE (ICEknight @ May 16 2011, 10:04 PM)
Thanks for posting those. The explanations were a nice read even for those of us who haven't worked much with disassemblies.

Thanks, that's what I was going for. I like for people to understand what's going on rather than just giving a series of instructions. Especially in the case of the water jump height bug I wanted to show just how convoluted the whole thing is.

QUOTE (ICEknight @ May 16 2011, 10:04 PM)
Are you going to include any Sonic 3 fixes? I hope somebody can eventually fix those annoying moonjumps when Sonic gets off the underwater rotating cylinders.

Some of these do also apply to Sonic 3, I just haven't written the specific code yet. As for the rotating cylinders, it's essentially the same bug as with anything that changes your speed under water, so it should be really easy to fix.

#6 User is offline LOst 

Posted 17 May 2011 - 03:56 AM

  • Posts: 4879
  • Joined: 10-January 03
  • Gender:Male
  • Wiki edits:2
Nice read MoDule! I have suffered from the low jump out of water many times in my simulator(s), where the water height causes my Knuckles player troubles as his jump height is already low, it is almost impossible to jump out of the water.

I am a little scared of applying any fixes regarding the stand/roll difference change, as changing those causes other things to go crazy. A new way of handling the difference (that 5 pixels offset change on Y pos) was introduced in Sonic 3 to fix the Sonic 2 spindash bug (when spindashing, and aborting the spindash during the charge, either by jumping and releasing direction at the right moment (causing the player to jump straight up in the air), or spindashing directly against a wall), the player get stuck 5 pixels into the ground. This fix must be applied before applying any other fixes regarding that area, or your fixes are not Sonic 3 compatible. In Sonic 3, the SST bytes $44 and $45 holds the original bounding box (I have never seen them change, so I call them original values, however, knowing Sonic 3, they are probably changed at some point from some other object dusing some special moment, BUT ANYHOW they can be hardcoded in Sonic 1 and 2), and when the player is restored from rolling state, look what they do.

Nice to see some bug fixes that are actually bug fixes, and not prefered-by-some-guy fixes (roll jumping enable direction controls because I like it, have no idea game might actually break because of it), nor Sonic-was-supposed-to-do-this-because-I-can-program-asm fixes (jumping with angle forces in S1 special stage), nor fixes-changing-the-original-play-is-not-meant-to-be (spindash rev counter overflow, sure a mistake in the code, but changing that now will mess up the timings of every level designed for the original behaviour). Very sorry you guys who I directly said my opinion against without naming you. MoDule is doing a great job, nailing the real issues of the Sonic player, bringing them up like this.
This post has been edited by LOst: 17 May 2011 - 04:06 AM

#7 User is offline flamewing 

Posted 17 May 2011 - 09:12 AM

  • Emerald Hunter
  • Posts: 831
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
QUOTE (LOst @ May 17 2011, 05:56 AM)
I am a little scared of applying any fixes regarding the stand/roll difference change, as changing those causes other things to go crazy. A new way of handling the difference (that 5 pixels offset change on Y pos) was introduced in Sonic 3 to fix the Sonic 2 spindash bug (when spindashing, and aborting the spindash during the charge, either by jumping and releasing direction at the right moment (causing the player to jump straight up in the air), or spindashing directly against a wall), the player get stuck 5 pixels into the ground. This fix must be applied before applying any other fixes regarding that area, or your fixes are not Sonic 3 compatible. In Sonic 3, the SST bytes $44 and $45 holds the original bounding box (I have never seen them change, so I call them original values, however, knowing Sonic 3, they are probably changed at some point from some other object dusing some special moment, BUT ANYHOW they can be hardcoded in Sonic 1 and 2), and when the player is restored from rolling state, look what they do.

$44 and $45 are the standing half-height and half-width; I can attest that they are only ever set during player initialization, and are henceforth ever only read from. I know this by two different routes: 1) a couple years ago, I wrote a minor LUA script which I used in Gens rerecording to track changes to SST variables for Sonic and Tails, and proceeded to test all objects with it, trying to find more TAS-worthy bugs; 2) more recently, I went through the S3&K SVN disassembly and checked that these 2 are only written to at initialization or when the memory written to is neither Sonic's/Knuckles' nor Tails'.

As for the rest, do you mean plain S3? Because I tested MoDule's in S3&K and it did not show the behavior you mentioned (with or without the fix).

Hrm. Maybe I should contribute my own fix to the infamous spindash cancel bug when you spindash at the edges of the camera...

#8 User is offline MoDule 

Posted 18 May 2011 - 12:12 PM

  • Posts: 308
  • Joined: 03-October 07
  • Gender:Male
  • Project:Procrastinating from writing bug-fix guides
  • Wiki edits:52
I just checked s3k again, because I couldn't reproduce the height bug. Just to be sure I checked the disassembly and found that the bug is technically still unfixed, but it's circumvented. Instead of moving Sonic by a fixed amount when he lands the game calculates the difference from the current height and default height and uses that. So, in s3k it's not an essential fix.

#9 User is offline flamewing 

Posted 18 May 2011 - 12:44 PM

  • Emerald Hunter
  • Posts: 831
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
QUOTE (MoDule @ May 18 2011, 02:12 PM)
I just checked s3k again, because I couldn't reproduce the height bug. Just to be sure I checked the disassembly and found that the bug is technically still unfixed, but it's circumvented. Instead of moving Sonic by a fixed amount when he lands the game calculates the difference from the current height and default height and uses that. So, in s3k it's not an essential fix.

That is what LOst said, basically; what I was saying is that your fix did not cause any of the issues he feared. There is a benefit to using your fix anyway, though: the character's hitbox will be the correct size when jumping from rolling, instead of suddenly increasing to standing hitbox.

#10 User is offline Master3k 

Posted 18 May 2011 - 12:51 PM

  • Posts: 278
  • Joined: 25-July 07
  • Gender:Male
  • Wiki edits:27
QUOTE
How-to:Fix jump height bug when exiting water


I love you.

Can those be applied to Sonic 1, though (except the roll jump one, as Sonic 1 doesn't use this standing height thing)? Or these glitches are present only on S2? Just wondering.

#11 User is offline MoDule 

Posted 18 May 2011 - 04:58 PM

  • Posts: 308
  • Joined: 03-October 07
  • Gender:Male
  • Project:Procrastinating from writing bug-fix guides
  • Wiki edits:52
QUOTE (Master3k @ May 18 2011, 07:51 PM)
QUOTE
How-to:Fix jump height bug when exiting water


I love you.

Can those be applied to Sonic 1

The code looks identical, save for the different styles between disassemblies, so yes, I think so.

#12 User is offline flamewing 

Posted 18 May 2011 - 06:15 PM

  • Emerald Hunter
  • Posts: 831
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
MoDule: do you mind if I add another Super Sonic bug fix to your collection? There is one more bug related to end-of-level transformation that still happens even with the S3&K fix. This bug requires more bad luck than anything, but it does happen: if you trigger the transformation on the very same frame when the timer is stopped by the signpost, Sonic will begin transforming and get stuck on air again. This happens because Sonic's object code runs before the collision with the signpost is checked; thus, the transformation will begin and then be halted when the signpost code runs and stops the timer. But since the transformation never ends, the object control flags are still set and Sonic still gets stuck on air.

If you are wondering: the same issue happens in S3&K if you trigger the transformation at the very same frame when Tails hits the boss (either act) the final time. It is even rarer, but it has happened.

#13 User is offline MoDule 

Posted 18 May 2011 - 07:22 PM

  • Posts: 308
  • Joined: 03-October 07
  • Gender:Male
  • Project:Procrastinating from writing bug-fix guides
  • Wiki edits:52
Never knew about that one, but it makes sense.
By all means, add to the guide! I was hoping to get people interested, so this certainly helps.

#14 User is offline flamewing 

Posted 19 May 2011 - 03:12 PM

  • Emerald Hunter
  • Posts: 831
  • Joined: 11-October 10
  • Gender:Male
  • Location:Brasil
  • Project:Sonic Classic Heroes; Sonic 2 Special Stage Editor; Sonic 3&K Heroes (on hold)
  • Wiki edits:12
After looking a bit more into it, I see that the bug I mentioned is S3&K-specific -- it is not possible to trigger it in S2 unless you have a hack that either enables Tails to end the level or enables multiple characters to trigger the transformation, in which case you will need special code to prevent graphical glitches. I will make an entry at the S3&K section about the bug.

In any case, the fix for the screen boundary spindash bug is done.

#15 User is offline MoDule 

Posted 20 May 2011 - 10:18 AM

  • Posts: 308
  • Joined: 03-October 07
  • Gender:Male
  • Project:Procrastinating from writing bug-fix guides
  • Wiki edits:52
It actually is possible in s2; Tails can end a level with the prison capsule. Although it's almost impossible to trigger without debug mode and not game breaking, since Sonic doesn't need to move after that.
I've found a sort-of fix for this. I'm not quite satisfied, because for some reason it makes Sonic's transformation animation play twice. Go to Sonic_RevertToNormal and add these two lines at the beginning:
Syntax Highlighted Code: ASM
	cmpi.b	#1,(Super_Sonic_palette).w
beq.s return_1AC3C

This makes sure Sonic's revert code doesn't interrupt the transformation sequence.

Nice work on the guide, btw.

  • 3 Pages +
  • 1
  • 2
  • 3
    Locked
    Locked Forum

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