Engines Aether Legend of the Lunar Priest NIFE Roadmap
Shatterloop Game Projects Deprecated Starwright
Saepes Mundi Other Projects Blog  

Game Projects

Gigalopolis Generation

Posted March 25, 2026 by Xhin



There are 7 Replies


Layer 1: Cities

The great city of Gigalopolis is composed of many smaller cities arranged around a major waterway and its surrounding areas:

  • Seastead cities that float on the waves. A mixed bag of undersea drilling, fishing and financial havens.

  • Islands, which serve as major ports/transport hubs (to other gigalopoles not in the game) as well as military locations. A fair amount of fishing as well.

  • Bay City -- a central point that connects the waterway to the sea, so it serves as an administrative hub and an import/export shipping hubs. There is exactly one of these per seed and it serves as a choke point between the two divisions of gigalopolis. There are other transport networks, however they aren't nearly as labyrinthine as everything coming out of here.

  • Waterway ports -- cities from here branch out in a mazelike way following river splits. Minor shipping hubs to things in their area, and industry-heavy because of all their local imports.

  • Coastal cities -- These are linear from either side of the bay city and serve as train terminuses, so their function is a hybrid of waterway ports and the bay city, but smaller in scope with both. Industry-heavy *and* administration-heavy, but smaller than either city type.

  • Materials cities -- these are paired to one of the waterway ports and are focused on mining, logging, and other base materials extraction. Some industry but usually it's an early process with the heavier industry happening at the port city.

    Layer 1 Primary Transport

  • There's a major shipping lane that connects together the hub seastead, the hub island, the Bay City and each waterway port. Pricy but the most efficient route.

  • Smaller "official" shipping lanes connect together the hub seastead with other ones, same deal with islands and ports to deeper materials cities. Same deal with the bay City to coastal cities (but this is linear in both directions). Same issues as the above.

    Layer 1 secondary transport

  • Several overland train network connects together disparate materials cities. This is completely random and totally non-euclidean, but it serves as a cheaper alternative to waterway-->land routes. Transport networks here connect to one another at certain node cities, so you can hop off and find a better route if you know the layouts of these.

  • These also all terminate at one end on coastal port cities, with each one being represented by a train network, so they're deliberately paired.

  • Minor shipping lanes connect coastal port cities to random islands and seasteads. These networks work similar -- paired to a coastal port city and connect at various nodes.

  • Undersea tunnels connect the bay city to 2 waterway ports, 2 materials cities, 2 islands and 2 seasteads (as well as connecting each group with one another -- an island would connect to the other island and each seastead for example). These 8 locations are those not accounted for with other transport networks.

    Layer 1 Names and Counts

  • There are 105 total initial cities per seed (waterway ports complicate this a bit) They're each assigned a consonant+vowel combo (Y counts as a consonant).

  • Normal names start with that pairing and then are otherwise generated by lang{} beginning with a consonant (since the prefix ends in a vowel).

  • The bay city is "X Bay". There's obviously only one of these. It begins with Aa and then consonants off from there. So Aadini Bay, Aakriblon Bay, etc.

  • Insea areas are 1/3 while inland areas are 2/3. So insea areas get assigned 34 locations, while inland instead gets assigned 71.

  • Insea locations are an even split between islands and seasteads -- 17 to each.

  • The other 71 are promised in groups of 3 to 5 to unnamed waterway cities. So you end up with 15-24 waterway cities in groups of 3-5.

  • These 15-24 exist in a mazelike format -- the bay city connects to two, then each of those connects to 1-3 recursively in each layer until all slots are filled. The names chosen here begin with a vowel+consonant combo -- there's always more of these available than the engine needs so it accommodates interesting generation. The top layer then gets reshuffled on a second pass so you don't just end up with deeper waterways only on the left.

  • 8 coastal cities follow the same vowel+consonant schema, distinct from all of the above ones, so the names are generated simultaneously.

  • Train networks use the coastal city name in the format "X Line". The generation here is complex and I'll get to it in a bit (along with minor shipping lanes and undersea tunnels which ties into it).

  • March 25, 2026
    Xhin
    Sky's the limit

    Layer 1 Train Network mechanics

  • 1. Two shuffled lists of the eight train networks are created.

  • 2. These give each network 2 to 4 links to other train networks depending on what's before and after it in the list. If they get the same link then it'll end up being 3 or rarely 2.

  • 3. A grand list of waterways and resource cities are created, with two of each pulled out of the list.

  • 4. Each train network pulls 6-10 random waterways or resource cities. These can match with other train networks, no big deal.

  • 5. Each link that's created in step #2 above is also assigned a city from that list, provided it hasn't already been sourced by the train line.

  • 6. Links then replace something random in the train line. Step #5 already filtered duplicates.

  • 7. Each city in question has a separate station for each line operating within it, where it'll go to the 2-4 jumps within the line.

    Layer 1 Minor waterways

    This process is identical, except:

  • 3. The Grand list is waterways and seasteads, with two of each pulled out of the list.

  • 4. 3-5 nodes are pulled instead of 6-10.

    Layer 1 Undersea tunnels

    These just use the 2 that are pulled out of each list above. Each terrain type has its own links as well, but unlike with train networks there's a central station for all undersea passageways.

  • March 25, 2026
    Xhin
    Sky's the limit

    Layer 2: Districts

    Each city has mostly-specialized administrative divisions known as Districts.

    Before anything is calculated here, each city is given an "economic score" depending on how many transportation links go through it.

    Economic scores are then grouped into three "city sizes" between the lowest and highest score: Small, Medium and Large. This affects a lot of stuff further down, but a couple things here as well. The Bay City always counts as Large, and has a few extra rules of its own.

    Layer 2 Universal districts

  • Large and medium cities have administrative districts. So do coastal cities regardless of size.

  • Market districts

  • Large cities have Transportation districts that cluster all the transportation nodes -- otherwise they're spread out over other districts.

  • Residential districts

  • Medium and large cities have elite market/residential cities

  • Everything that isn't a materials city has a port district

    Layer 2 City type specific districts

  • Seasteads -- Drilling, Heavy Fishing, Financial

  • Islands -- Military, Fishing

  • Bay City -- Heavy Administrative

  • Waterway ports -- Heavy Industrial

  • Coastal city -- Terminus, Industrial

  • Materials City -- Heavy Extraction

    Layer 2 District Expansion

    Small cities have the exact amount of districts that they're assigned. Medium allows for 0-1 duplicates of half the amount of types and large has 1-2 duplicates of each type. "Heavy" automatically appends +2 to the count of that type, so a small materials city would have 3 extraction districts (1 base and 2 dupes), while medium might instead be 3-4.

    The smallest city type seems to be a materials city with 5 districts, with the largest being a large seastead with 12-36.

    Layer 2 District Connections

  • Districts are arranged in a ceil(sqrt(D amt)) x itself box. Both districts and blank nodes are assigned in a magicsel way from a center point (I guess the NW one if it's even) and within the bounds of the box.

  • If there's 7 or more districts there's also a subway system that connects every district in a randomized list way.

  • Medium cities have a second subway system if they're 7+

  • Large cities have a tertiary system if they're 7+

    Layer 2 Promises

  • Obviously if there's a Transport district, all forms of transport go there.

  • Otherwise each transport type is promised to one of the districts, but it can't be residential, elite residential, or elite market. Multiple transport networks operating out of the same district are perfectly fine.

  • Each district is promised 60-90% of its type in question, with the rest split randomly between market, residential, 1-3 other types (depending on city size) (subsplit randomly) and administrative. Market has a 25% chance of appearing at all in a small city, 50 for medium and 75 for large. Residential is 50/75/100. Administrative always appears. Extra types is 50/75/100.

  • March 26, 2026
    Xhin
    Sky's the limit

    Layer 3: Major Roads

    This is where things start to get complex.

    Major roads are literally drawn onto a grid with some fairly arcane rules that change from district to district and some influence from higher layers. This is converted to raw data which then informs side streets (the next layer) and buildings past that point, with promises waiting to be delegated until Layer 4.

  • Box proportions -- the ratio of width to length. As low as 3:1 and as high as 1:3. Layer 1 creates a range of 1.5 in 0.5 increments, so maybe 2.5:1 to 1:1 or 1:1.5 to 1:3. The district itself pulls a random value from that range.

  • High end amount of roads (if width is more this would be horizontal) -- 8-16 chosen completely at random.

  • Low end amount of roads -- based on the ratio chosen above and rounded up. The absolute minimum is 4, with the maximum being 16.

  • Left inclination max -- 0-35

  • Right inclination max -- 0-35

  • Left inclination chance -- 20-80

  • Wobble points -- 3-6

  • Max left wobble -- 20-90

  • Max right wobble -- 20-90

  • Horizontal choke points perc -- 20-60

  • Vertical choke points perc -- 20-60

    Layer 3 Road Generation

    Points are chosen along a line of the opposite type and some sane, possibly randomized distance (I'll have to play around with it). They then pick a polar direction from their preferred direction (vertical goes down for example) based on 0 to the left/right inclination max with the chance determining which one it is. Inclination here is the angle offset from the preferred angle.

    Wobble points are assigned randomly in their amount of steps (which is also some sane value) and the angle will change accordingly until the next wobble point, which alters the base value rather than the current inclination. It also switches back and forth between left and right with the initial one chosen at random.

    Then the other set of streets are drawn.

    Intersection points are "blocks", which is the only data that's actually stored in this layer -- which roads cross and which road connects them to the next block. Coordinates are also stored for the next step.Vertical is obviously going to cross with horizontal but it might also cross with another vertical if the inclination/wobble lines up just right. It's also possible to have more than two roads meeting at the same coordinate, though rare.

    Vertical roads are simply numbered, while horizontal roads pick genesis-worthy names from a large variety of targets. Picked sequences though, obviously, so there aren't duplicates.

    Choke points grab that percentage of that type of road and kill one block along them at random that isn't at the start or end. Then either side of it will become split with a N/S tag for a vertical road and an E/W tag for a horizontal road. The city dictates whether this is ultimately a suffix or a prefix. Killed blocks that have already been killed are just ignored -- easier I think.

  • March 26, 2026
    Xhin
    Sky's the limit

    Layer 4: Streets

    Block coordinates are indexed somehow in this or the previous stage.

    Some percentage of all blocks is chosen -- I'm thinking 30-70 based on the district. Within some D, a candidate block is chosen if one exists. If it picks a block that there's already a street to, the street will get upgraded to a boulevard.

    Based on the angle between their coordinates it'll either be a street (E/W) or avenue (N/S). Unless it's a boulevard of course.

    This might end up being non-euclidean and that's okay -- it's not like there's a map anyhow.

    Once all of this is done, the data will change again to blocks and their exits to other blocks and the size of that particular road or street (based on the polar D). Coordinates are also still stored apparently since they're needed later.

    The absolute minimum D is also stored for use in layer 5.

    Blocks are also indexed by how many connection points they have.

    Layer 4 Promises

  • A random block and random promised subdistrict type is chosen.

  • There's then a magicsel out from streets of that block until either the percentage (rounded down) is fulfilled or there's no more room.

  • In that latter case, a new subdistrict is created and appended to the list with the remaining percentage.

  • A new subdistrict is chosen from one of these edge points and the cycle begins anew. Roads/streets can't be re-subdistricted. Also the last type (whatever it is) operates until every single block/street has been subdistricted.

    This process changes the data so each block and road/street is assigned a subdistrict type.

  • Transport promises are assigned to whichever blocks have the most connections ranked downwards (and I guess chosen at random within each ranking). These are indexed separately.

    Layer 4 alternate transport

    Each district has its own 3-6 subway systems (based on the district) that work similar to trains, picking blocks at random and finding convenient connection nodes. The difference here is that they go in a loop. The D of each route is indexed as well, and coordinates can finally be dropped from the dataset.

  • March 26, 2026
    Xhin
    Sky's the limit

    Layer 5: Building Assignment

    Whatever the minimum D in layer 4 is is assigned 1 Standard Building (SB). All others are represented as their multiple of that D in SB (rounded up).

    Residential and Market buildings come 2 for each SB, while all other types use 1 SB.

    Roadways have buildings on each side, numbered E-->W or N-->S based on the road in question. Split streets either use separate numbering or the same depending on which is easier. Odds and then evens for E-->W vertical streets and odds and then evens for N-->S horizontal streets. SB is irrelevant here, so 3 might actually be west of 2. Or whatever is easiest to do.

    Blocks have 1SB at each corner without exception, assigned to streets in a swastika pattern. This is probably going to fuck with the numbering scheme, so just do whatever is easiest (maybe a letter attached to the last number?). A bit difficult if a block has more than four inlets but I'm sure I'll find some solution.

    A block with transport nodes has a single building assigned to it, which connects all the various transport networks within (and presumably underground). I'll get to that in a bit -- 3D verticality seems like it would be important.

    Otherwise buildings are assigned the appropriate subdistrict type and presumably are generated from there, possibly on the fly as the player encounters them or scans rather than generating them in this layer.

    March 26, 2026
    Xhin
    Sky's the limit

    Layer 6: Building generation

    From this point it just generates the POI in question. They're all a bit different and I'll probably have a separate thread for it. But at least the navigation hell aspect of the game is now planned out.

    Transport hubs work a bit differently -- they're vertically stacked by most local to least local, in the following order:

  • Loop subway

  • District connections / inter-district subways

  • Train / minor waterways

  • Primary transport

  • Undersea tunnels (it only makes sense that this would be the absolute bottom layer).

  • March 26, 2026
    Xhin
    Sky's the limit

    Reply to: Gigalopolis Generation

    Username
    Password