Skip to content

Commit

Permalink
fix placement offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed Sep 19, 2024
1 parent 99ab1ce commit f6178ba
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
nonoverlapping-structure-merge.yaml
root-map-expansion.yaml
structure-composition.yaml
sequential-placement.yaml
sequential-placement.yaml
coordinate-offset-propagation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
version: 1
name: Structure coordinate offset propagation
author: Karl Ostmo
description: |
If a structure incorporates subplacements
entailing negative offsets, its coordinate origin must be shifted.
The updated coordinate origin should be propagated to parent structures
and utilized to offset placement.
robots:
- name: base
dir: north
creative: true
objectives:
- goal:
- Must have 3 of each color visible
condition: |
return false
solution: |
noop
known: [boulder, log, pixel (R), pixel (G), pixel (B), gold]
world:
structures:
- name: micro
structure:
mask: '.'
palette:
'x': [stone, gold]
map: |
xxx
x.x
xxx
- name: block
structure:
mask: '.'
palette:
'x': [stone, pixel (R)]
map: |
xxxx
x..x
x..x
xxxx
- name: master
structure:
mask: '.'
placements:
- src: block
- src: micro
offset: [-3, 1]
map: ""
dsl: |
overlay
[ {grass}
, mask (y > -4 && y < 4 || x > -4 && x < 4) {stone}
, mask (y > -2 && y < 2 || x > -2 && x < 2) {ice}
, mask (y > -1 && y < 1 || x > -1 && x < 1) {dirt}
]
palette:
'Ω': [grass, erase, base]
mask: '.'
placements:
- src: master
offset: [0, 0]
upperleft: [0, 0]
map: |
Ω
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
version: 1
name: Structure coordinate offsets
author: Karl Ostmo
description: |
Avoid garbled structure
robots:
- name: base
dir: north
creative: true
objectives:
- goal:
- Must have 3 of each color visible
condition: |
return false
solution: |
noop
known: [boulder, log, pixel (R), pixel (G), pixel (B), gold]
world:
structures:
- name: micro
structure:
mask: '.'
palette:
'x': [stone, gold]
map: |
xxx
x.x
xxx
- name: block
structure:
mask: '.'
palette:
'x': [stone, pixel (R)]
map: |
xxxx
x..x
x..x
xxxx
- name: master
structure:
mask: '.'
placements:
- src: micro
offset: [-3, 1]
- src: block
map: ""
dsl: |
overlay
[ {grass}
, mask (y > -4 && y < 4 || x > -4 && x < 4) {stone}
, mask (y > -2 && y < 2 || x > -2 && x < 2) {ice}
, mask (y > -1 && y < 1 || x > -1 && x < 1) {dirt}
]
palette:
'Ω': [grass, erase, base]
mask: '.'
placements:
- src: master
offset: [0, 0]
upperleft: [0, 0]
map: |
Ω

0 comments on commit f6178ba

Please sign in to comment.