All Projects → drpatrik → combatris

drpatrik / combatris

Licence: GPL-2.0 license
A "perfect" implementation of an old classic

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects
python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to combatris

Fairtris
Clone of the official classic Tetris® game for the NES console, intended for Windows and Linux systems. It implements the original mechanics and includes many regional versions and several RNGs (all in one executable).
Stars: ✭ 30 (+50%)
Mutual labels:  tetris, sdl, sdl2
nox-decomp
Unofficial Nox (2000) port to Linux using decompiled code from https://playnox.xyz
Stars: ✭ 21 (+5%)
Mutual labels:  sdl, sdl2
Tom and Jerry
A multiuser AR game based on ARKit 2 and MultipeerConnectivity
Stars: ✭ 24 (+20%)
Mutual labels:  multiplayer, joystick
RustTetris
Tetris Made in Rust and SDL2
Stars: ✭ 18 (-10%)
Mutual labels:  tetris, sdl2
Teeworlds
A retro multiplayer shooter
Stars: ✭ 1,712 (+8460%)
Mutual labels:  multiplayer, sdl2
Segs
💪 SEGS - Super Entity Game Server
Stars: ✭ 190 (+850%)
Mutual labels:  multiplayer, multiplatform
sdl stb font
Renders text using STB_Truetype in pure SDL
Stars: ✭ 40 (+100%)
Mutual labels:  sdl, sdl2
Openspades
Compatible client of Ace of Spades 0.75
Stars: ✭ 769 (+3745%)
Mutual labels:  multiplayer, sdl2
ffi-sdl
PHP FFI SDL bindings
Stars: ✭ 23 (+15%)
Mutual labels:  sdl, sdl2
Driftwood
Driftwood 2D Tiling Game Engine and Development Suite
Stars: ✭ 23 (+15%)
Mutual labels:  sdl, sdl2
Openrct2
An open source re-implementation of RollerCoaster Tycoon 2 🎢
Stars: ✭ 10,115 (+50475%)
Mutual labels:  multiplayer, sdl2
sdl12-compat
An SDL-1.2 compatibility layer that uses SDL 2.0 behind the scenes.
Stars: ✭ 99 (+395%)
Mutual labels:  sdl, sdl2
Soldat
Soldat is a unique 2D (side-view) multiplayer action game
Stars: ✭ 1,199 (+5895%)
Mutual labels:  multiplayer, sdl2
Supermariowar
A fan-made multiplayer Super Mario Bros. style deathmatch game
Stars: ✭ 200 (+900%)
Mutual labels:  multiplayer, sdl
Frag.exe
Multiplayer First-Person Shooter written in C++ using my own engine, Qor
Stars: ✭ 8 (-60%)
Mutual labels:  multiplayer, sdl
gnuboy
latest version of original laguna source, with a handful fixes for modern compilers and systems
Stars: ✭ 70 (+250%)
Mutual labels:  sdl, sdl2
Gwork
Skinnable GUI with useful widget collection. Fork of GWEN.
Stars: ✭ 179 (+795%)
Mutual labels:  sdl, sdl2
Haskanoid
A breakout game in Haskell using SDL and FRP, with Wiimote and Kinect support.
Stars: ✭ 242 (+1110%)
Mutual labels:  sdl, sdl2
fourinarow-app
An online version of the popular game four in a row, written in Flutter + Dart on the client and Rust on the server side.
Stars: ✭ 23 (+15%)
Mutual labels:  multiplayer, multiplatform
guisan
A C++ SDL2 user interface library based on guichan. ~~~~ Nov, 2021 - This project is not abandoned, just not under active development. Pull requests will be accepted and new releases will be generated for new features / bug fixes.
Stars: ✭ 54 (+170%)
Mutual labels:  sdl, sdl2

COMBATRIS - A clone of an old classic

screenshots screenshots screenshots screenshots

Combatris has been tested and works under Windows 10 and 11 (x64 only), OSX 10.13 - 12.3, Raspian GNU/Linux 9/10 (stretch/buster) and Ubuntu 16 / 20. Multiplayer on the same host has been tested on Windows 11 and OSX 12.

Feature Support
Hold Piece Yes
Next Pieces shown 3
Lock Delay with cancel Yes
Wall kicks SRS
Infinity limit 15
Bag randomizer 7-bag
Top out Line at 22
Levels 15
Level advancement 10 lines / 5 * level Marathon
T-Spin recognition 3-corner with kicks
Back-to-back Recognition Combatris / T-spin

Features Combatris, Marathon, Sprint, Ultra, Royal campaigns in single and multiplayer mode and Battle campaign in multiplayer mode:

  • Combatris and Marathon: The winner is judged on score.
  • Sprint: The fastest player to clear 40 lines are the winner.
  • Ultra: Clear as many lines as possible within 3 minutes.
  • Royal: A new line is spawned every 6 second survive for 2.5 minutes and score as much as possible
  • Battle: Judged based on number of lines sent and knockouts (you send so many lines that the opponent cannot perform a valid move).

The multiplayer mode is using a voting mechanism to ensure that all participants are playing the same campaign. The voting rules are simple; the campaign with the greatest number of players wins and any player that wanted to play another campaign is rejected. If there is a draw between the number of players Battle will be prioritized. Any player alone in a campaign will be rejected.

Combatris now supports multiplayer on the same computer. Where one player play using keyboard while the other play with an gamepad. In theory there is no limitations on the number of players except for screen estate. When several players share the same computer the multiplayer pane can be removed to save screen estate.

Combatris supports both keyboard and gamepads. The game has been tested with:

  • Logitech F310 Gamepad
  • PS3/PS4 Controller
  • Retroflag Classic USB Gamepad
  • 8Bitdo NES30 Gamepad

The game supports all gamepads currently included in SDL_GameControllerDB. A version of the file can be found in the assets folder. Feel free to update it to the latest version.

I have tested the game with up to five players running on a heterogeneous set of computers using both wifi and tethered connections. The game works well but there can be a slight lag.

Since its only me playing, and sometimes the family when they feel pity for me, the game most probably have many bugs left.

Keyboard Commands

Key Action
N New game
F1 / P Pause
H Hide multiplayer pane
Q Quit
CTRL / Z Rotate counter clockwise
Up / X Rotate clockwise
Left Move Left
Right Move Right
Down Soft Drop
Space Hard Drop
Shift / C Hold piece

Gamepad Commands

screenshots

Key Action
Start New game
Select Pause
X Hide multiplayer pane
A Rotate clockwise
B Rotate counter clockwise
Left Move Left
Right Move Right
Up Hard Drop
Down Soft Drop
Shoulder Buttons Hold piece

The layout of the example gamepad will be true even if the buttons have other label's then the label's depicted. You can use SDL2 Gamepad Tool to add mappings if you have a gamepad that is currently not supported.

Scoring - Combatris Campaign

Action Points
Single/T-Spin Mini 100×level
T-Spin Mini Single 200×level
Double 300×level
T-Spin 400×level
Triple 500×level
Combatris/T-Spin Single 800×level
B2B T-Spin Single/B2B Combatris 1,200×level
T-Spin Double 1,200×level
T-Spin Triple 1,600×level
B2B T-Spin Double 1,800×level
B2B T-Spin Triple 2,700×level
Combo 50×combo count×level (singles only for 20)
Soft drop 1 point per cell (Max of 20)
Hard drop 2 points per cell (Max of 40)

Lines Cleared - Marathon Campaign

Action Lines Cleared
Single 1
T-Spin Mini 1
T-Spin Mini Single 2
Double 3
T-Spin 4
Triple 5
Combatris 8
T-Spin Single 8
T-Spin Double 12
T-Spin Triple 16
Back-to-Back Bonus 0.5 x Total Line Clears

Finish all 15-levels are considered a win.

Lines Sent - Battle Campaign

The “got lines” pane are divided into two sections. The first section shows the number of received lines that has not been inserted into the matrix. At this point you can perform a counter attack to decrease the number of received lines by performing a move that sends lines over to your opponents. When the move has been commited any number of lines left in the first section will be added to your matrix and to the second section of the panes which show the number of solid lines in the matrix. You cannot send any lines until you have cleared all the solid lines in the matrix.

Move Lines Sent (Lines per combo step)
Single 0
Double 1
Triple 2
Combatris 4
B2B Combatris 6
Perfect Clear 10
T-Spin 0
T-Spin Mini Single 1
T-Spin Single 2
T-Spin Double 4
T-Spin Triple 6
B2B T-Spin Mini Single 2
B2B T-Spin Single 3
B2B T-Spin Double 6
B2B T-Spin Triple 9
0 Combo 0 (0)
1 Combo 1 (1)
2 Combo 2 (1)
3 Combo 4 (2)
4 Combo 6 (2)
5 Combo 9 (3)
6 Combo 12 (3)
7 Combo 16 (4)
... Combo ... (4)

Progress for new features / improvements

  • Change joystick settings to follow the standard
  • Use SDL_GameControllerDB
  • Add support for several players on the same computer
  • Remove the pane for showing combo/latest move and display combo/last move direct on the frame
  • Sound
  • Add new animation for combo/last clearing move
  • Add support for Internet online play

Network Considerations

The default port is 11000 and Combatris will try to auto detect the broadcast address. This will work fine as long as you do not have two active network interfaces (e.g. wifi and ethernet). I do not recommend having more then one active network interface when playing.

If auto detection of broadcast address failed default will be used (192.168.1.255).

Set the environment variables COMBATRIS_BROADCAST_PORT and COMBATRIS_BROADCAST_IP to change the port and broadcast IP accordingly.

The network protocol is UDP based and uses a sliding window for handling lost and out of order packages.

Build Combatris

Dependencies:

  • C++17 compliant compiler (tested with clang 5/6/8/9, AppleClang-10.x.0 or later, Visual Studio 15/16.x.x/17.x.x, GCC 7.x.x and 9.2.x)
  • cmake 3.10.0 or later (Windows) or 3.5.0 or later (OSX/Linux)
  • git
  • SDL2 (x64 only)
  • SDL2_ttf (x64 only)

The test suit requires catch - Catch will be automatically downloaded and installed as part of the build process. Catch2 version is set to v2.13.3 and can be changed by editing CMakeList-Catch.txt

OSX / Linux

Install the required libraries with apt/brew or any other package manager. Under Linux / Raspian install libsdl2-dev and libsdl2-ttf-dev

Builds the project, default is a release build. Ninja is used if available:

make

Starts the game:

make run

Runs the test suit:

make test

Run cppcheck (if installed) on the codebase with all checks turned-on:

make cppcheck

Raspian GNU/Linux

You need to activate the OpenGL driver otherwise the game will be far too slow.

The code builds cleanly and has been tested with GCC 7.3 (with some warnings) 9.2 and Clang 6 / 8 / 9. instructions how to install the compilers can be found here:

https://solarianprogrammer.com/2017/12/08/raspberry-pi-raspbian-install-gcc-compile-cpp-17-programs/ https://solarianprogrammer.com/2018/04/22/raspberry-pi-raspbian-install-clang-compile-cpp-17-programs/

You need to set these environment variables before running make:

export PATH=/usr/local/gcc-7.3.0/bin:$PATH
export CXX=gcc-7.3.0

or

export PATH=/usr/local/clang_6.0.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/clang_6.0.0/lib:$LD_LIBRARY_PATH
export CXX=clang

If you install a newer version of gcc or clang ensure that you update PATH/LD_LIBRARY/CXX settings accordingly.

Ubuntu

The code builds cleanly and has been tested with Clang 5.0.0, 6.0.0 and 9.0.0

64-bit Windows 10 and Windows 11

The code has been tested with Visual Studio Community Edition 15.x.x, 16.x.x and 17.x.x. Using the following settings:

Download the latest versions of the development libraries at https://www.libsdl.org.

Set the following environment variables (see System Properties/Environment Variables...):

SDL2DIR SDL2TTFDIR

Example: SDL2DIR C:\SDL2-2.0.5

The PATH environment variable should include both libraries lib\x64 directories

Example: PATH C:\SDL2-2.0.5\lib\x64;C:\SDL2_ttf-2.0.14\lib\x64

Generate Visual Studio project files with CMakeSetup.exe (Choose Visual Studio 15 2017 Win64 as generator)

Credits

Some sources has there own license and is not covered by the source codes license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].