Triangle Grids
kvachev.com
kvachev.com
For a few years I've been working on a tri-grid RTS with buildable units: https://cragwind.com/blog/posts/triangle-text-grids/
I originally tried hexagons, but I ultimately chose triangles because they can compose into hexes and there were already so many hex-based games. First I tried a design using separate grids floating in continuous space but later switched to a complete grid-based world as it could make for a novel turn-based classic roguelike or strategy game. It's more limited than continuous space, although with tri- or hex-grids you get six rotations versus four with squares.
One difficulty with tri-grids is the poor spatial locality of triangles versus squares or hexes. For example, when calculating influence maps for AI on a triangle grid, each cell score is effectively stretched to the triangle vertices rather than representing a more consolidated or circular region (so for this purpose hexes would be ideal).
Like other grids, transforms (translation/rotation) on a tri-grid can be done with all integer math (and generally, if the game world is grid-based, everything but graphics/animations can be integer math). Rotations about a cell center are trickier (and are limited to three distinct rotations) but can be done by scaling up coordinates and then back down. I'll write up more details if anyone is interested.
I was surprised to find play testers had a hard time internalizing the grid - e.g. making mistakes that result in losing the game in the opponents next turn.
Also, I used simple x, y coordinates for each cell with even-numbered indexes being the upward-pointing triangles and odds being the downward-pointing ones. Similarly odd-indexed rows were offset right by half a triangle to make them align properly
[edits]: added details
https://en.m.wikipedia.org/wiki/Kisrhombille
https://github.com/johnalexandergreene/Geom_Kisrhombille#rea...
I've prototyped the 3D equivalent, which is composed of tetrahedrons and 13 axes (I wonder if that 3D tiling has a name). The tetrahedrons aren't the same size, so it's a bit awkward to work with but might be suitable for 3D models/art.
Yes it makes the map a bit ununiform and awkward. But.
Another way to use it would be to treat it as a substrate for a tesselation composed of a set of tiles. Like 2 or 5 or whatever basic shapes, all based on that awkward tessellation, arbitrarily fitted together to fill the space.
The image at that third link takes an approach like that. An alphabet of approximately 20 shapes. (A "self tiling system" I think.)
I'm not sure how useful that is but there you go
https://store.steampowered.com/app/909660/Vagrus__The_Riven_...
That said, most reviews mention it's punishingly, almost unfairly difficult. I took the plunge anyway, sending my money to indie devs that want to try something new, but if I find it too difficult I'll probably end up giving up in frustration.
What was your experience with this game?
Started playing this, going through the tutorial scenario. The world building indeed has strong vibes of Dark Sun and the Dying Earth genre.
Again, thanks for the recommendation!
I thought it was advanced wars but I don't remember walker mech units?
You can’t do that with tetrahedrons. You can use triangular prisms, but IMO, that’s cheating. You can also split a cube into six pyramids with a square base and height ½, but I don’t think that’s a natural way to fill space.
Looking at https://mathworld.wolfram.com/Space-FillingPolyhedron.html, the Truncated Octahedron probably is the nicest alternative to the cube.
Crystal systems are usually described in terms of point lattices, while you're talking about polyhedra, but the Voronoi polyhedra of the points in the lattice are the polyhedra you're looking for. (This is mentioned at the end of the Wolfram™Ⓡ MathWorld™Ⓡ article you linked.) One of my favorites is the cuboctahedral honeycomb corresponding to hexagonal close-packed crystals.
Even within cubic crystals, you could reasonably argue that face-centered cubic crystals "fill[] 3-D space with ‘triangles’".
Honeycombs do not, as I understand it, have to be periodic. In particular, any 3-D rep-tile can be used to tile space in a manner similar to the Penrose tiling, and usually the result is aperiodic. I wrote a 2-D demonstration of this process is at http://canonical.org/~kragen/sw/dev3/skitch#!ffffrrrfffffrrr....
https://en.wikipedia.org/wiki/Tetragonal_disphenoid_honeycom...
but in the end it turned out to be easier to just supersample everything down to cube grid, then put some n-vectors on top than to explain everyone how to calculate stuff in that grid.
Still have couple dozen ~3" cardboard ones somewhere from when I tried to understand how exactly do they stack. Made a nice lamp when stuffed with LEDs.
looks to me like they fill space pretty nicely as an offset of cubes, in the same way as hexgrid is sort of an offset of squares
Rhombic dodecahedron looks quite nice.
And you could mix it with cube grid for artificial structures in your world.
I don't follow this. Aren't 3 of the 6 directions it's considering going through the corners of the origin triangle? If so, how do those not count as diagonals? What is the definition of "diagonal" being used?
From a north-pointing triangle, you can move south, northwest or northeast. From a south-pointing triangle, you can move north, southwest or southeast.
So across the grid as a whole, six movement directions exist.
The benefit of hexes is that every neighbor is the same. There are no "special" kind of adjacencies, like with squares or triangles, where you must decide how to consider corners, whether to allow diagonals, etc. So hexes are the only ones that don't mess up distances nor require separate kinds of adjacencies.
Also: if tracing a line from the center point of the origin triangle, some of those paths require crossing another adjacent triangle (different from the "direction" triangle). This to me signals this triangular grid is wonky for wargames/games.
See also the catalog https://zenorogue.github.io/tes-catalog/
https://store.steampowered.com/app/1854570/Colossal_Citadels...
I wish the blog post just had a link to it :(
> In Colossal Citadels I made walls and houses follow the triangular grid and I love how these procedurally-generated castles turned out [...]
Note in the sentence I quoted, "Colossal Citadels" is a link to http://colossalcitadels.com/ :)