2025-12-26.03-37-00.mp4
Rocket Cars is a free open-source server-authoritative physics-based multiplayer car game sample, inspired by Rocket League. It’s made in Unity using Netick, a powerful free networking solution that makes creating complex multiplayer games like Rocket League simple and easy for indie developers.
Join our discord for support.
Support Policy: This is an educational resource. Support is provided for learning purposes only. Asset flips or minimal-effort derivatives will receive no support.
- Clean and documented code
- Fully server-authoritative simulation (cheating is impossible)
- Fully predicted physics for all cars and the ball
- Custom vehicle physics model, inspired by Rocket League
- Goal replay system
- Full-match replay mode (using Netick's built-in full-game replay system)
- Custom field shader
- Camera Effects
- In-Game Text Chat
Rocket Cars uses Unity’s legacy input system (Input API).
- A / D – steer left / right
- W / S – accelerate / brake (also controls pitch up / down while airborne)
- Q / E – air roll left / right
- Left Mouse Button (button) – rocket
- Right Mouse Button (button down) – jump
- Space: switches between car-oriented and ball-oriented camera modes
- Middle Mouse Button (while grounded and on car-oriented camera): reverses the camera direction
When the game is in replay mode (Sandbox.IsReplay == true), normal gameplay input is disabled and the following controls become available:
- Free camera
- Following a selected player
1selects player index 02selects player index 1- etc.
If the selected player is no longer valid (e.g. disconnected or not spawned), the replay camera automatically falls back to free mode.
- Running a client player: start the game and connect to a server
- Running a host player: start the game and choose host. Now, with proper port-forwarding, other people can join the game by using your IP address
- Running a dedicated server: by simply starting the game in batch-mode, it would automatically run the game as a dedicated server
Soccer: Implements the Soccer game mode and handles overall game managementCarController: Contains the vehicle simulation logic, using a custom lightweight physics modelBall,GoalBox,Booster: Core interactive game elementsGoalReplaySystem&GoalReplayable: Handles server-side goal replay system (recording and playback), using Netick state storing/reseting APIUI Folder: Contains all user interface logic, designed to be independent from the gameplay layer
In most games, only the local player character and some environmental objects are predicted. However, in Rocket Cars, we predict everything: the local player car + other players and the ball (remote/proxy objects).
However, due to latency, it's impossible to properly predict other (remote) players, since we can't predict their inputs. Thus, the client's prediction of other players will often be wrong, and it gets much worse at higher pings (>100ms). To mitigate this problem, we use a feature of NetworkTransform/NetworkRigidbody called Prediction Error Correction Smoothing to smoothly correct the error over multiple frames. Without that, the game would appear jittery because each time a correction comes in from the server, we would reconcile with the server and appear in a vastly different location instantly (prediction error magnitude scales with ping).
Read Netick's Prediction In-Depth article to learn more about Rocket Cars networking.
In addition, this is a nice video about Rocket League that describes the same networking-related issues inherent to proxy/remote prediction.
The game is written performantly, and it should run over 300 FPS even on low end PCs.
Because Rocket Cars uses physics prediction, it must resimulate the physics engine (Unity's 3D physics engine PhysX) during reconciliation. Unfortunately, PhysX is:
- Slow during resimulation: problematic for lower-end or mobile devices.
- Not deterministic: leading to potential mispredictions that shouldn't happen otherwise, especially at high ping.
Future improvement suggestion: Use a deterministic and CSP-ready third-party physics engine for better performance and accuracy.
Massive thank you to Steak and Milk-Drinker01 for being invaluable during the development of this sample. Steak completely cleaned up the project and overhauled the graphical style, and Milk-Drinker01 created a beautiful field shader and fixed the camera jitter issue.
| Asset | Source | License / Terms |
|---|---|---|
| DOTween | Demigiant | Standard EULA |
| Low Poly Car Pack 1 | Designer Soup | Custom |
| Toon Shader | Erik Roystan | MIT |
| Textures | FreePBR & Free3DTextures | Custom |
| ParticlePack | Unity Technologies | Unity Asset Store EULA |
| Game Countdown 62 | Pixabay | Pixabay License |
| car-tire-squeal-skid-loop | opengameart.org | CC BY 3.0 |
| Vehicle - Essentials | Nox_Sound | Unity Asset Store EULA (permission granted for this project) |
| Font Electrolize | Google Fonts | Open Font License (OFL) |