# Anarch

*Poor man's [Doom](doom.md)?*

Anarch is a [LRS](lrs.md)/[suckless](suckless.md), [free as in freedom](free_software.md) ([public domain](public_domain.md)) first man shooter [game](game.md) similar to [Doom](doom.md), created completely from scratch by [drummyfish](drummyfish.md). It has been designed to follow the LRS principles very closely and set an example of how games, and software in general, should be written. It also tries to be compatible with principles of [less retarded society](less_retarded_society.md), i.e. it promotes [anarchism](anarchism.md), anti-[capitalism](capitalism.md), [pacifism](anpac.md) etc. Anarch got 78 stars on gitlab and 42 stars on codeberg before being banned due to author's political opinions.

There are now also additional official mods available for the game that for example add multiplayer, increase texture resolution, improve the overall look, allow recording demos, replace assets with those from [Freedoom](freedoom.md) and so on.

To make Anarch no advanced [bullshit](bullshit.md) was used such as multiple monitors, [IDE](ide.md)s, [UML](uml.md), workstations, graphic tablets, programming socks, budget, expensive chairs and so on. It was made mostly with one old laptop, one old desktop computer and only basic [free software](free_software.md) such as [vim](vim.md), [GIMP](gimp.md) and so on.

The repo is available for example at https://git.coom.tech/drummyfish/Anarch. Some info about the game can also be found at the [libregamewiki](lgw.md): https://libregamewiki.org/Anarch. The 1.0 version was released on 1st December 2020 after some 757 commits in the repository, it was officially in the making since September 25 2019 (first commit in the repo), but we may also see the inception of the game to be the start of [raycastlib](raycastlib.md) development in 2018.

{ Someone told me **the game even briefly appeared on TV**: some Croatian TV station covered the country's startup (I reckon it was Circuitmess) which creates [open consoles](open_console.md), and they showed one of them running Anarch. Pretty cool. Anarch was also briefly **played by Muta from SomeOrdinaryGamers**, a quite famous [YouTube](youtube.md) channel, in a video covering the worst websites on the Internet. I now also found it on F-Droid :-) ~drummyfish }

```
h@\hMh::@@hhh\h@rrrr//rrrrrrrrrrrrrrrrrrrr@@@@hMM@@@M@:@hhnhhMnr=\@hn@n@h@-::\:h
hMhh@@\\@@@\\h:M/r/////rrrrrrrrrrrrrrr//r@@@@@MMh@@hhh\\\=rMr=M@hh\hn\:\:h::\@\:
@nh==hhhMM@hrh\M/r/////rrrrrrrr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rrrrrrr//r=r=r=r=r;. ,.r=r\---hr=@r===-r=r=;;;r;;;hh@:;;;;;;;;;;-;
r=rrr=rr\\@rr=rrr=r/;/:rr=rrr=rr;r,..=r\--.-h=r@r----=rrr=rrr--:,;;:,;;;,;;;,;--
rrrr:-@=====:,;,;-/;/:rrrrrrrrr;;....r\--.,\hrrrrrrrrrrrrrrrrrrrrr-----rrrrrrrrr
,;,:,; ;,;;;-;;;,;/:-rrrrrrrrrrrrrrrrr\-.,;\@rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
;,;,;,.,;,;,;,;,;,:rrrrrrrrrrrrrrrrrr\--.;,\Mrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr
,;,;.-.-.-::-:::--rr/rrr/rrr/rrr/rrr/\-.:;::@rrr/rrr/rrr/rrr/rrr/rrr/rrr/rrr/rrr
-.-.r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/\---;::\@/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/
/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r\-.,;:,:@r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r/r
///////////////////////////////////\::-,;,-:@///////////////////////////////////
;///;///;///;///;///;///;///;///;//,::-:,.,-@///;///;///;///;///;///;///;///;///
//////////////////////////////////\----:-.,-h///////////////////////////////////
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
nn..nnn...nn...nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...nnnnnnnnnnnnnn
nnn.nnn.n.nn.n.nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.n.nnnnnnnnnnnnnn
nnn.nnn.n.nn.n.nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn.n.nnnnnnnnnnnnnn
nn...nn...nn...nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn...nnnnnnnnnnnnnn
nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn
```

*screenshot from the terminal version*

The following are some of the game's features:

- It is completely **[public domain](public_domain.md)** [free software](free_software.md)/[free culture](free_culture.md) under [CC0](cc0.md), including all code and assets which were all made from scratch by drummyfish.
- It has extremely low hardware demands, fitting into **256 kB** (WITH assets, with mods and compression even 60 kB) and requiring only about **32 kB of [RAM](ram.md)** and **50 MHz [CPU](cpu.md)**. [GPU](gpu.md)s need not apply.
- It is written in pure [C99](c.md) without any [dependencies](dependency.md) (not even the standard library). It uses no [dynamic heap allocation](dynamic_allocation.md) and no [floating point](float.md).
- It is **extremely [portable](portability.md)**, written against a very tiny [I/O](io.md) layer. As such it has been ported to many platforms such as [GNU](gnu.md)/[Linux](linux.md), [BSD](bsd.md), [Pokitto](pokitto.md), [Winshit](windows.md), browser [JavaScript](javascript.md), [Raspberry Pi](rpi.md), [Android](android.md) and many others.
- It is written in a [single compilation unit](scu.md) and without any [build system](build_system.md).
- It is created with only free software.
- It is well documented.
- Mods and configs follow [suckless](suckless.md) philosophy: mods are just [diffs](diff.md), config is part of source code.
- Gameplay-wise Anarch offers 10 levels and multiple enemy and weapon types. It supports mouse where available.

Upon release the game garnered some attention at [4chan](4chan.md)/g -- of course this included suggestions for drummyfish to [kill himself](suicide.md), but generally anons seemed to like it, at least for the overall autism.

{ **MINI DRAMA SECTION**: I want to apologize here for mentioning that I found the game selling on Switch store and assuming it was a cash grab scam, I actually got an email from the developer and got a very nice donation. Thank you <3 EDIT2: **I am an idiot.** I probably fucked up the previous statement too as I got an email from a friend who asked me if this is a sell out, and I now absolutely see it looks that way, so please let me clarify this: I do not approve of proprietary software or selling software for money, I also hate Nintendo Switch etc., hopefully that's clear. What happened was that the developer emailed me beforehand asking if he could make the port, if I wanted to be credited and if I would accept a donation, and this alone is very nice of him (despite me still holding my beliefs about selling software etc.) because it's pretty clear he can make the port without asking me or paying me anything. I responded he can of course make the port and that donations and credit are always optional and there is not even any moral pressure to make them (i.e. not only I don't require them, I don't even expect them), i.e. basically what I state on my website. He then made the port and sent me a nice donation (which may be even more than what the port will make, i.e. it's clearly not a blatant cash grab), but later on someone sent me a link to the port on Switch store and of course like a dumbass I am I FORGOT about the email (one of very many I get) and so I assumed it was some kinda "scam" (which would still be legally fine of course) and made a comment about it in some places, and this was a BIG FUCKUP by me because I gave the guy a thumbs up and then behaved as if I didn't, and this I am very deeply sorry for. I.e. this wasn't me suddenly approving of a commercial port or changing my opinions upon receiving money, it was just me accidentally behaving like a dick, which is what I want to apologize for. ~drummyfish }

## Sales And Reception

The game was met with overwhelmingly mixed reception with professional Internet forum posters mostly judging it [shit](shit.md), some however still appreciated it especially for its superiority over every other game. One reviewer from an [expert technology forum](4chan.md) described it as: "[kill yourself](kys.md)". On Metacritic the game didn't achieve any score but someone made a [Wikidata](wikidata.md) item for it. During the first 5 years the game's grand total sales through itch.io's [pay what you want](pay_what_you_want.md) system reached nearly $35 (before tax). This covered the development costs approximately [infinitely](infinity.md) many times.

## Trivia (Spoilers)

Some [fun](fun.md) facts about the game include:

- On [Windows](windows.md) the game warns the user that his operating system is malware.
- The game was partially programmed in a mental hospital.
- The working title for the game was CorpoDearm. The name Anarch was invented during a bus ride.
- One of the last level's map contains a swastika, skull and dollar sign.
- Levels 1 and 6 partially overlap in a corner.
- The melee weapon was initially an axe, but it looked too small so it was replaced by a knife.
- There is a cheat code: ABRACADABRA (*R* is the *right* key, *D* the *down* key etc.).
- The last level contains an easteregg room with a smileyface and a thank you for the player.
- Many of the game textures (the bricks, wooden wall, concrete blocks etc.) come from the house of drummyfish's parents.
- There is an official, more bloated "consoomer" edition of the game with additional features (smooth movement, particle effects, computer terminal texts, ...), higher [resolution](resolution.md) and easier difficulty.
- One level has a secret room that on the map spells out "SECRET".
- At first there was intended to be a kind of [tracker](tracker.md) [music](music.md), but due to excessive amount of work on all other things drummyfish eventually opted for simple [bytebeat](bytebeat.md) instead.
- In the [wikidata](wikidata.md) database the game's number is Q114540914.
- The game title is not an [acronym](acronym.md). But if it was it could mean *"anarch is not another retro casual horseshit"*.
- ...

## Technical Details

Anarch is written in [C](c.md)99.

The game's engine uses [raycastlib](raycastlib.md), a [LRS](lrs.md) [library](library.md) for advanced 2D [raycasting](raycasting.md); this would be called "pseudo 3D" graphics. The same method (raycasting) was used by [Wolf3D](wolf3d.md) but Anarch improves it to allow different levels of floor and ceiling which makes it look a little closer to [Doom](doom.md) (which however used a different methods called [BSP](bsp.md) rendering).

The whole codebase (including raycastlib AND the assets converted to C array) has fewer than 15000 [lines of code](loc.md). Compiled binary is about 200 kB big, though with [compression](compression.md) and replacing assets with [procedurally generated](procgen.md) ones (one of several Anarch mods) the size was made as low as 57 kB.

The music in the game is [procedurally generated](procedural_generation.md) using [bytebeat](bytebeat.md).

All images in the game (textures, sprites, ...) are 32x32 pixels, compressed by using a 16 color subpalette of the main 256 color palette, and are stored in source code itself as simple [arrays](array.md) of bytes -- this eliminates the need for using [files](file.md) and allows the game to run on platforms without a [file system](file_system.md).

The game uses a tiny custom-made 4x4 bitmap [font](font.md) to render texts.

Saving/loading is optional, in case a platform doesn't have persistent storage. Without saving all levels are simply available from the start.

In the suckless fashion, mods are recommended to be made and distributed as [patches](patch.md).

### Bad Things Plus Comments, Retrospective (/Post Mortem?)

*written by [drummyfish](drummyfish.md)*

Though retrospectively I can of course see many mistakes and errors about the game and though it's not nearly perfect, I am overall quite happy about how it turned out and for what it is overall, it got some attention among the niche of suckless lovers and many people have written me they liked the game and its philosophy. It's not nearly a peak of minimalism or highest LRS ideal, but definitely shows how mixing minimalism into a project can make it so much nicer. Many people have ported Anarch to their favorite platforms, some have even written me their own expansions of the game lore, tricks they found etc. Some even created small mods. If you're among them, thank you :)

There were also a few people I've heard criticism from -- and that's absolutely fine -- that the game is just shit, too simple, badly designed, boring and so on. Indeed, about the quality of the game as such (from the "consumer's" point of view) I actually agree, the game isn't the most fun one to play, but when judging it please keep in mind the following. Firstly it was ALL made by a single man, absolutely from scratch -- if you've ever tried to create something from nothing, you know that despite it not looking that hard, it is indeed extremely difficult and time consuming to make something from the ground up, AND I couldn't even use any free assets, sound samples, game engines, not even fonts -- except for the programming language I had to create EVERYTHING from nothing, which required not only great amount of time, but also skills which I cannot master all: that of a visual artist, engineer, level designer, sound artist and so on and so forth. You only see the result but not the dozens of blind paths, hundreds of lines of rewritten code that was thrown to trash, hours and hours spent hunting down silly little bugs. All the skills needed for making a complete game are so vastly different that unless one is a genius, they cannot be mastered at once, one would simply have to be an excellent painter, writer, musician, mathematician, programmer, psychologist and many different things at once. Secondly I didn't work on it full time, I worked on other things, went to work, I was even hospitalized etc. Thirdly the goal wasn't to make a game that would be excellent by its gameplay AT ALL, the context of its creation was absolutely different from that of a typical game that has to try to appeal to many people, Anarch was focused on showing the technological side, prove a point of a certain development philosophy, and that mostly to rather a few people who want to make games themselves. By its philosophy it's also not meant to be a "fixed product" as is, again, common to think of games nowadays, it is really meant to be a basis for improvement, mods, a starting codebase for [forks](fork.md) and so on. So even though there are many shortcomings and things done plainly wrong, I think the main goal was more or less achieved, though some people miss to see that goal. If this philosophy of simplicity allows a single guy (quite average and in many ways retarded and that) to make a WHOLE game completely from scratch, with zero budget, only over weekend evenings, and that game is additionally very well made (extremely small, portable, modifiable, free, ...), what if let's say three brilliant people worked on it? What if five people worked on something similar full time? What marvels would we see? This is the number one question I wanted to highlight.

The following is a retrospective look on what could have been done better (a potential project for someone might be to implement these and so make the game even more awesome):

- I kinda overdid it with fixed width types, tried to always only use variables of the smallest necessary size but now it looks a bit ridiculous, it would be better to just use normal integers for most local variables, I probably didn't achieve much, maybe it's even a bit slower this way.
- It might have been better to write it in C89 than C99 for better portability.
- Sound effects would likely be better procedurally generated just like music. It would be less code and data in ROM and the quality probably wouldn't be that much worse as the samples are shitty quality anyway.
- The palette used might have rather been [RGB 332](rgb332.md) instead of the custom palette, again less code and less data in ROM, though visual quality might suffer a bit and things like diminishing colors might require some extra code or look up tables (like in Doom).
- The python scripts for data conversion should be rewritten to C. Using python was just laziness.
- Raycastlib itself has some issues, but those should be addressed separately.
- The game is really a bit too hard (tho this can easily be changed in settings) and gameplay is not great (like explosions pushing player instantly, not too good, too few items, player often lacks ammo/health, ...), movement inertia could be in vanilla game to make it feel nicer etc.
- Some of the code is awkward, like `SFG_recomputePlayerDirection` was an attempt at optimization but it's probably optimization in a wrong place that does nothing, ...
- Some details like having separate arrays for different types of images -- there is no reason for that, it would be better to just have one huge array of all images; maybe even have ALL data in one huge array of bytes.
- ...

## See Also

- [Doom](doom.md)
- [Licar](licar.md)
- [SAF](saf.md)
- [LRS](lrs.md)