https://github.com/typicalam/boomberman
Realtime multiplayer game, the man with the boom.
https://github.com/typicalam/boomberman
protobuf raylib tcp
Last synced: 12 months ago
JSON representation
Realtime multiplayer game, the man with the boom.
- Host: GitHub
- URL: https://github.com/typicalam/boomberman
- Owner: TypicalAM
- Created: 2023-11-10T07:04:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-19T09:53:08.000Z (about 2 years ago)
- Last Synced: 2025-02-15T05:29:00.995Z (about 1 year ago)
- Topics: protobuf, raylib, tcp
- Language: C++
- Homepage:
- Size: 457 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Boomerman
A multiplayer Bomberman-style game called "Boomerman" using the [Raylib](https://www.raylib.com/) game development library for graphics and [Protocol Buffers](https://protobuf.dev/) for message interchange between game clients and the server. This repository also has a test client written in golang.
Components:
- Raylib: Handles game graphics, input, and rendering.
- Protocol Buffers: Defines message formats for communication between clients and the server.
High-level architecture:
- Game Server: Manages game logic, state, and client communication using Protocol Buffers.
- Game Clients: Communicate with the server for game updates and display state using Raylib.
Workflow:
- Clients connect to the server and send/receive messages using Protocol Buffers.
- Server processes messages, updates game state, and sends updates to clients.
- Clients render game state using Raylib based on received data.
Considerations:
- Networking: Appropriate use of sockets for client-server communication.
- Game Logic: Implement Bomberman-style game rules on the server side.
- Serialization: Use Protocol Buffers for efficient message serialization/deserialization. This is the choice because it enhances rapid iteration - we do not need to reimplement different encoders and decoders for message types.
# Build & Run
## Game
Requirements:
- `cmake`
- `boost`, specifically `log` and `log_setup`
- `protobuf`
- `protobuf` development headers
- `C++` compiler
Run:
```bash
mkdir game/src/shared/proto
protoc --proto_path=$PWD/proto --cpp_out=$PWD/game/src/shared/proto $PWD/proto/messages.proto
cd game && mkdir build && cd build
cmake .. && make -j$(nproc)
./boomberman server # (or client, depending on what you need)
```
## Test client
Requirements:
- `go`
- `protobuf`
Run:
```bash
mkdir test-client/pb
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
protoc --proto_path=$PWD/proto --go_opt=paths=source_relative --go_out=$PWD/test-client/pb $PWD/proto/messages.proto
cd test-client
go run .
```