WIP fighting game engine
Find a file
2025-05-17 22:18:30 -04:00
fighters Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00
mus Fix the game not starting with two players of fighter 0 when ran without 2024-11-23 13:32:05 -05:00
scripts Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00
sfx Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00
spr Crop more sprites, give them proper offsets, add some more sprites to 2025-05-11 17:30:08 -04:00
stages Edit documentation, tweak AI a bit, make stages use function pointers 2025-05-17 21:44:36 -04:00
ai.h Edit documentation, tweak AI a bit, make stages use function pointers 2025-05-17 21:44:36 -04:00
constants.h Port MWJ's audio and rendering engine, change how assets are handled by 2025-05-07 19:52:08 -04:00
data.h Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00
DOC.md Edit documentation, tweak AI a bit, make stages use function pointers 2025-05-17 21:44:36 -04:00
game.h Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00
LICENSE_CC0.txt Add CC0 license, change music, add very shoddy camera code 2024-10-05 20:58:50 -04:00
main_sdl.c Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00
make.sh Crop some Lukifer sprites, add extra Lukifer palettes, note some bugs 2025-05-09 22:05:23 -04:00
README.md Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00
renderer.h Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00
settings.h Edit documentation, tweak AI a bit, make stages use function pointers 2025-05-17 21:44:36 -04:00
sound.h Rename power sound and remove laugh sound, make HUD draw other fighters 2025-05-17 22:18:30 -04:00

ANARCHIC BRAWL (working title)

Anarchic Brawl is a suckless, public-domain, free software fighting game engine.

VERSION v0.5: Engine is rather usable, just needs helpers and a more complete Lukifer, as well as match starting via the command line. Maybe also some weaks and reworks to the engine, e.g. make AI part of fighters' step code, clean up some functions. It's probably not as efficiently programmed, either. Some tests will have to be done for checking that.

What Makes This Game Special

  • 100% public domain (CC0 + waiver of remaining rights) and free software. Everything was made from scratch to ensure complete legal safety.
  • Programmed sucklessly: C99, minimalist, using only fixed-point integers, with the only real dependency being stdint (which could be replaced with some defines).
  • Completely noncommercial: No ads, microtransactions, spyware, etc. are in this game. This is made for the people, not for profit.
  • No unnecessary features by default: Being a suckless video game, Anarchic Brawl omits several "killer features" in favor of keeping things simpler; there is no Z axis, no sprite / hitbox rotation, no game mechanics from "modern" fighting games (bursts, combo from knockdown, afterimages), not even menus. All of this could be implemented by users, but the base game is quite minimal.
  • Creating custom fighters / stages is easier: The needed tools are all in the source code of the game, and are simple to use and understand. This sentiment extends to the data formats as well, being minimal and documented.

To-do

  • Implement a way for fighters to grab someone else, or put them in a custom state belonging to the attacker (DONE, NEEDS TO BE FLESHED OUT)
  • Find a way to solve simultaneous attacking
  • Add fighter "meta data" that contains decorative information like hurt sprite indexes for a given fighter
    • 0 = Standing hurt sprite
    • 1 = Crouch hurt sprite
    • 2 = Air hurt sprite (generic)
    • 3 = Air hurt sprite (going up)
  • Implement command line parameters
  • Add time
  • Crop Lukifer's sprites
  • Make another fighter, maybe GNU FreeDink's Dink Smallwood or some amalgamation of OGA assets

Bugs

  • Lukifer:
    • Lukifer's hitboxes aren't properly laid out.
    • Lukifer's angle grinder animation is a bit wonky.
    • Lukifer's sprites need to be cropped and realigned.
  • The renderer doesn't like odd-width sprites.
  • Getting hit in a specific way by a specific attack (presumably Lukifer's grab) can segfault the game by somehow directing the stage's sprite pointer somewhere else.
    • Maybe fixed? Stages no longer use sprite pointers, but function pointers instead. Stage step code may not be run, check that
  • Function pointers in fighters aren't type safe; they use void pointers since the fighter struct can't reference itself during creation and typedef structs cannot be forward declared. Likely causes the overwriting of the stage sprite.
  • Player 1 getting hit by player 2 causes player 4 to move??
  • If 1 player on both sides are dead in a 2v2 match, the round is considered over.

How to Play

This will use the SDL2 frontend's method as a basis. You can see a general synopsis in each frontend's file.

To start a basic match, you can do ./AnarchicBrawl 0 0. This will start a 1v1 match where both characters are index 0, usually Lukifer in an unmodified AB build. Depending on the level of consoomerism you wish to have, you may make a "menu" for yourself to use for starting fights, e.g. with a Bash script or directly inside a frontend.

Params are as follows:

  • -mX: Set match type. 0 gives a standard match where all fighters are active, 1 gives a "turns" match where players on each team will replace their fallen teammates, continuing until one team is wiped out.
  • -cX: Give a player CPU control. Starts from 0 for player 1. Odd numbers (1, 3, 5, ...) will be on the RIGHT side, otherwise on the LEFT. For example, -c0 will give player 1 (left side) CPU control. -c3 gives player 4 (right side) CPU control.
  • -sX: Offsets the RNG seed using the character given.
  • -wX: Set win limit (best of X). Doesn't apply in match type 1
  • -t: Enable training mode. Fighters will be immortal and power will always be at max.

General Gameplay

If you've ever played Ikemen GO or any traditional fighting game before, you should be familiar with how this game plays.

Both fighters spawn on opposite sides of each other at the start of the round. The objective is to K.O. your opponent with the use of various attacks. You may guard by holding the opposite direction your character's facing when your opponent is attacking.

Some differences from typical fighting games:

  • Input combos (e.g. quarter circles) are gone in favor of simple direction + button inputs. It lowers the skill ceiling and also allows for simpler input.
  • By default, the game comes with no menu. You start fights by executing the game with certain parameters.
  • The HUD is much simpler; no combo counter, no animations, just the essentials.
  • Characters only have two hitboxes; one for colliding with hits, and one for hitting.

Making Fighters

Fighters in Anarchic Brawl have their code and assets embedded into the executable, as in they are compiled into the game itself. They use C and a script for embedded sprites and sounds. Typically, one should include the code in the fighters folder, both for the fighter's own code and the assets.

ROOT/
  fighters/
    dude.h
    dudeASSETS.h

The dudeASSETS.h file will be #included in dude.h, which will then be #included in game.h. Ideally there should be some sort of script or patch file that does that for the player automatically, to minimize digging into the code.

Adding Fighters

To add a fighter, ensure that the needed code is inside the fighters directory, then go to game.h. Assuming you patched a character called "Dude" into the game, the code may look like this:

QnA

Can I use MUGEN / Ikemen GO characters?

No. If you really want a MUGEN or Ikemen GO character in the engine, you'll have to port them yourself, which itself can be a tricky job since Anarchic Brawl is a very different engine.

Where can I find characters for this game?

Nowhere else yet. This is still obscure and even then I myself will only link to characters that are libre through and through. You can make some yourself if you'd like!

Why??

I made this game / engine out of frustration of Ikemen GO being open $ource and not really caring for software freedom, in that it comes with proprietary (CC-NC) assets, doesn't provide libre tools for modifying Elecbyte's proprietary sprite and sound formats, and doesn't provide an alternative asset loading method for those who don't wish to be bound to proprietary formats. That, and Ikemen GO is quite bloated, being written in Go and aiming for MUGEN compatibility, which is itself a quite bloated game.

Yes, I know I made a free data pack for Ikemen GO, but I discontinued it because of the aforementioned lack of tools for asset editing.