Recently I heard on radio about a student in game-development doing his exam paper on the importance of sound in videogames. Not surpringsingly he had drawn the conclusion that sound effects are very important. For example, when walking in different rooms, the sound of walking should match the sound you would actually hear in that environment.
For Rolling Coaster, I started adding sound rather late. But when I found decent sounds for events in the game, the game was improved a lot. Try looking at the following shot without sound, it won't give you the same feel of presence as it would with the sounds currently used.
Now, I'm not saying that I've used perfect soundeffects for everyting here... it's just that the sounds are way better than not having any sound at all! Also, there is a Doppler-effect on the frequency that really makes a huge difference (which is really simple to add, see wikipedia for the theory)
Rolling Coaster is a game where you control a ball on a racetrack. You can accelerate, break and speed-boost. The physics that govern the movement of the ball is derived from the torque/angular velocity and the forces acting on the ball: gravity and friction. Some of the equations that are needed look like this:
It's then a simple task (*) to derive the equation of motion for a rolling ball that may slide on the surface depending on friction.
After that, a numerical solution is needed, which is simply to replace the differentials with the actual differences during the integrating timestep. Presto! An advanced model of a rolling, sliding ball is created!
In the C# code it looks like this:
// Calculate friction wanted by ball float A = dt * (1.0f / I + 1.0f / (r2 * m)); Vector3 Bvec = -(1.0f / r2 * Vector3.Cross(radius, v0 + dt / m * gravAlong) + w0 + K * dt); Vector3 Bvec0 = 1.0f / A * Bvec; // Value of friction float fricWanted = Bvec0.Length() / rollinProp.radius;
That's not one line... it's, uh, 4 lines. Yes... and just a couple of more lines are needed to make a game out of it, right now 58518 and still counting.