Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/temporal/pure-cl-gamedev-libs

Pure Common Lisp libraries for game development
https://github.com/temporal/pure-cl-gamedev-libs

common-lisp game-development

Last synced: about 2 months ago
JSON representation

Pure Common Lisp libraries for game development

Awesome Lists containing this project

README

        

#+title: Pure Common Lisp libraries for game development

A list of libraries written in pure Common Lisp - that is, *with no foreign dependencies* - that may be of particular interest
to people developing games and similar interactive applications in Common Lisp.

You won't find libraries for pushing pixels and playing sounds here (for now). Those tend to require interfacing with a
native platform API (or a foreign, usually C, library abstracting native platform APIs). But there's still plenty you can
do without leaving the Lisp world.

* The list

Unless otherwise stated in remarks, all libraries are available through the official Quicklisp distribution, as of =2017-11-24=.

** Image handling

| Library | Description | Remarks | License |
|-----------------------+-------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------+--------------|
| [[https://github.com/mfiano/pngload][pngload]] | Fast library for loading PNG images. | Very fast, can use =static-vectors= for extra speed. | [[https://github.com/mfiano/pngload/blob/master/LICENSE][MIT]] |
| [[https://github.com/Ramarren/png-read][png-read]] | A PNG decoder for Common Lisp. | Can be considered obsoleted by =pngload=, which is faster and supports all PNG chunks. | BSD-style |
| [[https://github.com/slyrus/opticl][opticl]] | Loading, processing and saving PNG, JPEG, TIFF, PBM, PNM and GIF images. | Designed for high performance. | [[https://github.com/slyrus/opticl/blob/master/COPYRIGHT][BSD 2-clause]] |
| [[https://common-lisp.net/project/imago/][imago]] ([[https://github.com/tokenrove/imago][GitHub]]) | Loading, saving, manipulating PNG, PNM, TGA and PCX images. | | [[http://opensource.franz.com/preamble.html][Lisp LLGPL]] |
| [[https://www.xach.com/lisp/zpng/][ZPNG]] | Saving PNG images. | Does not *load* PNGs. Also, see [[https://www.xach.com/lisp/zpng/#sect-overview][limitations]]. | ? |
| [[https://github.com/mfiano/gamebox-sprite-packer][gamebox-sprite-packer]] | Spritesheet packer/unpacker. Generates additional metadata for packed sprite atlas. | Loads only PNGs as input files. Atlas metadata can be automatically generated in a normalized format (useful for textures). | [[https://github.com/mfiano/gamebox-sprite-packer/blob/master/LICENSE][MIT]] |

** Fonts and text
| Library | Description | Remarks | License |
|---------+----------------------------------------------+-----------------------------------------------------------------------------------------------+----------|
| [[https://github.com/lispgames/sdf][sdf]] | Signed Distance Field glyph atlas generator. | Uses zpb-ttf for TTF processing and opticl for image output. *Not available through Quicklisp*. | [[https://github.com/lispgames/sdf/blob/master/LICENSE][MIT]] |
| [[https://www.xach.com/lisp/zpb-ttf/][ZPB-TTF]] | TTF parser. | Does not render text, but can be used as a base for one (see e.g. =cl-vectors=). | BSD-like |

** Vector graphics
| Library | Description | Remarks | License |
|---------------------+-----------------------------------------------------------------+----------------------------------------------------------------------------------------------------+----------|
| [[http://projects.tuxee.net/cl-vectors/][cl-vectors]] ([[https://github.com/fjolliton/cl-vectors][GitHub]]) | Pure CL anti-aliasing rasterizer for vector graphics. | See [[http://projects.tuxee.net/cl-vectors/toc][documentation]]. Relatively low-level, does not render to bitmaps by itself. Compare with =vecto=. | [[https://github.com/fjolliton/cl-vectors/blob/master/MIT-LICENSE][MIT]] |
| [[https://www.xach.com/lisp/vecto/][vecto]] | Simplified interface to =cl-vectors=. Can render to PNG via =ZPNG=. | | BSD-like |

** OpenGL helpers
Related to OpenGL, but without foreign dependencies (including =cl-opengl=).
| Library | Description | Remarks | License |
|-----------+-----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------|
| [[https://github.com/cbaggers/varjo][Varjo]] | Lisp to GLSL Language Translator. | You can use this to write GLSL shaders in Lisp :). Can be optionally used with =rtg-math=. | [[https://github.com/cbaggers/varjo/blob/master/LICENSE.txt][BSD 2-clause]] |
| [[https://github.com/cbaggers/glsl-spec][glsl-spec]] | Specification of all functions and variables from GLSL as data (Lisp objects and JSON). | Also contains =glsl-symbols= system, which exports GLSL names as Lisp symbols. | [[https://github.com/cbaggers/glsl-spec/blob/master/LICENSE][Unlicense]] |

** Math
| Library | Description | Remarks | License |
|----------------------+-----------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------+--------------|
| [[https://github.com/mfiano/gamebox-math][gamebox-math]] | High-performance math library for games. | Supports 3-component vectors, 4x4 matrices and quaternions, + operations related to them. | [[https://github.com/mfiano/gamebox-math/blob/master/LICENSE][MIT]] |
| [[https://shinmera.github.io/3d-vectors/][3d-vectors]] ([[https://github.com/Shinmera/3d-vectors][Github]]) | A utility library implementing 2D, 3D, and 4D vector functionality. | Suggested to be used in conjuction with =3d-matrices=. | [[https://github.com/Shinmera/3d-vectors/blob/master/LICENSE][Artistic 2.0]] |
| [[https://shinmera.github.io/3d-matrices/][3d-matrices]] ([[https://github.com/Shinmera/3d-matrices][Github]]) | A utility library implementing 2x2, 3x3, 4x4, and NxN matrix functionality. | Suggested to be used in conjunction with (and depends on) =3d-vectors=. | [[https://github.com/Shinmera/3d-matrices/blob/master/LICENSE][Artistic 2.0]] |
| [[https://github.com/cbaggers/rtg-math][rtg-math]] | Library providing vectors (2, 3 and 4-component), matrices (3x3, 4x4) and many math operations useful in games. | Optional system =rtg-math.vari= provides GPU equivalents of =rth-math= operations for =Varjo=. | [[https://github.com/cbaggers/rtg-math/blob/master/LICENSE.txt][BSD 2-clause]] |
| [[https://github.com/lispgames/mathkit][mathkit]] | Pure math functions useful for games, 3D, and GL in general. | Built (partially?) on top of =sb-cga=. Contains functions for creating GL-style frustrum, projection and viewing matrices. | MIT |
| [[http://nikodemus.github.io/sb-cga/][sb-cga]] ([[https://github.com/nikodemus/sb-cga][Github]]) | Computer graphics algebra library. Supports 3D vectors and 4x4 matrices. | Portable, but with special optimizations for SBCL x86-64 that utilize SIMD (SSE2) instructions. | MIT |

** Physics
| Library | Functionality | Remarks | License |
|---------+------------------------------------------------------+---------+---------|
| [[https://github.com/BradWBeer/squirl][SquirL]] | Common Lisp port of the Chipmunk 2d physics library. | | [[https://github.com/BradWBeer/squirl/blob/master/COPYING][?]] |

** Memory and IO
| Library | Description | Remarks | License |
|------------------+-------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------|
| [[https://github.com/sionescu/static-vectors][static-vectors]] | Allocate =SIMPLE-ARRAY= in static memory. | Allows to explose Lisp-allocated buffers directly to foreign code. Useful for saving performance on moving bits beteween Lisp code and foreign dependencies. | [[https://github.com/sionescu/static-vectors/blob/master/LICENCE][MIT]] |
| [[https://github.com/mfiano/fast-io][fast-io]] | Fast octet-vector/stream IO. | Improves performance of =octet-vector= and =octet-stream= IO. Can optionally use =static-vectors= for extra performance in passing buffered data to foreign code. | NewBSD |
| [[https://github.com/psilord/bitio][bitio]] | Processing octet streams as bit streams. | Supports (and recommends) working with =fast-io=. | [[https://github.com/psilord/bitio/blob/master/LICENSE][MIT]] |
| [[https://github.com/mfiano/parsley][parsley]] | A toolset for parsing binary data formats. | | [[https://github.com/mfiano/parsley/blob/master/LICENSE][MIT]] |
| [[http://method-combination.net/lisp/chipz/][chipz]] ([[https://github.com/froydnj/chipz][Github]]) | Decompressing DEFLATE, ZLIB, GZIP, and BZIP2 data. | | [[http://method-combination.net/lisp/chipz/][MIT-like]]/[[https://github.com/froydnj/chipz/blob/master/LICENSE][BSD 3-clause]] |
| [[http://nklein.com/software/unet/userial/][USerial]] ([[https://github.com/nklein/userial][Github]]) | General-purpose binary serialization/unserialization. | See provided [[http://nklein.com/software/unet/userial/#protocol][example]] ([[https://github.com/nklein/userial#protocol][Github]]) of implementing a networking protocol for a game on top of =USerial=. | [[https://github.com/nklein/userial/blob/master/LICENSE.txt][MIT]] |

** Filesystem
| Library | Description | Remarks | License |
|---------+-------------+---------+---------|

See also =UIOP= under Miscellaneous.

** OS
| Library | Description | Remarks | License |
|---------+-------------+---------+---------|
| | | | |

See also =UIOP= under Miscellaneous.

** Architecture of game/engine
| Library | Description | Remarks | License |
|-----------------------+----------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------------+---------|
| [[https://github.com/mfiano/gamebox-frame-manager][gamebox-frame-manager]] | Manager for frames within a game loop. | Wraps the code for doing fixed timestep updates. Also computes an interpolation coefficient useful for blending frames together. | [[https://github.com/mfiano/gamebox-frame-manager/blob/master/LICENSE][MIT]] |
| [[https://github.com/mfiano/gamebox-ecs][gamebox-ecs]] | Implementation of Entity-Component-System pattern. | | [[https://github.com/mfiano/gamebox-ecs/blob/master/LICENSE][MIT]] |

** Grids and tilesets
| Library | Description | Remarks | License |
|--------------------------+-----------------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------+-----------|
| [[http://nklein.com/software/grid-generators/][grid-generators]] ([[https://github.com/nklein/grid-generators][Github]]) | Generate points on arbitrary (and multidimensional) grids. | Includes =GRID-ITERATE=, which allows to walk multidimensional grids with =ITERATE=. *Not available through Quicklisp*. | Unlicense |
| [[https://github.com/mfiano/gamebox-grids][gamebox-grids]] | Create and manipulate tiles in a 2D grid. | Currently supports 4 different square and 8 different hexagonal grids. | [[https://github.com/mfiano/gamebox-grids/blob/master/LICENSE][MIT]] |
| [[https://github.com/Zulu-Inuoe/cl-tiled][cl-tiled]] | Loader for tiled maps generated by [[http://www.mapeditor.org][Tiled]], in TMX/TSX and JSON format. | | [[https://github.com/Zulu-Inuoe/cl-tiled/blob/master/LICENSE.md][zlib]] |

** Randomness
| Library | Description | Remarks | License |
|--------------+------------------------------------------------------------------------------------------+---------------------------------------------------------------------------------+-----------|
| [[https://common-lisp.net/cgi-bin/darcsweb.cgi?r=cl-variates-cl-variates;a=summary][cl-variates]] | Portable Common Lisp Random Number Generation. | Seems to have more capabilities than are exposed by current ASDF system. A bug? | MIT Style |
| [[https://github.com/mfiano/genie/blob/master/genie.asd][genie]] | A simple wrapper around =cl-variates= to generate portably seedable pseudo-random numbers. | | [[https://github.com/mfiano/genie/blob/master/LICENSE][MIT]] |
| [[https://github.com/sjl/cl-pcg][cl-pcg]] | Permuted congruential generators. | | [[https://github.com/sjl/cl-pcg/blob/master/LICENSE.markdown][MIT]] |
| [[https://github.com/mfiano/gamebox-dgen][gamebox-dgen]] | A procedural dungeon generator. | Generates random 2D dungeons with rooms, corridors and entry/exit points. | [[https://github.com/mfiano/gamebox-dgen/blob/master/LICENSE][MIT]] |

** Data structures
| Library | Description | Remarks | License |
|--------------------+----------------------------------------------------------+----------------------------------------------------------------------------------------------+---------|
| [[https://github.com/mfiano/doubly-linked-list][doubly-linked-list]] | Doubly-linked list with key/value nodes. | | [[https://github.com/mfiano/doubly-linked-list/blob/master/LICENSE][MIT]] |
| [[https://github.com/zkat/cl-speedy-queue][cl-speedy-queue]] | A portable, non-consing, optimized queue implementation. | | MIT |
| [[http://eschulte.github.io/graph/][graph]] ([[https://github.com/eschulte/graph][Github]]) | A simple graph data structure and algorithms. | Additional systems =GRAPH-JSON= and =GRAPH-DOT= can be used for serialization and visualization. | [[https://github.com/eschulte/graph/blob/master/COPYING][GPL 3.0]] |

** Algorithms
| Library | Description | Remarks | License |
|---------+-------------+---------+---------|
| | | | |

** Logging
| Library | Description | Remarks | License |
|---------------+--------------------------------------------------+----------------------------------------------------------------------------------------+------------|
| [[https://github.com/sharplispers/log4cl][log4cl]] | Powerful logging framework, modeled after Log4J. | Ships with =Log4Slime=, that lets one interact with library through log output in SLIME. | [[https://github.com/sharplispers/log4cl/blob/master/LICENSE][Apache 2.0]] |
| [[https://github.com/mfiano/simple-logger][simple-logger]] | Simple message logging system. | | [[https://github.com/mfiano/simple-logger/blob/master/LICENSE][MIT]] |

** Miscellaneous
| Library | Description | Remarks | License |
|---------------------+---------------------------------------------------------------------------------+---------------------------------------------------------------------------------+---------|
| [[https://github.com/fare/asdf/tree/master/uiop][UIOP]] | Utilities for portably handling things, including filesystems and OS specifics. | Ships with recent ASDF, so you might already have it. | MIT |
| [[http://nklein.com/software/track-best-library/][track-best]] ([[https://github.com/nklein/track-best][Github]]) | Track the N best of some series of items. | A simple yet potentially useful building block for solving variety of problems. | ? |

* Motivation

Foreign libraries involve working with, and shipping, foreign dependencies. Doing that correctly, for all important platforms, is
a quite tricky and painful process. It can be done (see e.g. [[https://borodust.org/delivering-common-lisp][this article]] by borodust), but the less foreign libraries you have
to deliver, the less hassle you have. Moreover, the developent process itself can get tedious - even though projects like
[[https://github.com/rpav/cl-autowrap][cl-autowrap]] do a great job at making things easier, you might still hit a library wrapper that will require you (or people you share
your code with!) to have a whole LLVM environment to even build the ASDF system.

Unlike many popular dynamic languages, Common Lisp is *actually performant*, with implementations like SBCL generating code
that can compete in speed with C (if properly written and instrumented). This opens the possibility of using pure Common Lisp code
for interactive applications without taking a huge performance hit.

* Contributing

If you see a library that a) can be useful in game development (or closely related areas), and b) is pure Common Lisp, i.e. has no
foreign dependencies that need to be managed through FFI, feel free to include it and send a Pull Request.

Corrections to any information in this list are welcome too. I have only so much patience to check e.g. licenses :).

Also, I'm considering starting a section with usage examples for libraries that are meant to be
used with typical foreign gamedev dependencies - e.g. how to use =pngload= to load a texture for =cl-opengl=. Any such examples
are welcome too.