Opposite lock racing, The movie

Since Bobjob fooled me into recording video of games I ended up creating a little trailer for a game that I am developing. I ended up using fraps and PowerDirector for various reasons though. As I now have a trailer I should probably show it:
http://www.youtube.com/v/NAGsqZtt0aE
The game uses Java2D and PaulsCode 3D Sound Engine.
The game is under development, but I will post link to game soon.

Update: You can now play and give feedback about the game.

See Opposite lock racing, The Game

Bahahahaha I loved the trailer! Very good looking game too! Are you planning to add multiplayer and/or AI soon?
Great job!

EDIT: I WANT COWS! ;D

Skid marks… definitely add skid marks!

ME TOO!!!

moooo
I am a cow!
moooooo

skidmarks is good

little orange cones that you can hit and have small physics(fall over/bounce/etc…) would be neat too

Great job, but the name? Why not something like Drifter (or some derivative).

And I vote for camels.

Thanks! I have been thinking about more cars (AI or human), but the current collision detection probably won’t handle it so well, and the game is actually quite difficult as it is I think. We will see.

They are in :slight_smile: Click on over to youtube and watch in HD and you’ll see.

I had an idea of creating a drift element in the game or make it entirely a drifting game, but it is REALLY difficult to make drfting easily controlled with a keyboard. I might still change the name of the game. Not final.

I’ll put it in the todo-list, but there are many things on there, so I am not making any promises. I don’t use any Phys lib, so it might be a lot of work to make that happen in a good way.

;D
I only have myself to blame… No. Cows in a car game would be stupid, even camels would be stupid. :smiley:

This game needs more cows. 8)

:’(
But that’s the fun part! Stupid == funny :smiley:

Hmm, actually it would be great to be able to select a cow as car :wink:

Looks really nice!

Very impressive!!! :point:

How about adding cheering pedestrians, that occasionally wander across the road and perhaps can be squashed by a car? Showing blood trails will be fun.

Looks good graphically, and judging from the video the handling of the car seems fun. Do you plan on adding AI-controlled cars? Or is it going to be just time trial?

Great! Tree collision was hilarious.

There are some clicks in the sound. I think it happens with volume changes, a sort of zippering effect? I’m can’t tell for sure what is causing it. It could be the change increment is too large, and if you tightened the granularity, you could use smaller vol. change increments. The area around 0:30-0:40 is an example of where this is happening. The very startup of the motor at the beginning has a nice click, too.

I’m wondering how I would implement this sound. Maybe I would store an array of values (floats allows decent computation) for the basic engine sfx, and use linear interpolation while looping through it at varying rates to get the different pitches & convert to the sound format you’ve chosen for output. I’ve written a mechanism for changing volume at the smallest possible increment, a single frame, and would be happy to share that. But it might be tricky figuring out where to put it if you are using library code. Also, if you are using a volume control, there might be a way to make it update more often (and thus allow smaller increments). But I suspect the Java’s Control implementation doesn’t work for updates smaller than a single read buffer of the sound.

Nice sound choices, though! I like the sound effects you have. Looking forward to trying out the game when it is up and running!

[EDIT: Here’s an attempt to make a varispeed looper. Still some bugs to work out but perhaps of interest.
http://www.hexara.com/VariSpeedLooper.jar
You can load .wav files and play them back by holding the mouse down. The vertical is for volume and the horizontal is for pitch/velocity. I put in some controls to allow the ends of the recording to overlap, either cross-fading or being added together. You would use the “merge tracks” if the recording ends already had fades from and to nothing at either end. I’m imagining putting a racing engine sound in there, and doing doppler type effects as the car speeds up or slows down. The .wav files should be 16-bit, 44100 fps, stereo, little-endian. I haven’t encoded other formats yet.
It plays pretty clean in terms of not clicking with volume/speed changes, though not perfect. I’m getting a funny bit of pitch shift back and forth though that I can’t account for (am using a linear interpolation algorithm for the varispeed) and a bit of fuzz/distortion for the overlap that I also can’t account for yet.]

You can now play the game (see link in first post). I think that the game is plenty difficult as it is without many distractions, and was mainly thinking about having the competition against an on-line highscore board.

Yes, that was bugging me as well, and I had the same idea as you, that the pitch/vol was changing to fast and therefore created the clicks, so I had the sound change a max value for each param per game loop. As it turns out, that wasn’t the problem (or at least not the main problem). I found out that I was setting the pitch to 1 (max) using the PaulsCode and that created clicks. Capping at 0.99 seemed to improve things a lot. There might still be some problem here and there but it is now a lot better.

Test it here

The sound is very good now! (Well, it was a good exercise, writing my own volume/pitch-shifter. Am learning a lot.) Yes, I think the range for wav is -32768 to 32767, and the 32768 would constitute an overflow and click, depending upon the algorithm. (If the algo has -32768 = 0 or -1, the expectation might be that 1 is also possible, but it is not.) That’s good to know that PaulsCode is handling the pitch change and volume changes perfectly well.

I enjoyed driving around. The crashes are fun! So are donuts. I can’t manage to run the racetrack very well though. The controls felt laggy to me. I definitely tend to oversteer. I stop but the wheels continue to turn just a little bit more. Is there a way to make the steering more responsive? How is it being handled? Just a normal keystroke listener sort of thing? [Doh, just realized. The turning keys leave the wheel in a position. Releasing them does NOT revert the wheels to straight.]

Just a thought, perhaps create a little dashboard with a wheel that can be turned via mouse drag? This makes it clearer where the wheels are currently, unlike arrow key presses.

I wanted to split steering with accel/brake between my hands but this is a bit tricky with the arrow keys. Hmmm–idea that I can try, no new coding needed: put numlock off and use the arrow keys for one hand and the number keys for the other.

Well there are two things happening.

  1. As you already noticed is that the wheel does not “snap” back to straight ahead when you release the wheel. This is so that you can tap the turn keys and not always get max turn or straight ahead. It may take some getting used to, but it gives you more control once mastered.
  2. The game handles physics a bit more realistic than many other top down racing games. The car has angular momentum, roughly meaning that if you for example turn right, the car rotates clockwise. If you then align the wheels straight ahead, the car wants to maintain the clockwise rotation. (Similar to a car moving forward it won’t immediately stop when you let go of the accelerator). If the rotating force is greater than what the tires can provide an opposite force for, the car will continue to rotate clockwise until the tires can stop the rotation. If the tires use up grip to accelerate or break it will have less force to stop the rotation. The angular momentum is partly what causes oversteer (and understeer), and the reason you need to apply opposite lock :wink: Opposite lock is fun once you get the feel for it, so I really don’t want to take that away 8)

Tips to get started.
Use the “Alpha” car to begin with. Play around at the skidpad. In the game, press “F1”, and you will get to a debug menu. There you can move the sliders for “Turn speed” and “Angular weight” all the way to the right and maybe tyre friction a bit as well. You will then have to reduce the “max turn” to the leftmost setting. It will then probably be easier, but not as fun to control the car. :’(

The bus will naturally mostly understeer as well, so it is easy to control, and is actually quite good for finding the best path through the tracks.

You can also press “W” to display the steeringwheel, but I feel that the game is to high-paced to be useful and it is mostly in the way.

Ideas for types of vehicles:

  • Tank
  • Humvee
  • Tractor
  • Dune buggy
  • Monster truck
  • Snow sled (not like Santa snow sled, but the motorized one)