This commit is contained in:
Miloslav Ciz 2024-01-22 21:56:05 +01:00
parent 9d8f229ce6
commit 243a1a72be
15 changed files with 53 additions and 27 deletions

View file

@ -61,9 +61,11 @@ Anarch has these features:
## Technical Details
Anarch's engine uses [raycastlib](raycastlib.md), a LRS library for advanced 2D [ray casting](ray_casting.md) which is often called a "pseudo 3D". This method 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).
Anarch is written in [C](c.md)99.
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 the size was made as low as 57 kB.
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).
@ -73,4 +75,17 @@ 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).
In the suckless fashion, mods are recommended to be made and distributed as [patches](patch.md).
### Bad Things (Retrospective)
The following is a retrospective look on what could have been done better, written by [drummyfish](drummyfish.md) (a potential project for someone might be to implement these and so make the game even more awesome):
- 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, ...
- ...