Guarantee a flat landing site for the colony rocket #163

Open
opened 2026-10-11 20:23:48 +01:00 by liamjd · 0 comments
Owner

Milestone 2, item 2 ("we must ensure that there are flat 3x3 spaces for the rocket at the very least, on all maps").

Problem

The colony rocket is a 3×3 footprint, and placement accepts no level spread (placement_controller.max_level_spread = 0). Today a seed can produce a map with nowhere to land: 9 of 10 islands at 32, 3 of 10 craters at 16, 1 of 10 plains at 16. With the rocket meant to be the first thing placed (#90), that is an unplayable run.

#159, #160 and #161 make flat land common. This ticket makes it guaranteed.

Proposal

A post-generation pass, after #162's ramps and before painting:

  1. Search the main region for a flat 3×3 site. Prefer one near the map centre, so the colony starts somewhere the camera already looks.
  2. If there is none, choose the 3×3 on the main region with the smallest level spread nearest the centre, and flatten it to its median level.
  3. Flattening can create a cliff at its edge. Regrade the ring of tiles around it so every step out of the pad is at most max_step_levels, and the pad stays connected to the main region.
  4. Expose the result as TerrainGrid.landing_site() -> Vector2i, the pad's centre cell. That gives the future rocket-first flow (#90) and the camera something to target.

Make the pad size a parameter (landing_footprint, default 3×3) rather than a literal 3. Bigger first buildings are already on the cards; the milestone mentions "some building sizes and shapes".

Use the same flatness test PlacementRules.evaluate() applies (in bounds, walkable, spread ≤ max_level_spread), ideally by calling it rather than copying it. That way, when the rule changes, the guarantee still means "the rocket can actually be placed here".

Acceptance criteria

  • For every preset × every #158 size × 50 seeds, PlacementRules.evaluate() returns VALID for the colony rocket's footprint at landing_site(). This should be a unit test: it is the milestone's headline guarantee.
  • The landing site is in the main region and reachable from every pawn spawn.
  • On a seed that already has a flat site, the map is unchanged. Pin it with a fixed-seed test, so the pass does not quietly flatten every map.
  • The flattened pad does not leave a cliff around it, so all of its edge steps are traversable.
  • Headed screenshot of a seed where the pad was stamped, to check it does not look like a stamp.

Depends on

#162. The pad must sit in the main region, and the ramp pass changes which region that is. #159, #160 and #161 are not hard dependencies, but without them this pass does all the work, and the result looks like it.

Milestone 2, item 2 ("we must ensure that there are flat 3x3 spaces for the rocket at the very least, on all maps"). ## Problem The colony rocket is a 3×3 footprint, and placement accepts **no** level spread (`placement_controller.max_level_spread = 0`). Today a seed can produce a map with nowhere to land: 9 of 10 islands at 32, 3 of 10 craters at 16, 1 of 10 plains at 16. With the rocket meant to be the first thing placed (#90), that is an unplayable run. #159, #160 and #161 make flat land common. This ticket makes it **guaranteed**. ## Proposal A post-generation pass, after #162's ramps and before painting: 1. Search the main region for a flat 3×3 site. Prefer one near the map centre, so the colony starts somewhere the camera already looks. 2. If there is none, choose the 3×3 on the main region with the smallest level spread nearest the centre, and **flatten** it to its median level. 3. Flattening can create a cliff at its edge. Regrade the ring of tiles around it so every step out of the pad is at most `max_step_levels`, and the pad stays connected to the main region. 4. Expose the result as `TerrainGrid.landing_site() -> Vector2i`, the pad's centre cell. That gives the future rocket-first flow (#90) and the camera something to target. Make the pad size a parameter (`landing_footprint`, default 3×3) rather than a literal 3. Bigger first buildings are already on the cards; the milestone mentions "some building sizes and shapes". Use the same flatness test `PlacementRules.evaluate()` applies (in bounds, walkable, spread ≤ `max_level_spread`), ideally by calling it rather than copying it. That way, when the rule changes, the guarantee still means "the rocket can actually be placed here". ## Acceptance criteria - [ ] For every preset × every #158 size × 50 seeds, `PlacementRules.evaluate()` returns VALID for the colony rocket's footprint at `landing_site()`. This should be a unit test: it is the milestone's headline guarantee. - [ ] The landing site is in the main region and reachable from every pawn spawn. - [ ] On a seed that already has a flat site, the map is unchanged. Pin it with a fixed-seed test, so the pass does not quietly flatten every map. - [ ] The flattened pad does not leave a cliff around it, so all of its edge steps are traversable. - [ ] Headed screenshot of a seed where the pad was stamped, to check it does not look like a stamp. ## Depends on #162. The pad must sit in the main region, and the ramp pass changes which region that is. #159, #160 and #161 are not hard dependencies, but without them this pass does all the work, and the result looks like it.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
liamjd/UntitledColonyBuilder#163
No description provided.