# Cauldron2D v0.2.2 - Table of Contents > A 2D tile engine for terminals: a grid of tile ids, cheaply, as pixels or glyphs. ## Pages - [Cauldron2D](readme.md) - [Changelog](changelog.md) - [Your first game: Cistern](tutorial.md) ## Modules - [Cauldron2D](Cauldron2D.md): A 2D tile engine for terminals: a grid of tile ids, drawn as pixels or as glyphs depending on what the terminal supports. - [Cauldron2D.Atlas](Cauldron2D.Atlas.md): A named catalogue of tiles. - [Cauldron2D.Atlas.Manifest](Cauldron2D.Atlas.Manifest.md): The `atlas.txt` beside an art directory's pictures: what a text renderer draws for each art, and how fast its frames go. - [Cauldron2D.Atlas.Tables](Cauldron2D.Atlas.Tables.md): Owns every atlas's composited-tile cache table, so a table outlives whichever process installed the atlas. - [Cauldron2D.Audio](Cauldron2D.Audio.md): Sound effects and music for one listener, over one `TuningFork` stage. - [Cauldron2D.Audio.Keyed](Cauldron2D.Audio.Keyed.md): A sound event under a key, as `Cauldron2D.Audio.keyed/4`, `moved/2` and `stopped/2` build it for `Cauldron2D.Audio.play/2`. - [Cauldron2D.Audio.Music](Cauldron2D.Audio.Music.md): Music in sections and layers, switched on bar boundaries and mixed per listener. - [Cauldron2D.Audio.Rendered](Cauldron2D.Audio.Rendered.md): Every sound a game plays, rendered once: a `TuningFork.Voice` at a rate becomes mono PCM the first time it is asked for and is kept in an ETS table for every stage on the node after, whatever its gain or pan, which are applied to the copy each time. - [Cauldron2D.Beacon](Cauldron2D.Beacon.md): How a server on the local network is found: the host says so every two seconds on a UDP port — `port/0`, the `:beacon_port` in the `:cauldron_2d` config, 2299 unless set — to the broadcast address and to this machine, and whoever listens (`Cauldron2D.Beacon.Listener`) hears it. - [Cauldron2D.Beacon.Listener](Cauldron2D.Beacon.Listener.md): Hears the servers of one game calling on the local network (`Cauldron2D.Beacon`) and keeps those heard in the last six seconds. - [Cauldron2D.Blend](Cauldron2D.Blend.md): Source-over compositing of two equal-sized RGBA rectangles. - [Cauldron2D.Body](Cauldron2D.Body.md): A point mass with a heading: position, velocity, and one of `headings` directions. - [Cauldron2D.Camera](Cauldron2D.Camera.md): Resolves which part of a world is on screen. - [Cauldron2D.Camera.Follow](Cauldron2D.Camera.Follow.md): A camera that trails its target and can be shaken, as a value the game steps. - [Cauldron2D.Client.Game](Cauldron2D.Client.Game.md): What a game gives a client — the terminal's, the browser's or the desktop's — to put its worlds in front of a player. One contract; every front end draws from it. - [Cauldron2D.Client.Hud](Cauldron2D.Client.Hud.md): The shapes a game's hud comes in, and one form every front end reads. - [Cauldron2D.Collision](Cauldron2D.Collision.md): Bodies against a tile grid, and against each other. - [Cauldron2D.Collision.Buckets](Cauldron2D.Collision.Buckets.md): Bodies sorted into square buckets, so that only neighbours are compared. - [Cauldron2D.Distribution](Cauldron2D.Distribution.md): Play across machines over BEAM distribution: one machine hosts, the other joins its worlds (`Cauldron2D.Worlds.world_name/2`). - [Cauldron2D.DrawList](Cauldron2D.DrawList.md): A frame as a list of pictures placed in pixels, and the raster it draws. - [Cauldron2D.Fit](Cauldron2D.Fit.md): Fitting a frame of a fixed shape into a picture of another, with bars on the sides or above and below. - [Cauldron2D.Game](Cauldron2D.Game.md): What a game gives `Cauldron2D.World` to run: a pure value and the callbacks that change it. - [Cauldron2D.Grid.Coarse](Cauldron2D.Grid.Coarse.md): Ways across a tile grid of any size, for bodies that move through the open tiles. - [Cauldron2D.Grid.Coarse.Regions](Cauldron2D.Grid.Coarse.Regions.md): The regions of a grid for `Cauldron2D.Grid.Coarse`: within each block of `block` tiles a side, the open tiles joined edge to edge, numbered from 1. - [Cauldron2D.Grid.Coarse.Search](Cauldron2D.Grid.Coarse.Search.md): A* over a graph given as functions, as `Cauldron2D.Grid.Coarse` searches its regions and its tiles. - [Cauldron2D.Grid.Coarse.Space](Cauldron2D.Grid.Coarse.Space.md): Positions on a grid of `width` by `height` tiles whose opposite edges join when `wrap?`, as `Cauldron2D.Grid.Coarse` measures them. Any map with those three keys is a space. - [Cauldron2D.Grid.Fov](Cauldron2D.Grid.Fov.md): Recursive shadowcasting: which tiles an observer can see from where it stands. - [Cauldron2D.Grid.Path](Cauldron2D.Grid.Path.md): Ways across a tile grid: breadth-first for the fewest steps, A* for the cheapest. - [Cauldron2D.Input](Cauldron2D.Input.md): Turns terminal events into the set of actions a player is holding. - [Cauldron2D.Input.Pad](Cauldron2D.Input.Pad.md): Turns game-controller events into the set of actions a player is holding. - [Cauldron2D.Ledger](Cauldron2D.Ledger.md): Every player's results, kept on disk, and the boards made from them. - [Cauldron2D.Ledger.Lock](Cauldron2D.Ledger.Lock.md): The lock that keeps a ledger file to one operating system process: `.lock`, holding the process id of the holder. A lock whose process is gone counts as free; a file a DETS table of this process already has open is held. - [Cauldron2D.Ledger.Recorder](Cauldron2D.Ledger.Recorder.md): One world's scribe: subscribed to its world's events (`Cauldron2D.World.Events`), it puts every `{tag, row}` — `:result` unless told otherwise — in the ledger under the world's name. It stops when the world does. - [Cauldron2D.Loop](Cauldron2D.Loop.md): A fixed timestep. - [Cauldron2D.Map](Cauldron2D.Map.md): A tile map written as text: a grid of characters, one per tile, with optional `name: value` options ahead of it. - [Cauldron2D.Mask](Cauldron2D.Mask.md): Which pixels of a picture are solid, one bit each. - [Cauldron2D.Minimap](Cauldron2D.Minimap.md): The whole map in a few rows of braille: walls in one colour, marks — players, bases, goals — over them, each a dot or a two-by-two. - [Cauldron2D.Native](Cauldron2D.Native.md): Where cauldron_2d's compiled native code is: `priv/native/`, the architecture as `:erlang.system_info(:system_architecture)` gives it. Builds for different machines (macOS, Linux) sit side by side in one checkout, and each loads its own. The Makefile writes to the same folder, which `mix.exs` passes it as `PRIV_DIR`. - [Cauldron2D.Overlap](Cauldron2D.Overlap.md): Whether placed shapes (`Cauldron2D.Shape`) touch each other, a point, a rectangle, a circle or a line. - [Cauldron2D.Parallax](Cauldron2D.Parallax.md): A background of several depths, each read at its own share of the camera's motion. - [Cauldron2D.Parallax.Bands](Cauldron2D.Parallax.Bands.md): Horizontal bands of one layer, each scrolling at its own factor. - [Cauldron2D.Parallax.Layer](Cauldron2D.Parallax.Layer.md): One depth of a parallax background. - [Cauldron2D.Parallax.Panorama](Cauldron2D.Parallax.Panorama.md): A layer that is one picture, repeated. - [Cauldron2D.Parallax.Preview](Cauldron2D.Parallax.Preview.md): A camera moved across a set of layers, as a list of pictures. - [Cauldron2D.Parallax.Scatter](Cauldron2D.Parallax.Scatter.md): A cell function that places art by hashing the tile's own coordinate. - [Cauldron2D.Parallax.Strip](Cauldron2D.Parallax.Strip.md): A cell function over authored tiles, wrapping in one or both directions. - [Cauldron2D.Particles](Cauldron2D.Particles.md): Short-lived sprites — sparks, debris, smoke — with a cap on how many exist at once. - [Cauldron2D.Paths](Cauldron2D.Paths.md): Where a game keeps its files: one directory per game under each of the XDG base directories. - [Cauldron2D.Player](Cauldron2D.Player.md): A player's side of a `Cauldron2D.World`: join, send input, receive frames, leave. - [Cauldron2D.Projection.Canvas](Cauldron2D.Projection.Canvas.md): A framebuffer of RGBA rows that stamps are painted onto, and the stamps themselves. - [Cauldron2D.Projection.FirstPerson](Cauldron2D.Projection.FirstPerson.md): Renders the world from a point inside it, looking along a heading: standing arts as textured walls of their height, floors textured to the horizon, movers and the standing arts of no height as billboards, everything fading towards the atlas's void colour with distance. - [Cauldron2D.Projection.Glyphs](Cauldron2D.Projection.Glyphs.md): A projection drawn as one of the atlas's two-character glyphs per slot. - [Cauldron2D.Projection.Ground](Cauldron2D.Projection.Ground.md): Samples a textured ground plane in perspective: for each pixel below the horizon the world point it looks at, the tile there, and that tile's texel, faded towards a void colour with distance. - [Cauldron2D.Projection.Iso](Cauldron2D.Projection.Iso.md): Composes a view of the world as an isometric picture: floors as diamonds, standing arts as blocks with a top and two shaded sides, movers and flat overlays as upright sprites, painted back to front. - [Cauldron2D.Projection.Mode7](Cauldron2D.Projection.Mode7.md): Composes the world as a ground plane seen in perspective from above it, turning freely: the floor recedes to a horizon, movers stand on it as billboards, and everything fades towards the atlas's void colour with distance. - [Cauldron2D.Projection.Oblique](Cauldron2D.Projection.Oblique.md): Composes a view of the world on a square grid seen from above and in front: floors as squares, standing arts as a front face with their top above it, movers upright. - [Cauldron2D.Projection.Volume](Cauldron2D.Projection.Volume.md): A coloured region of space that tints whatever is seen through it, and the arithmetic a projection draws one with. - [Cauldron2D.Projection.Volume.Native](Cauldron2D.Projection.Volume.Native.md): The per-pixel half of `Cauldron2D.Projection.Volume`, in C. - [Cauldron2D.Projection.Volume.Shape](Cauldron2D.Projection.Volume.Shape.md): What a projection needs to know about the shape of a `Cauldron2D.Projection.Volume`. - [Cauldron2D.Projection.Volume.Shapes](Cauldron2D.Projection.Volume.Shapes.md): The shapes `Cauldron2D.Projection.Volume` knows without being told: a sphere, a cylinder, a cone, a beam, and a set of whole grid tiles. - [Cauldron2D.Render](Cauldron2D.Render.md): A frame drawn once from a list of operations. - [Cauldron2D.Renderer](Cauldron2D.Renderer.md): Chooses between drawing a surface as pixels or as glyphs. - [Cauldron2D.Replay](Cauldron2D.Replay.md): A record of everything that was done to a world, and the means to do it again. - [Cauldron2D.Replay.Viewer](Cauldron2D.Replay.Viewer.md): Plays a `Cauldron2D.Replay` back on a clock, sending a watcher the frames one recorded player saw. - [Cauldron2D.Rng](Cauldron2D.Rng.md): A random number generator carried in a game's state rather than the process dictionary. - [Cauldron2D.Robot](Cauldron2D.Robot.md): A computer player: a process that joins a world as `{:robot, n}` and plays by its view, deciding every few frames through a brain module the game supplies. - [Cauldron2D.Route](Cauldron2D.Route.md): A way from where something stands to where it was sent, and walking it a step at a time. - [Cauldron2D.Save](Cauldron2D.Save.md): Saved games: a game state kept on disk under a slot name, and read back to start a `Cauldron2D.World` from with its `:state` option. - [Cauldron2D.Sectors.Automap](Cauldron2D.Sectors.Automap.md): A map of the level drawn from above, out of the lines the player has seen: as lines for `Cauldron2D.Sectors.Frame.lines/2`. - [Cauldron2D.Sectors.Blockmap](Cauldron2D.Sectors.Blockmap.md): A sector map's lines, and the bodies moving through it, sorted into square blocks so that movement and traces only look at what is near. - [Cauldron2D.Sectors.Bsp](Cauldron2D.Sectors.Bsp.md): A binary space partition of a sector map: the order to draw it in from any point, front to back, and the convex piece any point is in. - [Cauldron2D.Sectors.Frame](Cauldron2D.Sectors.Frame.md): An indexed-colour picture drawn a column, a plane or a line at a time — the drawing a sector view does — and turned into RGBA through a palette at the end. - [Cauldron2D.Sectors.Light](Cauldron2D.Sectors.Light.md): Light as table lookups: a ramp of light tables built from a palette, and which table a surface at some light level and distance is drawn through. - [Cauldron2D.Sectors.Map](Cauldron2D.Sectors.Map.md): A level made of sectors: rooms of any shape, each with its own floor and ceiling height, joined and walled by lines, the geometry a sector view and sector movement read. - [Cauldron2D.Sectors.Move](Cauldron2D.Sectors.Move.md): Moving a body through a sector map: whether it fits where it is going, what floor and ceiling it finds there, and sliding along a wall it runs into. - [Cauldron2D.Sectors.Noise](Cauldron2D.Sectors.Noise.md): How far a sound carries through a sector map: from the sector it is made in, into every sector joined to it by an opening that is not shut. - [Cauldron2D.Sectors.Overlay](Cauldron2D.Sectors.Overlay.md): A picture drawn flat on the frame, stretched to a rectangle: a held weapon, a status bar, a face, a menu. - [Cauldron2D.Sectors.Pictures](Cauldron2D.Sectors.Pictures.md): The pictures a sector view draws from — wall textures, floor textures, sprites — and the light tables that darken them, held ready for `Cauldron2D.Sectors.Frame`. - [Cauldron2D.Sectors.Sight](Cauldron2D.Sectors.Sight.md): Whether one point in a sector map can see a body: the straight line between them must pass through every opening it crosses, between floor and ceiling. - [Cauldron2D.Sectors.Trace](Cauldron2D.Sectors.Trace.md): What a straight line across a sector map crosses, nearest first: the map's lines and the bodies filed in a `Cauldron2D.Sectors.Blockmap`. - [Cauldron2D.Sectors.View](Cauldron2D.Sectors.View.md): Draws a sector map from a point inside it: walls, floors, ceilings and sky, and the things standing in it, nearest in front, into a `Cauldron2D.Sectors.Frame`. - [Cauldron2D.Sessions](Cauldron2D.Sessions.md): Who is logged in on the node, by whatever kind of client, told to whoever asks. - [Cauldron2D.Shape](Cauldron2D.Shape.md): A solid shape placed in world pixels, for collision. - [Cauldron2D.Sheet](Cauldron2D.Sheet.md): A `Cauldron2D.Atlas` packed onto one raster, with an index of where every art is. - [Cauldron2D.States](Cauldron2D.States.md): State tables: an actor's animation and behaviour as data, each state a picture shown for a number of ticks, an action run on entering it, and the state that follows. - [Cauldron2D.Stats](Cauldron2D.Stats.md): How this node is keeping up: every running world as `Cauldron2D.World.stats/1` gives it, and the node it runs on. - [Cauldron2D.Steer](Cauldron2D.Steer.md): Choosing which of eight directions to walk toward a target, trying the next best when the best is blocked — the chase that makes a pursuer feel its way round corners without finding a path. - [Cauldron2D.Surface](Cauldron2D.Surface.md): Composites a grid of cells into one `FrenchCurve.Raster`. - [Cauldron2D.Test](Cauldron2D.Test.md): Drives a `Cauldron2D.Game` in a test, with no world process and no clock: join players, hold actions, run ticks, read views and events. - [Cauldron2D.Thinkers](Cauldron2D.Thinkers.md): The things in a world that change by themselves each tick — a door closing, a lift waiting, a light flickering, a creature — kept in a fixed order so a world run twice from the same start runs the same. - [Cauldron2D.Trace](Cauldron2D.Trace.md): A trace of what happened and when, written as one line per event, and read back for `mix cauldron.report`. - [Cauldron2D.Tuning](Cauldron2D.Tuning.md): Every number that decides how a game plays, in one value the game carries in its state and a settings page can show and change. - [Cauldron2D.Turn](Cauldron2D.Turn.md): The cosine and sine of an angle in degrees, exact for whole quarter turns so a picture or shape turned by 90, 180 or 270 degrees lands on the same pixels as one mirrored by hand. - [Cauldron2D.World](Cauldron2D.World.md): Runs a `Cauldron2D.Game` at a fixed tick and keeps its players supplied with views. - [Cauldron2D.World.Events](Cauldron2D.World.Events.md): A world's events, told each tick to processes that are not its players — a recorder, a referee, a bot that reads the game without playing it. - [Cauldron2D.World.Presence](Cauldron2D.World.Presence.md): Who comes and goes in every world on the node, told to whoever asks. - [Cauldron2D.Worlds](Cauldron2D.Worlds.md): The worlds a game offers: a `Cauldron2D.World` each, with whatever runs beside it, started on the first use of its name and stopped again once no player has been in it for a while. - [Cauldron2D.Worlds.OnDemand](Cauldron2D.Worlds.OnDemand.md): The name registry behind `Cauldron2D.Worlds.world_name/1`: `{:via, Cauldron2D.Worlds.OnDemand, id}` resolves to world `id`, starting the world when it is not running. An id no world is registered for resolves to `:undefined`. `{:on, node, id}` (`Cauldron2D.Worlds.world_name/2`) resolves to world `id` of a connected `node` the same way, started there; `:undefined` when the node cannot be reached. - [Cauldron2D.Worlds.Sweeper](Cauldron2D.Worlds.Sweeper.md): Stops worlds that have had no human in them for a while; they start again on the next use of their world's name. Each sweep also seats the children a running world is short of (`Cauldron2D.Worlds.reseat/1`). - [Cauldron2D.Worlds.Table](Cauldron2D.Worlds.Table.md): The registered worlds, one record each, in an ETS table this process owns. ## Mix Tasks - [mix cauldron.report](Mix.Tasks.Cauldron.Report.md): Summarise a trace written by `Cauldron2D.Trace`.