JRobots is a browser-based programming battle arena similar to CRobots but written in Java.
Players can program their robots using a custom "mini-language" and watch them fight inside a deterministic (the same input always produce the same result) simulation engine.
Note: JRobots is still in development and still missing the main functionalities.
- Java 12 +
- Spring Boot
- Spring Web
- SpringBoot DevTools
- Lombok (optional)
- Maven
JRobots/
├── backend/
├── frontend/
├── pom.xml
├── README.md
└── .gitignore
JRobots/
└── backend/
├── api/ # REST API endpoints
├── bots/ # Built-in robots for testing
├── config/ # Currently EMPTY
├── dsl/ # Currently EMPTY
├── engine/ # Simulation engine (robots, bullets, physics)
└── replay/ # Replay data structures (snapshots + events)
- Robots can move and turn.
- Robots can fire bullets.
- Bullet have physics and collision detection.
- Energy-based damage system.
- Match result (WIN / DRAW).
- Replay generation.
- Event timeline per tick.
- Robots can scan the battlefield to find the opponent.
The game runs at a certain number of ticks per seconds during which a series of tasks are completed in order:
- Engine resets all the actions.
- Controllers request actions.
- Spawn bullets if fire is requested by a robot.
- Apply robot physics.
- Apply bullet physics.
- Detect collision between bullets and robots.
- Remove dead bullets.
- Generate events.
- Record snapshot.
Every match generates a replay containing the full history of the simulation by saving a snapshot at each tick.
A snapshot looks like this:
{
"tick": 42,
"robots": [
{ "id": 1, "x": 150.0, "y": 320.0, "energy": 80.0},
{ "id": 2, "x": 600.0, "y": 310.0, "energy": 10.0}
],
"bullets": [
{ "id": 12, "ownerId": 1, "x": 420.0, "y": 305.0}
],
"events": [
{ "type": "FIRE", "robotId": 1, "bulletId": 12 },
{ "type": "HIT", "bulletId": 12, "ownerId": 1, "targetRobotId": 2, "damage": 10 },
{ "type": "DEATH", "robotId": 2 },
{ "type": "END", "result": "WIN", "winnerId": 1 }
]
}Events are important gameplay actions that happen during a tick.
| Event | Description |
|---|---|
| FIRE | A robot fired a bullet |
| HIT | A bullet hit a robot |
| DEATH | A robot’s energy reached zero |
| END | The match ended (WIN or DRAW) |