Idraluna Archives

The Great Antarctic Hexcrawl pt. 6b - Hexfill Addendum

This is my own version of lore24, an admittedly over-ambitious attempt to procedurally generate a 43,000-hex crawl for my homebrewed far-future Antarctica, Antibor. Part 1, Part 2, Part 3, Part 4 and 4b, Part 5, Part 6.


In the previous installment, I described a basic hexfill procedure inspired by the one Luke Gearing used for Wolves Upon The Coast & applied it to all 43,000 hexes in Antibor. The procedure assigned four categories: 'Lair', 'Settlement', 'Weird', and 'Flavor'. I also wrote a bit about stylistic inspirations & how I was planning to use my nested random generator script to generate multiple hexes per prompt.

While compiling a list of prompts, however, I ran into some issues:

Hexfill Redux

Thus, I decided to move from a single big list of prompts to a table where I could store 'metadata' for each prompt. Here are the 'knobs' I want to be able to control for each hexfill:

I chose to omit treasure and NPCs -- I'd prefer to just bake treasure into hex key description prompts, and tracking NPCs separately (so far) introduces a level of complication I want to avoid. (Though I may reverse this decision in a future outpouring of manic ambition, tbd).

This solves a few problems:

The hexfilling algorithm I have in mind works like this:

  1. Pre-process the list hexfill entries by normalizing all biome weights so that sum = 1
  2. Pick a random hex with a hexfill category assigned
    1. Filter the table of hexes to only include eligible hexes
      1. Weight in hex's biome > 0
      2. Category = hex's category
      3. Region in region restrictions, otherwise ignore
      4. Current number placed < max allowed
      5. If any entries have current_assigned < min required, filter to only those entries, otherwise move on
    2. Calculate a weight for each entry based on its overall weight score and weight for the given biome
    3. Do a weighted sample to pick an entry for the hex, assign the entry ID value to the hex.

Placing Dungeons

I wrote a quick script to randomly plunk down 333 dungeons into open landmark or hidden hexfill slots:

### Place Dungeons

hexes <- vect(file.path(mapdir, 'Full_hexes.gpkg'))

avail_landmark <- as.data.frame(hexes) %>%
  filter(!Biome_majority%in%c(0, 14, 15)) %>%
  filter(is.na(Hexfill)) %>% select(id) %>% mutate(type='Hexfill')

avail_hidden <- as.data.frame(hexes) %>%
  filter(!Biome_majority%in%c(0, 14, 15)) %>%
  filter(is.na(Hexfill_hidden)) %>% select(id) %>% mutate(type='Hexfill_hidden')

dungeon_hexes <- bind_rows(avail_landmark, avail_hidden) %>%
  slice_sample(n=256)

for(hex in dungeon_hexes$id){
  print(hex)
  type = dungeon_hexes[dungeon_hexes$id==hex, 'type']
  hexes[hexes$id==hex, type] <- '[Dungeon]'
}

nrow(hexes[hexes$Hexfill == '[Dungeon]'])
nrow(hexes[hexes$Hexfill_hidden == '[Dungeon]'])

writeVector(hexes, file.path(mapdir, 'Full_hexes.gpkg'), overwrite=T)

I wound up placing 80 non-'hidden' dungeons and 176 'hidden' dungeons, which seems appropriate.

I think the plan is going to be to gradually assign 'handmade' dungeons (by me or others) to these hexes and then to use the dungeon generator to fill in the rest, ideally replacing the pointcrawl maps with hand-drawn maps if/when I get to run them.

#DIY #antibor #lore24