From: <mbj...@us...> - 2010-01-08 02:35:09
|
Revision: 4417 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4417&view=rev Author: mbjornstk Date: 2010-01-08 02:35:01 +0000 (Fri, 08 Jan 2010) Log Message: ----------- Make rands in direct hits use floats correctly (they were ints at the wrong time, so results were 0.0f always) and limit minimal distance in non direct hits (maybe should use other value, just a matter of testing). Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-01-08 01:36:15 UTC (rev 4416) +++ main/trunk/src/karts/kart.cpp 2010-01-08 02:35:01 UTC (rev 4417) @@ -506,15 +506,16 @@ float sign_c = (sign_bits & (0x1 << 10)) ? 1.0f : -1.0f; float sign_d = (sign_bits & (0x1 << 11)) ? 1.0f : -1.0f; float sign_e = (sign_bits & (0x1 << 12)) ? 1.0f : -1.0f; - btVector3 diff(sign_a * (float)(rand()%16/16), sign_b * (float)(rand()%16/16), 2.0f); + + btVector3 diff(sign_a * float(rand()%16) / 16.0f, sign_b * float(rand()%16) / 16.0f, 2.0f); diff.normalize(); - diff*=stk_config->m_explosion_impulse/5.0f; + diff *= stk_config->m_explosion_impulse / 5.0f; m_uprightConstraint->setDisableTime(10.0f); getVehicle()->getRigidBody()->applyCentralImpulse(diff); - getVehicle()->getRigidBody()->applyTorqueImpulse(btVector3(sign_c * float(rand()%32*5), - sign_d * float(rand()%32*5), - sign_e * float(rand()%32*5))); - + + btVector3 torque(sign_c * float(rand()%32) * 5.0f, sign_d * float(rand()%32) * 5.0f, sign_e * float(rand()%32) * 5.0f); + getVehicle()->getRigidBody()->applyTorqueImpulse(torque); + m_stars_effect->showFor(6.0f); } else // only affected by a distant explosion @@ -522,9 +523,12 @@ btVector3 diff=getXYZ()-pos; //if the z component is negative, the resulting impulse could push the // kart through the floor. So in this case ignore z. - if(diff.getZ()<0) diff.setZ(0.0f); + if(diff.getZ()<0.0f) diff.setZ(0.0f); float len2=diff.length2(); + // Protect against "near zero" distances + len2 = (len2 > 0.5f) ? len2 : 0.5f; + // The correct formulae would be to first normalise diff, // then apply the impulse (which decreases 1/r^2 depending // on the distance r), so: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-01-12 22:55:10
|
Revision: 4442 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4442&view=rev Author: hikerstk Date: 2010-01-12 22:55:03 +0000 (Tue, 12 Jan 2010) Log Message: ----------- Made the AI a bit more competitive by not slowing the mid- and high-level AI down when skidding. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-01-12 11:15:50 UTC (rev 4441) +++ main/trunk/src/karts/kart.cpp 2010-01-12 22:55:03 UTC (rev 4442) @@ -972,7 +972,11 @@ engine_power *= m_power_reduction/stk_config->m_slowdown_factor; // Lose some traction when skidding, so it is not abused by player - if(m_controls.m_drift) + // The AI will be allowed to cheat on medium and hard difficulty in + // order to make them more competitive (this might be removed once + // the AI is better). + if(m_controls.m_drift && + (race_manager->getDifficulty()==RaceManager::RD_EASY || isPlayerKart()) ) engine_power *= 0.5f; m_vehicle->applyEngineForce(engine_power, 2); m_vehicle->applyEngineForce(engine_power, 3); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-01-29 02:48:00
|
Revision: 4557 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4557&view=rev Author: hikerstk Date: 2010-01-29 02:47:52 +0000 (Fri, 29 Jan 2010) Log Message: ----------- Commented out debug output. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-01-29 02:46:44 UTC (rev 4556) +++ main/trunk/src/karts/kart.cpp 2010-01-29 02:47:52 UTC (rev 4557) @@ -797,7 +797,7 @@ // ------------------------------------------------------------------- if(m_slipstream_mode==SS_USE) { - printf("Using slipstream\n"); + //printf("Using slipstream\n"); m_slipstream_time -= dt; if(m_slipstream_time<0) m_slipstream_mode=SS_NONE; m_slip_stream->setIntensity(2.0f, NULL); @@ -857,7 +857,7 @@ // Accumulate slipstream credits now m_slipstream_time = m_slipstream_mode==SS_NONE ? dt : m_slipstream_time+dt; - printf("Collecting slipstream %f\n", m_slipstream_time); + //printf("Collecting slipstream %f\n", m_slipstream_time); m_slip_stream->setIntensity(m_slipstream_time, target_kart); m_slipstream_mode = SS_COLLECT; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-02-19 01:00:30
|
Revision: 4768 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4768&view=rev Author: hikerstk Date: 2010-02-19 01:00:08 +0000 (Fri, 19 Feb 2010) Log Message: ----------- Bugfix: ftl crashed at end of race. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-02-19 00:56:44 UTC (rev 4767) +++ main/trunk/src/karts/kart.cpp 2010-02-19 01:00:08 UTC (rev 4768) @@ -467,7 +467,9 @@ race_manager->kartFinishedRace(this, time); setController(new EndController(this, m_controller->getPlayer())); m_kart_properties->getKartModel()->setEndAnimation(true); - m_camera->setMode(Camera::CM_REVERSE); + // Not all karts have a camera + if(m_camera) + m_camera->setMode(Camera::CM_REVERSE); } // finishedRace //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-02-20 23:33:06
|
Revision: 4780 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4780&view=rev Author: mbjornstk Date: 2010-02-20 23:32:59 +0000 (Sat, 20 Feb 2010) Log Message: ----------- Make torque be away from zero always, so shake is a sure thing. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-02-20 23:30:45 UTC (rev 4779) +++ main/trunk/src/karts/kart.cpp 2010-02-20 23:32:59 UTC (rev 4780) @@ -578,7 +578,11 @@ m_uprightConstraint->setDisableTime(10.0f); getVehicle()->getRigidBody()->applyCentralImpulse(diff); - btVector3 torque(sign_c * float(rand()%32) * 5.0f, sign_d * float(rand()%32) * 5.0f, sign_e * float(rand()%32) * 5.0f); + float torqueX = sign_c * (20.0f + float(rand()%32) * 5.0f); + float torqueY = sign_d * (20.0f + float(rand()%32) * 5.0f); + float torqueZ = sign_e * (20.0f + float(rand()%32) * 5.0f); + + btVector3 torque(torqueX, torqueY, torqueZ); getVehicle()->getRigidBody()->applyTorqueImpulse(torque); m_stars_effect->showFor(6.0f); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-03-12 02:55:40
|
Revision: 4987 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=4987&view=rev Author: mbjornstk Date: 2010-03-12 02:55:31 +0000 (Fri, 12 Mar 2010) Log Message: ----------- Swap YZ when applying explosion forces. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-12 02:45:17 UTC (rev 4986) +++ main/trunk/src/karts/kart.cpp 2010-03-12 02:55:31 UTC (rev 4987) @@ -603,7 +603,7 @@ float sign_d = (sign_bits & (0x1 << 11)) ? 1.0f : -1.0f; float sign_e = (sign_bits & (0x1 << 12)) ? 1.0f : -1.0f; - btVector3 diff(sign_a * float(rand()%16) / 16.0f, sign_b * float(rand()%16) / 16.0f, 2.0f); + btVector3 diff(sign_a * float(rand()%16) / 16.0f, 2.0f, sign_b * float(rand()%16) / 16.0f); diff.normalize(); diff *= stk_config->m_explosion_impulse / 5.0f; m_uprightConstraint->setDisableTime(10.0f); @@ -621,9 +621,9 @@ else // only affected by a distant explosion { btVector3 diff=getXYZ()-pos; - //if the z component is negative, the resulting impulse could push the - // kart through the floor. So in this case ignore z. - if(diff.getZ()<0.0f) diff.setZ(0.0f); + // If the Y component is negative, the resulting impulse could push the + // kart through the floor. So in this case ignore Y. + if(diff.getY()<0.0f) diff.setY(0.0f); float len2=diff.length2(); // Protect against "near zero" distances @@ -640,9 +640,8 @@ getVehicle()->getRigidBody()->applyCentralImpulse(diff); // Even if just pushed, give some random rotation to simulate the lost of control by the shake float sign_a = (sign_bits & (0x1 << 8)) ? 1.0f : -1.0f; - getVehicle()->getRigidBody()->applyTorqueImpulse(btVector3(0, 0, sign_a * float(rand()%32*5))); - } - + getVehicle()->getRigidBody()->applyTorqueImpulse(btVector3(0, sign_a * float(rand()%32*5), 0)); + } // if direct_hit } // handleExplosion //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-03-17 02:46:19
|
Revision: 5012 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5012&view=rev Author: hikerstk Date: 2010-03-17 02:46:12 +0000 (Wed, 17 Mar 2010) Log Message: ----------- Applied Chris Morris patch 2968849: make the torque after an explosion dependent on distance to avoid karts shaking that are way too far to be affected at all. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-17 02:17:34 UTC (rev 5011) +++ main/trunk/src/karts/kart.cpp 2010-03-17 02:46:12 UTC (rev 5012) @@ -640,7 +640,7 @@ getVehicle()->getRigidBody()->applyCentralImpulse(diff); // Even if just pushed, give some random rotation to simulate the lost of control by the shake float sign_a = (sign_bits & (0x1 << 8)) ? 1.0f : -1.0f; - getVehicle()->getRigidBody()->applyTorqueImpulse(btVector3(0, sign_a * float(rand()%32*5), 0)); + getVehicle()->getRigidBody()->applyTorqueImpulse(btVector3(0, sign_a * float(rand()%32*5)/sqrt(len2), 0)); } // if direct_hit } // handleExplosion This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-03-18 11:42:57
|
Revision: 5021 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5021&view=rev Author: hikerstk Date: 2010-03-18 11:42:49 +0000 (Thu, 18 Mar 2010) Log Message: ----------- Fixed incorrect start positions on some tracks (caused by minor forwards/backwards shaking of the kart at start and the fact that 'isInRest()' tested the wrong axis). Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-18 01:22:40 UTC (rev 5020) +++ main/trunk/src/karts/kart.cpp 2010-03-18 11:42:49 UTC (rev 5021) @@ -336,7 +336,7 @@ */ bool Kart::isInRest() const { - return fabs(m_body->getLinearVelocity ().z())<0.2; + return fabs(m_body->getLinearVelocity ().y())<0.2; } // isInRest //----------------------------------------------------------------------------- This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-03-19 12:46:36
|
Revision: 5033 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5033&view=rev Author: hikerstk Date: 2010-03-19 12:46:30 +0000 (Fri, 19 Mar 2010) Log Message: ----------- Bugfix: wrong axis resulted in incorrect automatic rescues. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-19 10:38:52 UTC (rev 5032) +++ main/trunk/src/karts/kart.cpp 2010-03-19 12:46:30 UTC (rev 5033) @@ -745,7 +745,7 @@ // partly tunnels through the track). While tunneling should not be // happening (since Z velocity is clamped), the epsilon is left in place // just to be on the safe side (it will not hit the chassis itself). - Vec3 pos_plus_epsilon = trans.getOrigin()+btVector3(0,0,0.3f); + Vec3 pos_plus_epsilon = trans.getOrigin()+btVector3(0,0.3f,0); // These values cause the track not to be hit in tuxtrack. I leave // them in as a test case if additional debugging should be needed. // Note: it might be that the kart chassis is actually 'in' the track, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-03-23 23:43:00
|
Revision: 5051 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5051&view=rev Author: hikerstk Date: 2010-03-23 23:42:46 +0000 (Tue, 23 Mar 2010) Log Message: ----------- Fixed bug 2972321 - crash in battle mode since in battle mode there is no quad graph. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-23 23:33:47 UTC (rev 5050) +++ main/trunk/src/karts/kart.cpp 2010-03-23 23:42:46 UTC (rev 5051) @@ -773,8 +773,9 @@ if (getHoT()==Track::NOHIT) // kart falling off the track { // let kart fall a bit before rescuing - if(fabs( getXYZ().getZ() - -World::getWorld()->getTrack()->getQuadGraph().getQuad(0).getCenter().getZ() ) > 17) + const Vec3 *min, *max; + World::getWorld()->getTrack()->getAABB(&min, &max); + if(min->getY() - getXYZ().getY() > 17) forceRescue(); } else if(material) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-03-25 23:55:50
|
Revision: 5075 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5075&view=rev Author: mbjornstk Date: 2010-03-25 23:55:44 +0000 (Thu, 25 Mar 2010) Log Message: ----------- Tweak cases for constraint, so long jumps are possible (via ramp+zipper). One is commented out for now as it needs more testing of the distance setting. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-25 22:41:45 UTC (rev 5074) +++ main/trunk/src/karts/kart.cpp 2010-03-25 23:55:44 UTC (rev 5075) @@ -672,7 +672,8 @@ } // When really on air, free fly, when near ground, try to glide / adjust for landing - if(!isNearGround()) + // If zipped, be stable, so ramp+zipper can allow nice jumps without scripting the fly + if(!isNearGround() && !(m_zipper_time_left > 0.0f)) m_uprightConstraint->setLimit(M_PI); else m_uprightConstraint->setLimit(m_kart_properties->getUprightTolerance()); @@ -1227,14 +1228,16 @@ } // To avoid tunneling (which can happen on long falls), clamp the - // velocity in Z direction. Tunneling can happen if the Z velocity + // velocity in Y direction. Tunneling can happen if the Y velocity // is larger than the maximum suspension travel (per frame), since then // the wheel suspension can not stop/slow down the fall (though I am // not sure if this is enough in all cases!). So the speed is limited // to suspensionTravel / dt with dt = 1/60 (since this is the dt // bullet is using). + // Only apply if near ground instead of purely based on speed avoiding + // the "parachute on top" look. const Vec3 &v = m_body->getLinearVelocity(); - if(v.getY() < - m_kart_properties->getSuspensionTravelCM()*0.01f*60) + if(/*isNearGround() &&*/ v.getY() < - m_kart_properties->getSuspensionTravelCM()*0.01f*60) { Vec3 v_clamped = v; // clamp the speed to 99% of the maxium falling speed. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-03-27 01:07:50
|
Revision: 5076 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5076&view=rev Author: mbjornstk Date: 2010-03-27 01:07:44 +0000 (Sat, 27 Mar 2010) Log Message: ----------- Attenuate "yawing" speed when leaving the ground (jumps). Suggested by hiker, with some tweaks by me (make it 25% per update instead of abrupt zeroing). Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-25 23:55:44 UTC (rev 5075) +++ main/trunk/src/karts/kart.cpp 2010-03-27 01:07:44 UTC (rev 5076) @@ -678,6 +678,21 @@ else m_uprightConstraint->setLimit(m_kart_properties->getUprightTolerance()); + // TODO: hiker said this probably will be moved to btKart or so when updating bullet engine. + // Neutralize any yaw change if the kart leaves the ground, so the kart falls more or less + // straight after jumping, but still allowing some "boat shake" (roll and pitch). + // Otherwise many non perfect jumps end in a total roll over or a serious change of + // direction, sometimes 90 or even full U turn (real but less fun for a karting game). + // As side effect steering becames a bit less responsive (any wheel on air), but not too bad. + if(!isOnGround()) { + btVector3 speed = m_body->getAngularVelocity(); + speed.setY(speed.getY() * 0.25f); // Progressive attenuation + m_body->setAngularVelocity(speed); + // This one keeps the kart pointing "100% as launched" instead, + // like in ski jump sports, too boring but also works. + //m_body->setAngularVelocity(btVector3(0,0,0)); + } + m_zipper_time_left = m_zipper_time_left>0.0f ? m_zipper_time_left-dt : 0.0f; //m_wheel_rotation gives the rotation around the X-axis, and since velocity's This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-03-28 18:05:08
|
Revision: 5093 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5093&view=rev Author: mbjornstk Date: 2010-03-28 18:04:59 +0000 (Sun, 28 Mar 2010) Log Message: ----------- Attenuate roll and pitch, trying to reduce the "boat shake" look in jumps. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-28 00:16:28 UTC (rev 5092) +++ main/trunk/src/karts/kart.cpp 2010-03-28 18:04:59 UTC (rev 5093) @@ -686,7 +686,9 @@ // As side effect steering becames a bit less responsive (any wheel on air), but not too bad. if(!isOnGround()) { btVector3 speed = m_body->getAngularVelocity(); - speed.setY(speed.getY() * 0.25f); // Progressive attenuation + speed.setX(speed.getX() * 0.95f); + speed.setY(speed.getY() * 0.25f); // or 0.0f for sharp neutralization of yaw + speed.setZ(speed.getZ() * 0.95f); m_body->setAngularVelocity(speed); // This one keeps the kart pointing "100% as launched" instead, // like in ski jump sports, too boring but also works. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-03-28 22:26:52
|
Revision: 5095 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5095&view=rev Author: mbjornstk Date: 2010-03-28 22:26:46 +0000 (Sun, 28 Mar 2010) Log Message: ----------- Raise max speed allowed when zipper is on effect. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-03-28 20:04:53 UTC (rev 5094) +++ main/trunk/src/karts/kart.cpp 2010-03-28 22:26:46 UTC (rev 5095) @@ -1230,7 +1230,9 @@ m_speed *= -1.f; //cap at maximum velocity - const float max_speed = getMaxSpeedOnTerrain(); + float max_speed = getMaxSpeedOnTerrain(); + if (m_zipper_time_left > 0.0f) + max_speed *= (1.0f + stk_config->m_zipper_max_speed_fraction); if ( m_speed > max_speed ) { const float velocity_ratio = max_speed/m_speed; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-04-15 23:56:38
|
Revision: 5202 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5202&view=rev Author: hikerstk Date: 2010-04-15 23:56:32 +0000 (Thu, 15 Apr 2010) Log Message: ----------- Removed unnecessary include, improved rescue animations, though it is still not correct in all cases (that's work in progress). Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-04-15 23:54:18 UTC (rev 5201) +++ main/trunk/src/karts/kart.cpp 2010-04-15 23:56:32 UTC (rev 5202) @@ -49,7 +49,6 @@ #include "race/history.hpp" #include "tracks/track.hpp" #include "utils/constants.hpp" -#include "utils/coord.hpp" #if defined(WIN32) && !defined(__CYGWIN__) // Disable warning for using 'this' in base member initializer list @@ -748,9 +747,9 @@ const float rescue_time = m_kart_properties->getRescueTime(); const float rescue_height = 2.0f; btQuaternion q_roll (btVector3(0.0f, 0.0f, 1.0f), - -m_rescue_roll*dt/rescue_time*DEGREE_TO_RAD); + m_rescue_roll*dt/rescue_time); btQuaternion q_pitch(btVector3(1.f, 0.f, 0.f), - -m_rescue_pitch*dt/rescue_time*DEGREE_TO_RAD); + m_rescue_pitch*dt/rescue_time); setXYZ(getXYZ()+Vec3(0, m_kart_properties->getRescueHeight()*dt/rescue_time, 0)); @@ -1338,6 +1337,8 @@ m_attachment->set( ATTACH_TINYTUX, m_kart_properties->getRescueTime()); m_rescue_pitch = getPitch(); m_rescue_roll = getRoll(); + //m_rescue_pitch = getHPR().getPitch(); + //m_rescue_roll = getHPR().getRoll(); race_state->itemCollected(getWorldKartId(), -1, -1); World::getWorld()->getPhysics()->removeKart(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-04-27 23:11:46
|
Revision: 5296 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5296&view=rev Author: mbjornstk Date: 2010-04-27 23:11:40 +0000 (Tue, 27 Apr 2010) Log Message: ----------- Make engine sound acute if no wheel load (flying). Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-04-27 22:51:07 UTC (rev 5295) +++ main/trunk/src/karts/kart.cpp 2010-04-27 23:11:40 UTC (rev 5296) @@ -1221,7 +1221,14 @@ // when going faster, use higher pitch for engine if(m_engine_sound && sfx_manager->sfxAllowed()) { - m_engine_sound->speed(0.6f + (float)(m_speed / max_speed)*0.7f); + if(isOnGround()) + { + m_engine_sound->speed(0.6f + (float)(m_speed / max_speed)*0.7f); + } + else + { + m_engine_sound->speed(1.4f); + } m_engine_sound->position(getXYZ()); } #ifdef XX This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-04-29 23:18:05
|
Revision: 5319 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5319&view=rev Author: mbjornstk Date: 2010-04-29 23:17:59 +0000 (Thu, 29 Apr 2010) Log Message: ----------- Ear candy, now engine noise fakes 3 gears. The faster you go, the faster it plays the engine noise, but with 3 ramps to make it sound like you changed a gear and the engine RPM went down a bit. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-04-29 22:45:16 UTC (rev 5318) +++ main/trunk/src/karts/kart.cpp 2010-04-29 23:17:59 UTC (rev 5319) @@ -1221,12 +1221,21 @@ // when going faster, use higher pitch for engine if(m_engine_sound && sfx_manager->sfxAllowed()) { - if(isOnGround()) + if(isOnGround()) { - m_engine_sound->speed(0.6f + (float)(m_speed / max_speed)*0.7f); + // Engine noise is based half in total speed, half in fake gears: + // With a sawtooth graph like /|/|/| we get 3 even spaced gears, + // ignoring the gear settings from stk_config, but providing a + // good enough brrrBRRRbrrrBRRR sound effect. Speed factor makes + // it a "staired sawtooth", so more acoustically rich. + float gears = 3.0f * fmod((float)(m_speed / max_speed), 0.333334f); + m_engine_sound->speed(0.6f + + (float)(m_speed / max_speed) * 0.35f + + gears * 0.35f); } else { + // When flying, fixed and fast engine noise to make it more scary m_engine_sound->speed(1.4f); } m_engine_sound->position(getXYZ()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-05-10 23:51:18
|
Revision: 5423 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5423&view=rev Author: hikerstk Date: 2010-05-10 23:51:12 +0000 (Mon, 10 May 2010) Log Message: ----------- Cosmetic change only. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-05-10 23:50:40 UTC (rev 5422) +++ main/trunk/src/karts/kart.cpp 2010-05-10 23:51:12 UTC (rev 5423) @@ -1383,8 +1383,9 @@ if(m_smoke_system) { float f=0.0f; - if(getMaterial() && getMaterial()->hasSmoke() && fabsf(m_controls.m_steer) > 0.8 && - isOnGround()) + if(getMaterial() && getMaterial()->hasSmoke() && + fabsf(m_controls.m_steer) > 0.8 && + isOnGround() ) f=250.0f; m_smoke_system->setCreationRate((m_skidding-1)*f); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-05-11 01:15:49
|
Revision: 5428 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5428&view=rev Author: mbjornstk Date: 2010-05-11 01:15:43 +0000 (Tue, 11 May 2010) Log Message: ----------- Adjust speed vector in all 3 axis, so going downhill (mostly Y motion) counts as going fast and is reduced, not just X and Z. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-05-11 00:43:03 UTC (rev 5427) +++ main/trunk/src/karts/kart.cpp 2010-05-11 01:15:43 UTC (rev 5428) @@ -1202,6 +1202,7 @@ velocity.setZ( velocity.getZ() * velocity_ratio ); velocity.setX( velocity.getX() * velocity_ratio ); + velocity.setY( velocity.getY() * velocity_ratio ); // Up-down too getVehicle()->getRigidBody()->setLinearVelocity( velocity ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-06-07 23:43:14
|
Revision: 5484 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5484&view=rev Author: mbjornstk Date: 2010-06-07 23:43:04 +0000 (Mon, 07 Jun 2010) Log Message: ----------- Disable AI cheat when skidding. All AI levels lose power now, like humans. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-06-07 22:08:15 UTC (rev 5483) +++ main/trunk/src/karts/kart.cpp 2010-06-07 23:43:04 UTC (rev 5484) @@ -1062,12 +1062,9 @@ if(m_speed > 4.0) engine_power *= m_power_reduction; - // Lose some traction when skidding, so it is not abused by player - // The AI will be allowed to cheat on medium and hard difficulty in - // order to make them more competitive (this might be removed once - // the AI is better). - if(m_controls.m_drift && - (race_manager->getDifficulty()==RaceManager::RD_EASY || m_controller->isPlayerController()) ) + // Lose some traction when skidding, to balance the adventage + // Up to r5483 AIs were allowed to cheat in medium and high diff levels + if(m_controls.m_drift) engine_power *= 0.5f; applyEngineForce(engine_power); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <mbj...@us...> - 2010-06-13 18:32:01
|
Revision: 5515 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5515&view=rev Author: mbjornstk Date: 2010-06-13 18:31:55 +0000 (Sun, 13 Jun 2010) Log Message: ----------- Change engine sound, while on air, to a less squeeky one (1.4 -> 0.9). Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-06-13 18:30:07 UTC (rev 5514) +++ main/trunk/src/karts/kart.cpp 2010-06-13 18:31:55 UTC (rev 5515) @@ -1244,8 +1244,9 @@ } else { - // When flying, fixed and fast engine noise to make it more scary - m_engine_sound->speed(1.4f); + // When flying, fixed value but not too high pitch + // This gives some variation (vs previous "on wheels" one) + m_engine_sound->speed(0.9f); } m_engine_sound->position(getXYZ()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-06-20 23:43:04
|
Revision: 5529 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5529&view=rev Author: hikerstk Date: 2010-06-20 23:42:58 +0000 (Sun, 20 Jun 2010) Log Message: ----------- Bugfix: terrain specific sfx was still played when the race was over. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-06-20 23:18:22 UTC (rev 5528) +++ main/trunk/src/karts/kart.cpp 2010-06-20 23:42:58 UTC (rev 5529) @@ -278,12 +278,9 @@ */ Kart::~Kart() { - //stop the engine sound - if(m_engine_sound) - { - m_engine_sound->stop(); - } - + //stop kart specific sfx + if(m_engine_sound) m_engine_sound->stop(); + if(m_terrain_sound) m_terrain_sound->stop(); // Delete all custom sounds (TODO: add back when properly done) /* for (int n = 0; n < SFXManager::NUM_CUSTOMS; n++) @@ -296,6 +293,7 @@ sfx_manager->deleteSFX(m_crash_sound ); sfx_manager->deleteSFX(m_skid_sound ); sfx_manager->deleteSFX(m_goo_sound ); + if(m_terrain_sound) sfx_manager->deleteSFX(m_terrain_sound); if(m_smoke_system) delete m_smoke_system; if(m_water_splash_system) delete m_water_splash_system; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-06-22 06:17:35
|
Revision: 5533 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5533&view=rev Author: hikerstk Date: 2010-06-22 06:17:29 +0000 (Tue, 22 Jun 2010) Log Message: ----------- Fixed incorrect position of terrain-specific sfx (though I still do not get positional sfx atm, but that might be a different issue??). Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-06-21 00:11:22 UTC (rev 5532) +++ main/trunk/src/karts/kart.cpp 2010-06-22 06:17:29 UTC (rev 5533) @@ -760,14 +760,17 @@ if(s!="") { m_terrain_sound = sfx_manager->createSoundSource(s); - m_terrain_sound->position(getXYZ()); m_terrain_sound->play(); m_terrain_sound->loop(); } else m_terrain_sound = NULL; } - if(m_terrain_sound) material->setSFXSpeed(m_terrain_sound, m_speed); + if(m_terrain_sound) + { + m_terrain_sound->position(getXYZ()); + material->setSFXSpeed(m_terrain_sound, m_speed); + } m_last_material = material; // Sometimes the material can be 0. This can happen if a kart is above This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-08-31 10:30:33
|
Revision: 5835 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5835&view=rev Author: hikerstk Date: 2010-08-31 10:30:26 +0000 (Tue, 31 Aug 2010) Log Message: ----------- Fixed auto-rescue when a kart is about to topple over. Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-08-31 09:12:18 UTC (rev 5834) +++ main/trunk/src/karts/kart.cpp 2010-08-31 10:30:26 UTC (rev 5835) @@ -719,7 +719,7 @@ m_skid_sound->position ( getXYZ() ); // Check if a kart is (nearly) upside down and not moving much --> automatic rescue - if((fabs(getHPR().getRoll())>60 && fabs(getSpeed())<3.0f) ) + if((fabs(getRoll())>60*DEGREE_TO_RAD && fabs(getSpeed())<3.0f) ) { forceRescue(); } @@ -1330,7 +1330,7 @@ ,m_body->getAngularVelocity().getX() ,m_body->getAngularVelocity().getY() ,m_body->getAngularVelocity().getZ() - ,getHPR().getHeading() + ,getHeading() ); #endif This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <hik...@us...> - 2010-09-02 22:42:42
|
Revision: 5874 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=5874&view=rev Author: hikerstk Date: 2010-09-02 22:42:35 +0000 (Thu, 02 Sep 2010) Log Message: ----------- Changed implementation of slipstream to make it less likely that AI will form 'trains': you have to slipstream for a certain amount of time, then (indicated by blue nitro sparks appearing) you will get a zipper boost. This avoids the previous issue that by getting a bonus even after a single frame of slipstream that trains are build (since an overtaken kart will become faster, it's easy for the overtaken kart to keep on getting slipstream bonus. Now the overtaking kart gets a zipper and is therefore far enough ahead of the overtaken kart as to not giving it a slipstream bonus). Modified Paths: -------------- main/trunk/src/karts/kart.cpp Modified: main/trunk/src/karts/kart.cpp =================================================================== --- main/trunk/src/karts/kart.cpp 2010-09-02 22:35:16 UTC (rev 5873) +++ main/trunk/src/karts/kart.cpp 2010-09-02 22:42:35 UTC (rev 5874) @@ -926,6 +926,9 @@ unsigned int num_karts = world->getNumKarts(); bool is_sstreaming = false; Kart *target_kart; + // Note that this loop can not be simply replaced with a shorter loop + // using only the karts with a better position - since a kart might + // be a lap behind for(unsigned int i=0; i<num_karts; i++) { target_kart = world->getKart(i); @@ -974,12 +977,13 @@ if(m_slipstream_time>m_kart_properties->getSlipstreamCollectTime()) { m_slipstream_mode = SS_USE; - //handleZipper(); // FIXME(/REMOVE?) Zipper gives a sharp push, maybe too sharp - //return 0; // see below about abusing m_zipper_time_left without zipper - return m_kart_properties->getSlipstreamAddPower(); + handleZipper(); // FIXME(/REMOVE?) Zipper gives a sharp push, maybe too sharp + return 0; // see below about abusing m_zipper_time_left without zipper + //return m_kart_properties->getSlipstreamAddPower(); } - m_zipper_time_left = 5.0f; // FIXME, this is a hack to test higher speed limit without zipper, better would be own counter - return m_kart_properties->getSlipstreamAddPower(); + //m_zipper_time_left = 5.0f; // FIXME, this is a hack to test higher speed limit without zipper, better would be own counter + return 0; + //return m_kart_properties->getSlipstreamAddPower(); } // handleSlipstream @@ -1471,6 +1475,11 @@ m_nitro->setCreationRate(m_controls.m_nitro && m_collected_energy>0 ? (10.0f + fabsf(getSpeed())*20.0f) : 0); + // For testing purposes mis-use the nitro graphical effects to show + // then the slipstream becomes usable. + if(m_slipstream_mode == SS_USE) + m_nitro->setCreationRate(20.0f); + float speed_ratio = getSpeed()/getMaxSpeed(); float offset_heading = getSteerPercent()*m_kart_properties->getSkidVisual() * speed_ratio * m_skidding*m_skidding; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |