# less_retarded_wiki

main page, file list (652), source, commit RSS feed, report abuse, stats, random article, consoomer version

# Raycastlib

Raycastlib (RCL) is a public domain (CC0) LRS C library for advanced 2D raycasting, i.e. "2.5D/pseudo3D" rendering. It was made by drummyfish, initially as an experiment for Pokitto -- later he utilized the library in his game Anarch. It is in spirit similar to his other LRS libraries such as small3dlib and tinyphysicsengine; just as those raycastlib is kept extremely simple, it is written in pure C99, with zero dependencies (not even standard library), it's written as a single file single header library, using no floating point and tested to run interactively even on very weak devices (simplified version was made run on Arduboy with some 2 KiB of RAM). Two rendering algorithms are provided to choose from: simple (only same height floor and ceiling, allowing textured floor and ceiling) and complex (allowing variable floor and ceiling, without textured floors and ceilings). Per rendered frame both algorithms always draw every screen pixels exactly once, without any overdraw and holes, which is very advantageous and elegant; the simple algorithm additionally also guarantees the pixels to be drawn in exact same linear order every time. It is very flexible thanks to use of callbacks for communication, allowing e.g. programming arbitrary "shader" code to implement all kinds of effects the user desires or using procedurally generated environments without having to store any data. The library implements advanced features such as floor and ceiling with different heights, textured floor, opening door, simple collision detection etc. It is written in just a bit over 2000 lines of code.

The repository is available at https://git.coom.tech/drummyfish/raycastlib. The project got 45 stars on gitlab before being banned for author's political opinions.

    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................
    ...........XXXXXXXXXXXX/..........XXXXXXXXXXXXXXXXXXXXXX.......................o
    ...........XXXXXXXXXXXX////.......XXXXXXXXXXXXXXXXXXXXXX......................oo
    XXXXXXXXXXXXXXXXXXXXXXX//////.....XXXXXXXXXXXXXXXXXXXXXX...............ooooooooo
    XXXXXXXXXXXXXXXXXXXXXXX/////////..XXXXXXXXXXXXXXXXXXXXXX........oooooooooooooooo
    XXXXXXXXXXXXXXXXXXXXXXX//////////.XXXXXXXXXXXXXXXXXXXXXXXXXXXooooooooooooooooooo
    XXXXXXXXXXXXXXXXXXXXXXX//////////XXXXXXXXXXXXXXXXXXXXXXXXXXXXooooooooooooooooooo
    XXXXXXXXXXXXXXXXXXXXXXX//////////.XXXXXXXXXXXXXXXXXXXXXXXXXXXooooooooooooooooooo
    XXXXXXXXXXXXXXXXXXXXXXX/////////..XXXXXXXXXXXXXXXXXXXXXX........oooooooooooooooo
    XXXXXXXXXXXXXXXXXXXXXXX//////.....XXXXXXXXXXXXXXXXXXXXXX...............ooooooooo
    ...........XXXXXXXXXXXX////.......XXXXXXXXXXXXXXXXXXXXXX......................oo
    ...........XXXXXXXXXXXX/..........XXXXXXXXXXXXXXXXXXXXXX.......................o
    ................................................................................
    ................................................................................
    ................................................................................
    ................................................................................

Simple rendering made with raycastlib.

{ December 2025: someone made a quite impressive "AI programmed" game with raycastlib and sent it to me over email. It was a maze game with bytebeat music, enemies and all together a nice feel. Allegedly it was made in 7 hours with some sort of "AI IDE" by iteratively telling the AI (as I understood it, but I don't know a lot about this) "what to do", which features to add, which bugs to fix and so on. It compiled and ran quickly and without issues, even using an "Anarch"-like compiling shell script, which stunned me -- AI can already program in this style After a very brief overview of the code I found it's rather messy, not just in formatting but the overall structure and architecture of the code, plus some parts of the code looked suspiciously close (almost like a copy-paste) of code in Anarch -- overall it's nowhere near a code written by a skilled C programmer yet, HOWEVER I was still very much impressed and quite "positively amazed" by the fact that this "AI" can even use my library which is not among mainstream ones like SDL and which isn't all together that much documented and traditional in how it's supposed to be used. The human author that used the AI was also very young and that made it even more impressive. In summary at this stage this "AI programming" is unexpectedly advanced but still not beating a skilled human, although this is most definitely going to change in a year or three or five. It can very much be used for C programming now but it's going to produce ugly, inefficient and buggy stuff, i.e. it can already replace most average programmers. ~drummyfish }

## See Also

- small3dlib

Powered by nothing. All content available under CC0 1.0 (public domain). Send comments and corrections to drummyfish at disroot dot org.