Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

Question about bumpers.


Hyper Emerson

Recommended Posts

I made the bumper gimmick in Sonic Worlds and i want to know if i did it right, like in the Genesis games.

The gimmick works, and i even made it so Sonic can get a total of 100 points from it, but sometimes, Sonic gets launched too high, if he falls on the bumper from certain angles.

Image is attached.

...

Where is the image.

Here:

http://img710.imageshack.us/img710/8010/bumpers.png

Link to comment
Share on other sites

This is just a guess, but I'm thinking the higher jumps are because both the X speed and Y speed events are occurring at once, which is why you bounce higher when you hit it from certain angles.

Maybe you should try changing up the events so that when Sonic hits the bumper with his different sensors, he bounces back at differing speeds.

Link to comment
Share on other sites

How bumper strength is calculated in the real games:

1. Calculate angle of attack

2. Calculate xStrength as Bumper Strength * cos(angle of attack)

3. Calculate yStrength as Bumper Strength * sin(angle of attack)

4. Apply these values to the speed values of the player object in question.

Source: Sonic 2 SVN Dump from Sonic Retro

Since you are calculating by deltas, you are going to have rather odd launch velocities sometimes. The hit box on a bumper is usually very small and so the differences due to speed/placement when hitting the bumper affect the scale of the deltas rather heavily.

I happen to be a little invested in bumpers at the moment myself, so this seems like a pretty convenient topic to me.

Link to comment
Share on other sites

No, you don't need to. That's just how it appears to be done in the Sonic 1 disassembly. I think. I don't really know assembly, so I'm just going on what I can feel for.

here though:

https://www.sonicretro.org/asm_svn/Sonic%201%20Disassembly/_incObj/47%20Bumper.asm

I see a collision detection, an angle check, and then something involving sin calculation.

Link to comment
Share on other sites

Yeah, it seems to change the velocity to a fixed value of $700 (wich is 7.0 pixels, as the game uses a .8 fixed point system). So the code would be:

// Calculate the bounce vector
CVec2 vecBounce = Sonic->vecPosition - Bumper->vecPosition;
vecBounce.normalize();

// Set new speed
Sonic->vecSpeed = vecBounce * 7.0

Edit: Seems to be correct. Tested out by checking the Spring Yard ones.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...