From 55b04c560eaa19dab58b3528d90f420b6fbceb98 Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Sat, 8 Jan 2022 22:05:06 -0600 Subject: [PATCH] Update --- anarch.md | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ ssao.md | 9 +++++++ x86.md | 6 ++--- 3 files changed, 82 insertions(+), 4 deletions(-) create mode 100644 anarch.md create mode 100644 ssao.md diff --git a/anarch.md b/anarch.md new file mode 100644 index 0000000..a5a5c03 --- /dev/null +++ b/anarch.md @@ -0,0 +1,71 @@ +# Anarch + +Anarch is a [LRS](lrs.ms)/[suckless](suckless.md) first person shooter [game](game.md) similar to [Doom](doom.md), written 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. + +Some info about the game can be found at the [libregamewiki](lgw.md): https://libregamewiki.org/Anarch. + +``` +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/////rrrrrrrrrrrrrrr//@@@@@@hhM@h\MhhhMM\@@@@@M\hh\\\Mhh\\\\hh +:hh=@Mh/;;;@hr:M,///;;/////rrr//rrrrrr//@@@@@@hh\h@@hM:==h\@@::\\\:M\@\h\M:\:=@h +\=MhM@hr `hMhhM///@@@@@@@@@@@@@@@@@@@//@@@@@@rMM@n\M=:@M\\\\Mh\\\hr\n\--h-::r:r +:Mh@M@@` `rh@\@///@@@@@@@@@@@@@@@@@@@@@@@@@@@Mr\@@\h@:\h\h@\Mhh@@\M@@@@-n\rn@:h +:MhhMn@//r;;@/hM@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@MhMhh:M@MhMhMh@\\rM/@h@nn=-MrnM@:h +:nhhhhh\\//\::@M@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@rMM@@nh@M\=nh@@@M@..=hM@n@-@@@@@:h +\@\h@@rrrr/rr@=M@@@@@@@@@@@@@@nr@@@@@@@@@@@@@@Mrhn@\M@:nMh\@@@@@...h:::::@---::h +-M\h=h\` rhM\M@@@@@@@@@@@@@@@=@@@@@@@@@@@@@@MhM@\hh@M@Mhh@-\MMhrr\\\:MMh::\\-\ +h@hhh\h` `rMh\M@@@@@@@@@@@@@@nr;;;;rn@@@@@@@@r@r///=@\@\r\\hM@nrrr@\n\h\M\\\\\: +hn===hhM=;hhhh\MrMnrr=rrr=r@rhhr;.r,/hr=r=r=h=r@=/-;/MhhMr:h\@h=...r\@hMhM:/\h\= +@n==M\h@=;hhh\\Mrr=r=r=rMr=hrMMr;;;,;========MM@r=./;@:MMM\h=r=rM/rh@@@M-n---:-h +:\=hMn@@@=\hhh:M===============;/. ,,==========@r-/--@:@M\\@@@n@Mn:hM@n@-=\hr=-h +\hhnM@=@::@MM/h================;;;;.,======\h==M=/;r,//;;r=r=r=r@\=r=r=r=@rnMn:r +:Mrrr=rr==@rr=rrr=rrr=/=r===r==/:; ..===r\\-h==@r-,;-=r/;/;;;;;;rnrrr=rrr=rrr=r; +rrrrrrrr@=rrrrrrrrrrr//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* + +Anarch has these 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) 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**, written against a very tiny I/O layer. As such it has been ported to many platforms such as [GNU](gnu.md)/[Linux](linux.md), [BSD](bsd.md), [Pokitto](pokitto.md), browser [JavaScript](javascript.md), [Raspberry Pi](rpi.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. + +Gameplay-wise Anarch offers 10 levels and multiple enemy and weapon types. It supports mouse where available. + +## Technical Details + +Anarch's engine uses [raycastlib](raycastlib.md), a LRS library for advanced 1D [ray casting](ray_casting.md) which is often called a "pseudo 3D". This method was used by Wolf3D, but Anarch improves it to allow different levels of floor and ceiling which makes it look a little closer to Doom (which however used a different methods called [BSP](bsp.md) rendering). + +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). \ No newline at end of file diff --git a/ssao.md b/ssao.md new file mode 100644 index 0000000..9e99195 --- /dev/null +++ b/ssao.md @@ -0,0 +1,9 @@ +# SSAO + +Screen space ambient occlusion (SSAO) is a technique in [computer graphics](graphics.md) of **[approximating](approximation.md)** ambient occlusions (basically dim shadows in corners) in a way that's easy and not so expensive to implement to run in [real time](real_time.md). + +Exact ambient occlusions can be computed with algorithms such as [path tracing](path_tracing.md) and this requires complete information about the geometry as to compute the exact light bounces, but that is way too slow for real time (even though actually path tracing is already kind of possible in real time, but requires expensive consoomer hardware). So game devs cheat and use a cheap approximation: SSAO is implemented as a [post-processing](post_processing.md) [shader](shader.md) and only uses the information available on the screen, specifically in the [depth buffer](z_buffer.md). This gives only partial information, the algorithm doesn't know what the back facing geometry looks like and has to make guesses which sometimes results in inaccuracies. + +This methods is notoriously ugly in certain conditions and many [modern](modern.md) [games](game.md) suffer from this, even the supposedly "photorealistic" engines like Unreal -- if someone is standing in front of a wall there is a shadow outline around him that looks so unbelievably ugly you literally want to puke. But normie eyes can't see this lol, they think that's how reality looks and they are okay with this shit, they allow this to happen. Normies literally destroy computer graphics by not being able to see correctly. + +What to do then? The most [suckless](suckless.md) way is to simply do no ambient occlusions -- seriously test how it looks and if it's okay just save yourself the effort, performance and complexity. Back in the 90s we didn't have this shit and games unironically looked 100 times better. You can also just [bake](baking.md) the ambient occlusions in textures themselves, either directly in the color texture or use so called **[light maps](light_map.md)**. Note that this makes the ambient occlusions static and with light maps you'll need more memory for textures. Finally, if you absolutely have to use SSAO, at least use it very lightly (there are parameters you can lower to make it less prominent). \ No newline at end of file diff --git a/x86.md b/x86.md index d6f2984..82b0663 100644 --- a/x86.md +++ b/x86.md @@ -1,7 +1,5 @@ # x86 -TODO +x86 is a [bloated](bloat.md), toxic [instruction set architecture](isa.md) (or rather a family of them) used mostly in the [desktop](desktop.md) computers -- it is the most widely used architecture, used in [Intel](intel.md) and [AMD](amd.md) [CPU](cpu.md)s. -**LMAO** there's shit like **PCLMULQDQ**, **MPSADBW** (*multiple packed sums of absolute difference* which does something like cross correlation ??? xD) and **PCMPESTRI** (which does like many possible string searches/comparisons on strings of different data types like subset or substring with many different options). - -Basically if you smash your keyboard chances are you produce a valid x86 instruction xD \ No newline at end of file +It is a [CISC](cisc.md) architecture and boy, complex it is. **LMAO** there are instructions like **PCLMULQDQ**, **MPSADBW** (*multiple packed sums of absolute difference* which does something like cross correlation ??? xD) and **PCMPESTRI** (which does like many possible string searches/comparisons on strings of different data types like subset or substring with many different options). Basically if you smash your keyboard chances are you produce a valid x86 instruction xD \ No newline at end of file