Hyper Emerson Posted December 31, 2009 Report Share Posted December 31, 2009 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 More sharing options...
Blue Emerald Posted December 31, 2009 Report Share Posted December 31, 2009 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 More sharing options...
DimensionWarped Posted December 31, 2009 Report Share Posted December 31, 2009 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 More sharing options...
LarkSS Posted December 31, 2009 Report Share Posted December 31, 2009 http://www.sonicfangameshq.com/view.php?sec=4&id=170 This might help you out in regards to getting the angle of attack. It might be missing a check for if the angle would be exactly 270 or 90, but it works well for the most part. Link to comment Share on other sites More sharing options...
Death_Daniel Posted January 1, 2010 Report Share Posted January 1, 2010 If Someone was to make a tutorial on Angled attacks like Boss Hits and Such as the example in this topic that would be very helpfull to alot of people I think. Link to comment Share on other sites More sharing options...
DimensionWarped Posted January 2, 2010 Report Share Posted January 2, 2010 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 More sharing options...
Damizean Posted January 2, 2010 Report Share Posted January 2, 2010 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 More sharing options...
LarkSS Posted January 2, 2010 Report Share Posted January 2, 2010 Since the thread was split for topic-relatedness, I guess I might as well repost the link to a tutorial I made earlier to do basic bumper collisions which I believe is the generic way of doing things. http://larkss.thisisourcorner.net/files/Bumper.zip Link to comment Share on other sites More sharing options...
Recommended Posts