Skip to main content
🧙‍♂️ Kris Kowal 🐘 🐙 🧛 📌 📬 Book Store

Lobster Quest, Part 3: The Devlog, from Roadmap to Sky Box

A window titled Rounded Corners: a green field crossed by light blue water in blocks, every corner where water meets land drawn as a black quarter-circle outline, so the water runs in smooth channels.
Rounded corners for water, April 2020

This is the last of three parts from my Patreon devlog of the first Emoji Quest, the one Josh Corbin and I wrote in Lobster. It runs from a roadmap in November 2019 to the last update, at the end of August 2020: a home on GitHub, a world editor, water and lava with rounded corners, dialogs that mix text with emoji, and a sky box over it all. Each section is one post, with its date.

The roadmap #

November 23, 2019

We’re still in the exploration phase for Emoji Quest development, and we’ve made some good progress. Here’s a recap of what we’ve done.

World building for the untitled emoji game started in 2006. It was originally a MoinMoin wiki on a domain server Ryan Witt and I ran out of his dorm at Caltech. I consolidated it into a Google Document.

Joshua Corbin scouted out Roguelike Celebration four years ago. We’ve been stewing in the Roguelike mythos since. We “founded” the BØRKSHOP to build a Roguelike, with encouragement from our colleagues Rix and Tor. I wrote a terminal rendering library, COPS. Josh turned that around and made AnANSI. Josh wrote an entity component system. I put those together and rendered BØRK: Escape from the Scandinavian Home Furnishings Labyrinth.

BØRK in a terminal: a gray labyrinth of rooms walled in dotted lines and crossed by navy blue corridors patterned with angle brackets, the rooms crowded with two-letter furniture names on brown, tan, white and black tiles, such as Vo, Je, Pr, Ph, Kj, Un and Ik, and stacks of bracketed yellow crates down the right side.
The BØRKSHOP’s first world

We also learned a bunch about running cellular automata!

We’ve been rolling around the idea of using emoji for a Roguelike in the terminal for some time, but couldn’t get even modern terminals to coöperate. What we hadn’t considered until recently was making a game about emoji! At some point this year, I realized that a lot of the Die as in Dice world building would work with emoji.

I solicited ideas for emoji crafting recipes. Then Lydia and I went on vacation and wrote pages upon pages of ideas into my phone’s reminders app. The concept has legs!

So, what followed is a draft Emoji Quest walkthrough. This is a graduated introduction to the game’s mechanics from the perspective of a player walking through the game along the happy path. It contains the skeleton for the whole game, but the detail tapers off toward the end. There is plenty written already to make a technology demo that pulls all the mechanics together, so that’s what we’re focusing on now.

From the walkthrough, there’s enough coherent information to start filling in the game’s data sheets. These describe all of the game entities and interactions. Much of the game’s engine will be driven by these sheets.

All four were Google documents; the links here go to copies, exported in October 2026. The data sheets are also checked in to Lobster Quest, as TSV.

Josh and I then discovered Lobster and started writing exercises, or essays, to prove that we can make this game on that foundation.

Josh put together a demo of a wizard in a grove with four elementals. I put together the Langton’s Ents demo, which gave us a springboard for animating transitions between cells. Josh integrated that notion in the grove wizard demo.

The wizard in the grove, in line art: a square field of dark checkered cells walled by rows of green outlined trees, with a purple wizard in the middle and four elementals around it, a teal tornado, an orange flame, a green globe and a blue droplet.
A wizard in a grove with four elementals, in line art
Demo by Josh Corbin

Meanwhile, I was worrying about rendering emoji. Josh got line art emoji working. I was unable to get Lobster to render bitmap emoji from any font, so I took a new tack, looking for a suitable emoji font project that exposed the underlying graphics assets. There were a few, and generally the quality and licensing were a rough trade-off. I stumbled into OpenMoji, which is pretty comprehensive, minimalist, and has a solid license.

I took a run at generating a sprite atlas from OpenMoji assets and the Emoji Quest spreadsheets, then Josh took over that project and carried it way further. The atlas so far has these assets:

The sprite atlas: a twelve by twelve grid of color emoji on white, among them faces of moods and ailments, medals, tools and weapons, fruit and vegetables, a fir tree, animals, buildings and guards, weather, moons, planets and globes.
The sprite atlas
By Josh Corbin, after a first run of mine, from OpenMoji’s emoji, under CC BY-SA 4.0

You may recognize Langton’s Ent in the sprite map! Since then, Josh reprised the Wizard in the Grove with OpenMoji.

The wizard in the grove, with OpenMoji: the same checkered field walled by color emoji trees, leafy and fir, with a wizard in a blue robe in the middle, a blue cloud, an orange flame, a green shamrock and a blue droplet around it.
The Wizard in the Grove, with OpenMoji
Demo by Josh Corbin; emoji by OpenMoji, under CC BY-SA 4.0

Next steps #

We’re making good headway with the project, but haven’t yet proven everything we’ll need to finish the project, though we’re confident in the hypothesis.

  1. The data sheets call for dialogs to pop up when you bump into tiles that “talk”, including signs. The dialogs incorporate rich text and emoji. We think we can generate Lobster code that drives immediate mode rendering with line wrap to a fixed-width frame buffer that interleaves text and images. The Lobster gui module does something similar, but doesn’t handle emoji or line wrapping. We can write something custom, and it should be fine.
  2. We need to connect Josh’s grove demo, my cube rendering demo and my cube browsing demo, with both animated motion and animated camera transitions.
  3. At some point, we may not want to render the entire world every turn. We’ll probably be surprised how far we get before that point, but we’ll eventually need to generate smaller meshes with higher resolution textures and stare at them close up. This will be our geometric “scene graph”.
  4. We have begun thinking about input modality. We are thinking that the input mode will be a nine-key direction pad, all with emoji! The center will be a rest button, and the diagonals will correspond to inventory slots. Your inventory will never exceed nine slots, but if we need to break that glass, we’ll introduce a bag-of-holding plane. The bag of holding might be BØRK.
  5. We need to generate the rule sets for crafting and bumping from the data sheets. These will drive the game engine.
  6. In a hopefully nearby future, we’ll need to figure out how to deploy Lobster on iOS, Android, and WASM for the web.

These are all the avenues on my mind at the moment.

A home #

March 26, 2020

A window titled Editor: a green field drawn in OpenMoji emoji, ringed by leafy trees and a few firs, with a castle at the center between two guards in bearskin hats, a red cursor box around the castle, a bank and a telescope above, a factory below, and a sheep and a ram in the lower left.
The Emoji Quest world editor, on Euia

The Emoji Quest project now has a home on GitHub. The prototypes that Josh Corbin and I have been working on have moved there. I’ve paved out the next steps on my road map on the issue tracker. Contributions are certainly welcome.

Emoji Quest now also has a home page on the web. It is largely a placeholder at this time.

That home on GitHub was borkshop/emojiquest. When we started over in JavaScript, the Lobster version moved to borkshop/lobsterquest, and the new game took the old name in July 2023, along with the home page, emojiquest.app.

Wash and lava #

April 25, 2020

Around the Whirled (also on YouTube)

I’ve added a couple of small but important features to the Emoji Quest world editor: drawing water and magma. This brings to life the islands of Occia, the volcanoes of Oria, and their mingling in the pit city of Dis (in the state of Dysia, on the world of Daia).

In the first draft, the editor simply rendered colored squares for land, water and magma. The colors are all from the OpenMoji palette, and vary based on the color scheme intrinsic to each face of the world.

The first draft of the editor on Occia: a light blue sea with blocky orange islands drawn as plain squares, palm trees on the islands, a merman with a trident, a desert island and a swimmer at the center inside a pale cursor box, and a turtle to the right.
The first draft, in squares

This let me do the bulk of the drawing, and made clear that the final version would need rounded corners and outlines to be consistent with the style of the emoji.

To that end, I figured that I could get away with just drawing three junction tiles. A junction tile is a world tile offset by half a tile size, so its center covers a junction among four world tiles. Though in this picture it is not “clear”, there are white opaque regions on one side of each outline.

Three black outlines on white, each one tile square: a quarter-circle corner in the lower left of the first, a straight edge across the second, and in the third a straight edge that turns down through a quarter circle at its right end.
The three motifs

All the other tiles can be constructed by composition and rotation from this very small sprite map.

A four by four table on a dark background, its rows labeled 00, 01, 10 and 11 and its columns the same, each cell showing in gray blocks which of the four quarters around a junction are filled: from empty at 00 00 to all four filled at 11 11.
The sixteen junctions

The sprite map assembled from those three motifs contains all 16 variations, which can be addressed from a four-bit vector that tells us whether each of the neighboring tiles is filled in with either water or magma.

So the next chore is to create a plan for how to build each of these junction tiles from the primitive tiles, or make composite tiles from previously generated tiles. This chart shows the bit vector for each junction, which is its index in the array of tiles, a block art representation of the corresponding junction, how to compose it from the primitives, then the build plan I decided to use for each. The rotations are clockwise (cw), counter-clockwise (ccw), and about face (af).

       0123
+----+------+------+--------------+-----------+
|  0 | 0000 | "  " | clear        |           |
+----+------+------+--------------+-----------+
|  1 | 0001 | " ▄" | Aaf          | 8af       |
+----+------+------+--------------+-----------+
|  2 | 0010 | "▄ " | Accw         | 8ccw      |
+----+------+------+--------------+-----------+
|  3 | 0011 | "▄▄" | Baf          | 12af      |
+----+------+------+--------------+-----------+
|  4 | 0100 | " ▀" | Acw          | 8cw       |
+----+------+------+--------------+-----------+
|  5 | 0101 | " █" | Bcw          | 12cw      |
+----+------+------+--------------+-----------+
|  6 | 0110 | "▄▀" | Acw and Accw | 9cw       |
+----+------+------+--------------+-----------+
|  7 | 0111 | "▄█" | Ccw          | 13cw      |
+----+------+------+--------------+-----------+
|  8 | 1000 | "▀ " | A            |           |
+----+------+------+--------------+-----------+
|  9 | 1001 | "▀▄" | A and Aaf    | 8 and 8af |
+----+------+------+--------------+-----------+
| 10 | 1010 | "█ " | Bccw         | 12ccw     |
+----+------+------+--------------+-----------+
| 11 | 1011 | "█▄" | Caf          | 13af      |
+----+------+------+--------------+-----------+
| 12 | 1100 | "▀▀" | B            |           |
+----+------+------+--------------+-----------+
| 13 | 1101 | "▀█" | C            |           |
+----+------+------+--------------+-----------+
| 14 | 1110 | "█▀" | Cccw         | 13ccw     |
+----+------+------+--------------+-----------+
| 15 | 1111 | "██" | fill         |           |
+----+------+------+--------------+-----------+

The chart in the post, like the comment in the code, gave 14 as 12ccw; the build plan and the code make it from 13, as the table now says.

From this table we can construct a build plan, where we first produce the primitive textures, then each of the composites from textures previously produced.

  0 = clear
  15 = fill
  8 = A
  12 = B
  13 = C
  4 = 8cw = Acw
  1 = 8af = Aaf
  2 = 8ccw = Accw
  9 = 4 + 1 = A and Aaf
  6 = 9cw or 4 + 2 = Acw and Accw
  5 = 12cw = Bcw
  3 = 12af = Baf
  10 = 12ccw = Bccw
  7 = 13cw = Ccw
  11 = 13af = Caf
  14 = 13ccw = Cccw

All of the composites factored out of a single Lobster function that could read one texture, perform a rotation, and write back to another texture, also drawing the original texture before rotation. Two of the textures are composites of the primitive corner tile, but one of those is a rotation of the other.

def copy_rot(dst, src, rot, dup):
    render_to_texture(rounded_corner_textures[dst], res_i, false, nil, 0):
        gl_set_shader("textured")
        gl_set_primitive_texture(0, rounded_corner_textures[src])
        gl_scale(res)
        if dup:
            gl_rect(xy_1)
        gl_translate(xy_1/2)
        gl_rotate_z(rot)
        gl_translate(-xy_1/2)
        gl_rect(xy_1)

(rounded_corners.lobster)

A small Lobster program shows the results, the picture at the top of this page.

Then, drawing the actual world just involves drawing one of these tiles at every position in the world.

def draw_junctions(face, flag):
    def bit(n): return if n: 1 else: 0
    def draw_junction(v, nw, ne, sw, se):
        let junction_flags = (
            (bit(flags[nw] & flag) << 3) |
            (bit(flags[ne] & flag) << 2) |
            (bit(flags[sw] & flag) << 1) |
            (bit(flags[se] & flag) << 0)
        )
        gl_translate(v-xy_1/2):
            gl_set_primitive_texture(0, rounded_corner_textures[junction_flags])
            gl_unit_square()

(daia_browser.lobster)

Lobster’s texture drawing shader allows us to change the white portion of every tile to any color we like, leaving black and clear alone, so we use a shade of blue for water, where the shade depends on which face we’re drawing, and dark red for magma regardless.

gl_scale(xy_1 * detail)
gl_clear(face_colors[face])

gl_set_shader("textured")
gl_color(face_water_colors[face])
draw_junctions(face, daia_map_flag_water)
gl_color(magma_color)
draw_junctions(face, daia_map_flag_magma)

(daia_browser.lobster)

Since junctions are offset from the center of each world tile, and since the neighbors to edge tiles are most easily addressed using the world’s adjacency matrix, as opposed to the usual row-major coordinate-to-index math, it is a bit tricky to render the eastern and southern edges of each face. Walking the area of the face to cover the whole body and the north and west edges does most of the work, but then we follow up by walking once along the eastern and southern edges.

let face_offset = pov.area * face
// the body including the north and west edges
for(pov.area) index_within_face:
    let v = float(xy{
        index_within_face % pov.size,
        index_within_face / pov.size,
    })
    let se = face_offset + index_within_face
    let ne = neighbors[se][northward]
    let sw = neighbors[se][westward]
    let nw = neighbors[ne][westward]
    draw_junction(v, nw, ne, sw, se)
// down the east edge
for(pov.size) south_index:
    let v = float(xy{ pov.size, south_index })
    let sw = face_offset + pov.size * south_index + pov.size - 1
    let se = neighbors[sw][eastward]
    let ne = neighbors[se][northward]
    let nw = neighbors[ne][westward]
    draw_junction(v, nw, ne, sw, se)
// across the south edge
for(pov.size) east_index:
    let v = float(xy{ east_index, pov.size })
    let ne = face_offset + pov.area - pov.size + east_index
    let se = neighbors[ne][southward]
    let nw = neighbors[ne][westward]
    let sw = neighbors[nw][southward]
    draw_junction(v, nw, ne, sw, se)

(daia_browser.lobster)

I believe that captures the æsthetic I was imagining, and one I hope you all enjoy.

The Daia log #

July 13, 2020

The editor on Euia, a green field of leafy trees, firs and gray mountains around a castle and two guards, a bank, a cow and a lake, with a light blue dialog box with rounded corners across the bottom: “Hark! I’m a sharp Major in service to her Majesty, a small princess emoji, Princess Dice…”, with a sharp Major and Princess Dice in bold. In the corner, “5284, EUIA, MAJOR”.
The first dialog, with emoji in the text

One of the challenges with Emoji Quest is text. The game requires beautiful rendering of emoji and text, and the text needs to be able to flow for dialog boxes.

I had originally conceived the idea of Emoji Quest intending to implement it as a web application. The virtue of the approach was that I could lean heavily on SVG and HTML, and on system emoji font rendering, for both the scene and dialog. Of course, 3D and performance would be difficult, and emoji rendering would not be consistent between platforms.

For reasons unrelated to these requirements, Josh and I started writing the game in Lobster, which has its own challenges. Many things come easy, like 3D and performance. The engine does support text rendering, but not color emoji. So I turned to OpenMoji and took up the challenge of writing a text flow engine that’s just suitable enough for rendering the Emoji Quest dialogs.

It’s taken some time, but I’ve started to crack the problem. First I wrote a barely working version of the text flow algorithm, just to know what kind of code I’d need to generate. Emoji Quest dialogs are defined in a Google Spreadsheet with emoji inline. I wrote a Go program that could scan all of these emoji, find them among the valid OpenMoji defined in its data files, add them to the sprite atlas, and generate a gigantic Lobster function with two levels of switches. I reüsed the rounded corners stuff that renders rivers to make dialog boxes with rounded borders.

Above is a screenshot. It’s far from perfect, but at long last, the text flows, the box is the right size, text doesn’t bleed over the borders, bold and italics work, and sometimes the right emoji get drawn.

Ethyria, the sky box #

August 31, 2020

Ethyria, the sky box (also on YouTube)

Today, for our regularly scheduled BØRKSHOP meeting, I shared my screen (with Josh) and did a bit of work on Emoji Quest.

The first thing up was rendering the character emoji in front of every dialog box, and rotating through the dialog “bumps” for the selected entity. Here’s the dialog for a tree.

The editor on Euia, rows of leafy trees, firs and gray mountains, with a red cursor box on an apple tree and a light blue dialog box below it reading “Knock, knock.”, with a small tree emoji before the words. In the corner, “5095, EUIA, APPLE TREE/HARDWOOD”.
The tree speaks first

Then, of course, because programming is hard, here’s how this messed up my bespoke word wrap code.

The same field with the cursor on the bank and a dialog box reading “Greetings, I am Phil, a lesser demon of monetary exchange…”, with a small banker emoji before the words; the word “demon” runs past the box’s right edge. In the corner, “5159, EUIA, EUIA BANK/BANK”.
Phil the banker, overflowing

So, there’s more fun for next time.

I also started rendering the “sky box”, which will in due time be a playable world full of star emoji and astrological symbols. That’s the video above.

The sky box is the land of Ethyria, where our hero will undertake their penultimate quests for power and fire. I’m considering an intermediate, transparent layer, where they might find power among the weather emoji.

Of course, on this front too, software proved difficult and left me with a mess to clean up next time. The sky box works in isolation, but not in combination with the world editor. So, I’ve left myself a little note.

daia_browser.lobster(249): VM error: index 3842 out of range 294 of: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ....]

So, the adventure continues!

I should mention, the sky box is largely the same code as the surface box. Wouter, creator of the Lobster language we’re using to build Emoji Quest, hinted to me last year that, because graphics triangles are directional, that is, transparent when viewed from the wrong side, inverting them is just a matter of reversing the order of the vertices.

Since then #

That was the last of the Lobster devlog. My last commits to Lobster Quest are from the day before that post, August 30, 2020.

I set Lobster aside because it became too difficult to navigate the particular needs of Emoji Quest: to render emoji on the surface of a 3D cube, and at the same time to render text, to flow text, and to interpolate emoji in text. That required too much novel engineering over well-solved problems.

In February 2021, Emoji Quest began again, in JavaScript, on the web. There I ultimately had to give up 3D rendering, but came up with a fun 2D approach for exploring the net of a cube, by rotating boxes and viewports. That is the Emoji Quest you can play today: a cube of six 81 by 81 faces, a nine-key pad with the pack and two hands in its corners, dialogs drawn by the browser’s own emoji font, and a world editor of its own.


Lobster Quest:

  1. Langton’s Ents
  2. Stitching a Cube
  3. The Devlog, from Roadmap to Sky Box

First published on Patreon in five posts: “Emoji Quest Roadmap”, November 23, 2019; “A home for Emoji Quest”, March 26, 2020; “Wash and Lava”, April 25, 2020; “Daia Log”, July 13, 2020; and “Ethyria, the sky box”, August 31, 2020.

The screenshots draw OpenMoji’s emoji, under CC BY-SA 4.0.