Skip to content

Instantly share code, notes, and snippets.

@lifning
Created June 9, 2012 03:37
Show Gist options
  • Save lifning/2899289 to your computer and use it in GitHub Desktop.
Save lifning/2899289 to your computer and use it in GitHub Desktop.
some ideas for data format and so on.
(define (domain n64-zelda-majora)
(:requirements :typing :fluents :durative-actions)
(:types
item cycevt location object
)
(:constants
bow ocarina powder-keg goron-mask eponas-song song-of-time - item
clock-town-south milk-road romani-ranch termina-field - location
milk-road-unblocked recruited-by-romani saved-the-ranch - cycevt
)
(:functions
(ammo-amount ?item - item)
(cycle-event ?evt - cycevt)
(game-clock)
)
(:predicates
(at ?obj - object ?loc - location)
(have-item ?item - item)
)
(:durative-action play-song-of-time
:parameters
(?player)
:duration
(= ?duration 30)
:condition
(at start (and (have-item ocarina) (have-item song-of-time)))
:effect
(at end (and
(= (game-clock) (* 6 60))
(at ?player clock-town-south)
(forall (?i - item) (= (ammo-amount ?i) 0))
(forall (?e - cycevt) (not (cycle-event ?e)))
))
)
(:durative-action open-milk-road
:parameters
(?player)
:duration
(= ?duration 5)
:condition
(at start (and
(at ?player milk-road)
(have-item powder-keg)
(have-item goron-mask)
(> (ammo-amount powder-keg) 0)
(< (game-clock) (* 54 60))
))
:effect
(and
(at start (decrease (ammo-amount powder-keg) 1))
(at end (cycle-event milk-road-unblocked))
)
)
(:durative-action befriend-romani
:parameters
(?player)
:duration
(= ?duration 60)
:condition
(at start (and
(at ?player romani-ranch)
(have-item bow)
(have-item ocarina)
(> (game-clock) (* 6 60))
(< (game-clock) (* 18 60))
))
:effect
(at end (and
(have-item eponas-song)
(cycle-event recruited-by-romani)
))
)
(:durative-action defend-ranch-from-aliens
:parameters
(?player)
:duration
(= ?duration (* 3 60))
:condition
(and
(at start (cycle-event recruited-by-romani))
(at start (at ?player romani-ranch))
(at start (= (game-clock) (* 26 60)))
(over all (at ?player romani-ranch))
)
:effect
(at end (and
(= (game-clock) (* 29.5 60))
(cycle-event saved-the-ranch)
))
)
(:durative-action defend-milk-from-gormans
:parameters
(?player)
:duration
(= ?duration (* 3 60))
:condition
(at start (and
(cycle-event saved-the-ranch)
(= (game-clock) (* 42 60))
(at ?player romani-ranch)
))
:effect
(at end (and
(have-item romanis-mask)
(= (game-clock) (* 45 60))
(at ?player termina-field)
))
)
)
<!DOCTYPE SPOON>
<!--speedrun planning/optimizing object notation-->
<game>
<info>
<title>Legend of Zelda, The: Majora's Mask</title>
<console>Nintendo 64</console>
</info>
<map>
<!--
todo...
notes:
- for majora's mask, have a base graph without any extra paths opened
- edges can be added by events (like blowing up the ranch boulder)
- edges can be removed by events (like playing song of time)
- have some sort of <edge type="glitch">
-->
</map>
<!-- loc time inv temp clear -->
<event>
<name>Play the Song of Time</name>
<req type="inv">Ocarina</req>
<outcome type="time">6</outcome>
<outcome type="loc">South Clock Town</outcome>
<outcome type="inv" value="0"><!--all items--></outcome>
<outcome type="clear">temp</outcome>
</event>
<event>
<name>Open Milk Road</name>
<req type="loc">Milk Road</req>
<req type="inv">Goron Mask</req>
<req type="inv" value="1">Powder Keg</req>
<outcome type="path"><from>Milk Road</from><to>Romani Ranch</to></outcome>
</event>
<event>
<name>Befriend Romani</name>
<req type="loc">Romani Ranch</req>
<req type="time">(6,18)</req>
<req type="inv">Bow</req>
<req type="inv">Ocarina</req>
<outcome type="inv">Epona's Song</outcome>
<outcome type="temp">can-save-ranch</outcome>
</event>
<event>
<name>Save the ranch</name>
<req type="temp">can-save-ranch</req>
<req type="loc">Romani Ranch</req>
<req type="time">26</req>
<req type="inv">Epona's Song</req>
<req type="inv">Bow</req>
<outcome type="inv" value="milk">Bottle3</outcome>
<outcome type="time">29.5</outcome>
<outcome type="temp">saved-the-ranch</outcome>
</event>
<event>
<name>Cremia's milk delivery</name>
<req type="temp">saved-the-ranch</req>
<req type="loc">Romani Ranch</req>
<req type="time">42</req>
<req type="inv">Bow</req>
<outcome type="inv">Romani's Mask</outcome>
<outcome type="time">45</outcome>
</event>
</game>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment