Skip to content

Commit

Permalink
waypoints and portals
Browse files Browse the repository at this point in the history
  • Loading branch information
kostmo committed Jul 2, 2023
1 parent 6a7063b commit 31d13c5
Show file tree
Hide file tree
Showing 19 changed files with 581 additions and 33 deletions.
106 changes: 106 additions & 0 deletions data/scenarios/Testing/144-subworlds/portals-and-waypoints.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
version: 1
name: Waypoints for nested structures
description: |
Demonstrate behavior of waypoints across structure overlays
entities:
- name: telepad entrance
display:
attr: gold
char: "o"
description:
- Portal entrance or exit
properties: [known]
- name: telepad exit
display:
attr: blue
char: "o"
description:
- Portal entrance or exit
properties: [known]
robots:
- name: base
loc: [0, 4]
dir: [1, 0]
known: [tree, flower, sand, bit (0), bit (1)]
world:
upperleft: [-4, 7]
default: [blank]
palette:
'.': [grass]
'*': [stone, flower]
'P': [grass, telepad entrance]
'p': [grass, telepad exit]
'': [stone, upper left corner]
'': [stone, upper right corner]
'': [stone, lower left corner]
'': [stone, lower right corner]
'': [stone, horizontal wall]
'': [stone, vertical wall]
structures:
- name: bitpair
structure:
palette:
'p': [stone, telepad exit]
'1': [stone, bit (1)]
map: |
1
p
waypoints:
- name: bitpair_bottom
loc: [0, -1]
- name: minibox
structure:
palette:
'.': [stone]
's': [stone, sand]
'P': [stone, telepad entrance]
placements:
- src: bitpair
offset: [1, 0]
waypoints:
- name: minibox_corner
loc: [0, 0]
map: |
P.s
s.s
- name: bigbox
structure:
palette:
'.': [stone]
'T': [stone, tree]
'w':
cell: [dirt, telepad entrance]
waypoint: bigbox_middle
map: |
TTTTTT
T.TwT.
.T.T.T
TTTTTT
placements:
- src: bigbox
offset: [1, -1]
- src: bigbox
offset: [7, -5]
- src: minibox
offset: [1, -7]
waypoints:
- name: meadow
loc: [12, -1]
portals:
- entrance: bigbox_middle
exitInfo:
exit: bitpair_bottom
- entrance: minibox_corner
exitInfo:
exit: meadow
map: |
┌────────────┐
│*..*..*..*.p│
│.*..*..*..*.│
│..*..*..*..*│
│*..*..*..*..│
│.*..*..*..*.│
│..*..*..*..*│
│*..*..*..*..│
│.*..*..*..*.│
└────────────┘
106 changes: 106 additions & 0 deletions data/scenarios/Testing/_Validation/144-ambiguous-portal-entrance.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
version: 1
name: Waypoints for nested structures
description: |
Demonstrate behavior of waypoints across structure overlays
entities:
- name: telepad entrance
display:
attr: gold
char: "o"
description:
- Portal entrance or exit
properties: [known]
- name: telepad exit
display:
attr: blue
char: "o"
description:
- Portal entrance or exit
properties: [known]
robots:
- name: base
loc: [0, 4]
dir: [1, 0]
known: [tree, flower, sand, bit (0), bit (1)]
world:
upperleft: [-4, 7]
default: [blank]
palette:
'.': [grass]
'*': [stone, flower]
'P': [grass, telepad entrance]
'p': [grass, telepad exit]
'': [stone, upper left corner]
'': [stone, upper right corner]
'': [stone, lower left corner]
'': [stone, lower right corner]
'': [stone, horizontal wall]
'': [stone, vertical wall]
structures:
- name: bitpair
structure:
palette:
'p': [stone, telepad exit]
'1': [stone, bit (1)]
map: |
1
p
waypoints:
- name: bitpair_bottom
loc: [0, -1]
- name: minibox
structure:
palette:
'.': [stone]
's': [stone, sand]
'P': [stone, telepad entrance]
placements:
- src: bitpair
offset: [1, 0]
waypoints:
- name: minibox_corner
loc: [0, 0]
map: |
P.s
s.s
- name: bigbox
structure:
palette:
'.': [stone]
'T': [stone, tree]
'w':
cell: [dirt, telepad entrance]
waypoint: bigbox_middle
map: |
TTTTTT
T.TwT.
.T.T.T
TTTTTT
placements:
- src: bigbox
offset: [1, -1]
- src: bigbox
offset: [7, -5]
- src: minibox
offset: [1, -7]
waypoints:
- name: meadow
loc: [12, -1]
portals:
- entrance: bigbox_middle
exitInfo:
exit: bitpair_bottom
- entrance: minibox_corner
exitInfo:
exit: meadow
map: |
┌────────────┐
│*..*..*..*.p│
│.*..*..*..*.│
│..*..*..*..*│
│*..*..*..*..│
│.*..*..*..*.│
│..*..*..*..*│
│*..*..*..*..│
│.*..*..*..*.│
└────────────┘
106 changes: 106 additions & 0 deletions data/scenarios/Testing/_Validation/144-ambiguous-portal-exit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
version: 1
name: Waypoints for nested structures
description: |
Demonstrate behavior of waypoints across structure overlays
entities:
- name: telepad entrance
display:
attr: gold
char: "o"
description:
- Portal entrance or exit
properties: [known]
- name: telepad exit
display:
attr: blue
char: "o"
description:
- Portal entrance or exit
properties: [known]
robots:
- name: base
loc: [0, 4]
dir: [1, 0]
known: [tree, flower, sand, bit (0), bit (1)]
world:
upperleft: [-4, 7]
default: [blank]
palette:
'.': [grass]
'*': [stone, flower]
'P': [grass, telepad entrance]
'p': [grass, telepad exit]
'': [stone, upper left corner]
'': [stone, upper right corner]
'': [stone, lower left corner]
'': [stone, lower right corner]
'': [stone, horizontal wall]
'': [stone, vertical wall]
structures:
- name: bitpair
structure:
palette:
'p': [stone, telepad exit]
'1': [stone, bit (1)]
map: |
1
p
waypoints:
- name: bitpair_bottom
loc: [0, -1]
- name: minibox
structure:
palette:
'.': [stone]
's': [stone, sand]
'P': [stone, telepad entrance]
placements:
- src: bitpair
offset: [1, 0]
waypoints:
- name: minibox_corner
loc: [0, 0]
map: |
P.s
s.s
- name: bigbox
structure:
palette:
'.': [stone]
'T': [stone, tree]
'w':
cell: [dirt, telepad entrance]
waypoint: bigbox_middle
map: |
TTTTTT
T.TwT.
.T.T.T
TTTTTT
placements:
- src: bigbox
offset: [1, -1]
- src: bigbox
offset: [7, -5]
- src: minibox
offset: [1, -7]
waypoints:
- name: meadow
loc: [12, -1]
portals:
- entrance: bigbox_middle
exitInfo:
exit: bitpair_bottom
- entrance: minibox_corner
exitInfo:
exit: meadow
map: |
┌────────────┐
│*..*..*..*.p│
│.*..*..*..*.│
│..*..*..*..*│
│*..*..*..*..│
│.*..*..*..*.│
│..*..*..*..*│
│*..*..*..*..│
│.*..*..*..*.│
└────────────┘
1 change: 1 addition & 0 deletions editors/emacs/swarm-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@
"time"
"scout"
"whereami"
"waypoint"
"detect"
"resonate"
"density"
Expand Down
2 changes: 1 addition & 1 deletion editors/vscode/syntaxes/swarm.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
{
"name": "keyword.other",
"match": "\\b(?i)(self|parent|base|if|inl|inr|case|fst|snd|force|undefined|fail|not|format|chars|split|charat|tochar|key|noop|wait|selfdestruct|move|push|stride|turn|grab|harvest|place|give|equip|unequip|make|has|equipped|count|drill|use|build|salvage|reprogram|say|listen|log|view|appear|create|halt|time|scout|whereami|detect|resonate|density|sniff|chirp|watch|surveil|heading|blocked|scan|upload|ishere|isempty|meet|meetall|whoami|setname|random|run|return|try|swap|atomic|instant|installkeyhandler|teleport|as|robotnamed|robotnumbered|knows)\\b"
"match": "\\b(?i)(self|parent|base|if|inl|inr|case|fst|snd|force|undefined|fail|not|format|chars|split|charat|tochar|key|noop|wait|selfdestruct|move|push|stride|turn|grab|harvest|place|give|equip|unequip|make|has|equipped|count|drill|use|build|salvage|reprogram|say|listen|log|view|appear|create|halt|time|scout|whereami|waypoint|detect|resonate|density|sniff|chirp|watch|surveil|heading|blocked|scan|upload|ishere|isempty|meet|meetall|whoami|setname|random|run|return|try|swap|atomic|instant|installkeyhandler|teleport|as|robotnamed|robotnumbered|knows)\\b"
}
]
},
Expand Down
Loading

0 comments on commit 31d13c5

Please sign in to comment.