Skip to content
@gravitton

Gravitton

Go libraries for game development
Gravitton

Stars Go Dev Reference Go Version Software License Blog

Go libraries for game development


Generic, allocation-conscious and tested to 100% coverage, with results that stay bit-identical across amd64 and arm64.

Libraries

One map of walls, rough ground, a scout and a goal, drawn by each library in turn: as shapes, as hexes, and as grids of every layout. Each library builds on the one before it.

Immutable 2D geometry: points, vectors and shapes with their tests, casts and constructions.

The map drawn with geometry: the scout's view cast by rays that stop at the walls, with one ray reflected until it reaches the goal, the scout swept toward the goal until it hits a wall, and a Bezier route to the goal, checked against the wall edges

Hexagonal grid math: coordinates, rings, lines, line of sight and field of view.

The map in hexes: the scout's field of view, its line to the goal, hidden behind a wall, and its field of view in a sector toward the goal

2D grids with rectangular, isometric and hexagonal layouts, range and sight queries, and pathfinding, on geometry, hexagon and container.

The map on a rectangular, an isometric and a pointy-top grid: on each the scout's field of view and its cheapest path to the goal around the rough ground

Supporting libraries

  • container: generic containers, a table of values per index and an immutable sorted set, on geometry.
  • spatial: broad-phase spatial indexes, a spatial hash with box, point and cast queries and touching pairs, on geometry.
  • assert: lightweight test assertions.
  • errors: a drop-in superset of errors with fields, stack traces and multi-errors.

Writing

Each post on the blog takes one decision from these libraries and shows the code and the numbers behind it.

Contributing

Bug reports and proposals are welcome in each library's issues. Please see Contributing before opening a pull request, and Security to report a vulnerability.

License

Every library is released under the MIT License, in the LICENSE.md of its repository.

Pinned Loading

  1. geometry geometry Public

    Generic, immutable 2D geometry: shapes, paths, collisions and raycasts

    Go 4

  2. hexagon hexagon Public

    Hexagonal grid math: coordinates, ranges, lines and field of view

    Go 8

  3. grid grid Public

    Generic 2D grids: rectangular, isometric and hexagonal, with sight and pathfinding

    Go 5

  4. container container Public

    Generic containers: a 2D array indexed by points and an immutable sorted set

    Go 1

  5. assert assert Public

    Lightweight test assertions

    Go 1

  6. errors errors Public

    Structured errors with fields, causes and stack traces, and a concurrent-safe multi error

    Go 1

Repositories

Showing 10 of 10 repositories

Top languages

Loading…

Most used topics

Loading…