A multiplayer game where the main mechanic to win is forming temporary alliances.
- The game is played in rounds.
- Each player spawns as a circle and has a unique set of resources they need to collect to win.
- Resources are collected from mines by bumping into them.
- The first player to reach their goal of resources wins.
- Players can form groups with other players by merging their circles into a group.
- The larger a group is the faster it moves/mines and when mining resources are divided among members.
- A player may leave a group and become a solo circle at any time.
Custom engine written in C++11 using the SFML framework.
Created by @sourenp and @copacetic mostly for learning purposes.
- You can statically link libraries by setting the cmake flag
-DUNGROUP_STATIC=TRUE
- If you are running from a remote server, you might need to open the tcp and udp ports on your machine.
- Set a variable by adding the arg
-GVAR_NAME=TRUE
to cmake
Variable | Meaning |
---|---|
UNGROUP_STATIC | Statically link SFML |
BUILD_TESTS | Build tests |
ONLY_SERVER | Only build server |
ONLY_CLIENT | Only build client |
git clone https://github.com/SourenP/ungroup_game.git
cd ungroup_game
cmake -S . -B build
cmake --build build -- -j
./build/src/server/ug-server
./build/src/client/ug-client
git clone https://github.com/SourenP/ungroup_game.git
cd ungroup_game
The server currently doesn't build on windows (#194)
cmake -DONLY_CLIENT=TRUE -DSFML_DIR="Path/to/SFML/lib/cmake/SFML" -DBOOST_ROOT="Path/to/Boost" -G "MinGW Makefiles" -S . -B build\
cmake --build build
.\build\src\client\ug-client.exe
The server currently doesn't run on windows (#194)
.\build\src\server\ug-server.exe
- Build with the cmake flag
-GBUILD_TESTS=TRUE
- Run tests
./build/tests/ug-test "~[skip]"
Custom engine written in C++11 using the SFML framework.
Features:
- Game functionality
- Variable time step
- Unique ID system for game objects
- Physics
- Velocity with lerping
- 2D Circle collision detection and handling
- 2D Circle perfect ellastic collision impulses
- Networking
- Server-Client separation
- Authoritative server
- Multi threaded UDP/TCP communication between server and client
- Reliable (TCP) and Unreliable (UDP) updates
- Networked physics
- Hermite Interpolation
- Event updates
- Tick sync
- Works locally and over the internet
- Rendering
- 2D Cirlce shapes, textures and shaders
- Animations with texture sprite sheets
- Parallax background
- Variable window size support and zooming/scaling
- Camera centering
- Resources
- Resource manager for textures, fonts, and shaders
- Levelling
- Configurable levels
- UI
- Client HUD with configurable elements that are alignable to window edges
- Server terminal ui with tables and panes that displays real time statistics
- Bots
- Template for writing bots that query game state and input moves as a client
- Events
- Custom event objects with data
- Subscribe callback to event
- Metrics
- Track temporal metrics
- Util
- 2D vector operations
Create a new release and write notes in Wiki: Playtesting
- When you create/delete a file you need to add the
<new_file>.cpp
to the correspondingCMakeLists.txt
file.
- We use Catch2 for testing.
- Add tests for a file in a mirror directory under
tests/
. - Test file should be named
tests-<FileName>.cpp
- Add a test tag for each subdirectory and the file name.
todo(username|#issue|date): description
- We use ClangFormat. You can use the xaver.clang-format VSCode extension to automatically format.
- Class member variables have the style
m_camelCase
. - Class methods have the style
camelCase
. - Local variables have the style
snake_case
. - Variables with the suffix
_t
are used by multiple threads and have a corresponding<var>_lock
mutex. - Variables with the suffix
_ta
are used by multiple threads but don't have a mutex because they are atomic.
To compile in debug mode add the flag -DCMAKE_BUILD_TYPE=Debug
:
cmake -DCMAKE_BUILD_TYPE=Debug -S . -B build
cmake --build build -- -j
Compiling in debug mode will give you stacktraces for segfaults and detect memory issues.
Use gperftools (cpuprofile tutorial)
In vscode on a mac you can debug using lldb
.
Link: https://marketplace.visualstudio.com/items?itemName=webfreak.debug
Set tasks.json
to: https://gist.github.com/SourenP/46d3f5282de7fd7ecaf681384fc8e4dc
Set launch.json
to: https://gist.github.com/SourenP/47746e0c2b39545975f8e7768e281849
Debug build:
CMD
+SHIFT
+P
>Tasks: Run Task
>build_debug
Debug run:
- Set breakpoints
- Run
(lldb) Launch ug-server
and/or(lldb) Launch ug-client
via the debug tab.
Run this command to enable debug mode on a specific build: https://gist.github.com/SourenP/3ae15ba0e634a3e0ccceebbb7a27a391