|||

Crystal Realm Core Loop

Much has changed in the last three months with development of the Crystal Realm. Previously, I wrote about the procedural generation I use to create hexfills and writing prompts. Originally, this dumped the output into flat files organized by region. One downside of this was that world generation was coupled with the rendering of text files and maps, which meant that if I added a new feature to the generation algorithm - for example, the display of roads and rivers - then I’d have to regenerate the world from scratch in order to see it, clobbering any edits I made.

This put a bit of a block on writing actual hexfills for Crystal Realm. To get around this I upgraded the system to output the hexfills into a SQLite database, separating the generation from the rendering. This means that I can tweak individual hex descriptions, and re-render the maps as I add new features. Here’s what it looks like to edit the Crystal Realm now.

My workspace is in Obsidian, where I use a plugin called Obsidian Text Mapper to display hex maps (I also wrote this plugin). Hexes with fills are labeled and linked to their Markdown descriptions, which allows me to mouseover the map and see a preview of what’s there. This is useful for understanding the relationship between the hexfills on the map.

A screenshot of a hex map, showing the popup preview of the Tabla Mint hexfillA screenshot of a hex map, showing the popup preview of the Tabla Mint hexfill

In order to manipulate hexfills, I have a set of Python methods to help with common tasks such as name generation:

>>> namegen()
Altarisse, Miauye, Biareon, Igrodia, Nakay
>>> place_name()
Despair Valley, Gilitti's Silver Gulch, Sokol's Throne, Ash of the Ageless, Ezegsii's Water Bluff

Text search:

>>> search('airship')
[HexfillTool(hexfill=<Hexfill: 10.11 Poga's Fort>), HexfillTool(hexfill=<Hexfill: 11.26 Orchaeus>), HexfillTool(hexfill=<Hexfill: 12.23 Death Swamp>), HexfillTool(hexfill=<Hexfill: 25.10 Vale of Witches>)]

And hexfill editing:

>>> edit_hexfill_at(17, 22)

edit_hexfill_at will bring up a temporary file in VSCode, similar to a Git commit message editor. Editing and saving this file will change the hex description. As an added bonus, changing the hex number and title in the header will move the hex to that location and update it’s name.

A view of the Tabla Mint hexfill being edited in VSCodeA view of the Tabla Mint hexfill being edited in VSCode

After I’m done making edits, I can call a function to render the most recent run, which will update the Markdown containing the fills and rebuild the map files.

>>> render_run()

The output is copied directly to my Obsidian vault. I use a window tiling app to display Obsidian next to my terminal, which means that as soon as I execute render_run(), the changes will show up in Obsidian. This has greatly sped up creation of Crystal Realm, since it takes only a few seconds to move the pieces around on the map and edit descriptions.

A view of the map and terminal windows side by sideA view of the map and terminal windows side by side

Finally, I track edits with before and after states, in case I need to revert something. The current generation run is called talildril-thes-varodrium, created on May 2nd, and since then there have been 271 edits to this run.

Up next Ten Artifacts from the Crystal Realm Tone is conveyed through item and creature descriptions. Here are some mundane items that hold deep meaning for denizens of the land of Zodia. These REXPaint is Cool
Latest posts REXPaint is Cool Crystal Realm Core Loop Ten Artifacts from the Crystal Realm Notes on Fiends Four Classes for The Vanilla Game Barbarian Prince Rulings Inverting Morale Rangers Upon the Coast - Session 15 State Management Rangers Upon the Coast - Session 14 The One Ring - Year 2967 The One Ring - Year 2966 The One Ring - Year 2965 Planning Skill Endeavors Nine Anomalous Potions Skeleton Pirates Crystal Realm Procedural Generation Rangers Upon the Coast - Session 13 Rangers Upon the Coast - Session 12 Rangers Upon the Coast - Session 11 Rangers Upon the Coast - Session 10 Rangers Upon the Coast - Session 9 Rangers Upon the Coast - Session 8 Food and Pillage Rangers Upon the Coast - Session 7 Rangers Upon the Coast - Session 6 Rangers Upon the Coast - Session 5 Rangers Upon the Coast - Session 4 Rangers Upon the Coast - Session 3 Rangers Upon the Coast - Session 2