2DRacer - Online Multiplayer 2D Racing Game

Hello guys,

I want to showcase my game “2DRacer”. Its a OnlineMultiplayer 2D Racing game like for example Mario Kart.

Features: - play online vs friends
- add AI-Cars to fill up the contestants
- use Items to your advantage
- hunt for trackrecords
- global ELO-Rating

http://2dracer.com is the website, at the moment its in german so for all non-german-speaker here is the direct download link http://2dracer.com/download/2DRacerStart.jar (the game itself is in english)

Controls are very simple: arrow up = accelerate arrow down = break arrow left = turn left arrow right = turn right space = use Item
To switch Fullscrenn on and off press ESC

Right now its a desktop application because i dont own a extremely expensive certificate to use it in a java-applet.
I used slick2d and kryonet to code it.

wow pretty nice. I didn’t expect collisions between players. Looks like all the code its working fine, but I must say that with a ping of 250ms the gameplay becomes kinda weird. Maybe you could try to implement some “user prediction techniques” or “interpolation/extrapolation” to avoid lag problems and make the client game more fluid. This is kinda hard to do, btw.
Here some info (the demo it’s pretty clear about what it’s this about): http://www.gabrielgambetta.com/fast_paced_multiplayer.html

You made a fast-paced multiplayer game wich is one of the most difficult thing to do (at least for me xD)

Congratz and very nice work!

Big thanks man! you are right with the high ping, when i started coding it i tried to use some prediction techniques, but i got stuck at the point where i had to predict collisions between my own car on the client and the other connected cars :confused:

*edit: right now everything is done serverside

where are you from? the server is in central europe.

Im from Argentina.

The collision between cars is the big problem. Leaving that appart, you can do a local gameplay at 60fps. Every…lets say 100ms or 200ms the server will have info about that player (the local one). In this case, a different thread in the client is necessary to send and receive packages from the server. So…in 1second you will have (luckily) 10 or 5 fps for that car (on the server). One simple way to solve that is “believing” that the car will have the same speed and direction until next package arrives. You do the same on the client side for the other cars and something more or less playable will come out of there (Tm Nations looks that works that way http://trackmaniaforever.com/). But, with this approach there is NO COLLISION between cars. Instead you are getting a decent gameplay.

If you want to have collisions, there will be probably the necessity of interpolation.
Here Valve shows how the Source engine works on this point: https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking

The client must run in the “past”, so the server can calculate the exact position of everyone on the race and do the maths and then give the results to every client.
This is the hell of hells lol

yeah, i also read through all those articles. i am just happy that my game is playable with <150ms ping :smiley:

I just edited the startpost. the website is now in the a .com domain (www.2dracer.com and in english!

I also fixed some bugs, added some tracks,qualifying and some more little gimmicks :wink: