Skip to content

Locations

ManApart edited this page Feb 12, 2023 · 4 revisions

Locations

Networks

A network is an isolated collection of locations. Networks provide routes and allow you to travel from one place to another. Bodies also have a network that describes the spacial relationships of body parts.

Network names must be globally unique.

Location Nodes

Location Nodes contain the spacial relationship data for a location, as opposed to a Location that contains the contents of a location. They contain a parent network, the name of their content location, and links to other locations.

Location Node names must be unique within their parent network.

network("Kanbara Countryside") {
  locationNode("Kanbara Road") {
      connection("Northern Woods", y = 10)
  }
}

Location Connections

TODO - outdated

Location Connections describe the relationship between locations.

Connections contain at least some of the following

  • A unique name of the location it's connecting to (from the parent node it's described in
  • Optionally a position relative to the current location
  • At runtime, the attached location will get a reference back to the current location with the proper position so that they can be referenced either way
  • The attached location will not get a link back if it already has an explicit link or the link is marked as one way
  • An orirgin/destination point, for arriving/departing from a specific place
  • Restricted - locations are visible but can't be traveled to (for things like climbing trees or opening doors) -connections can be hidden, and so not show up initially

Locations

Location DSL

Locations in the dsl are more like recipes until they're "instantiated" by the location nodes. Locations describe an area and contain

  • A unique name
  • A description
  • A list of items
  • A list of activators
  • A list of creatures
  • Weather, etc

When specifying a list of targets (items, activators, creatures), you can give just their name, or their name and location within the location. This is just a string of flavor text used for the look command.


location("Apple Tree") {
    extends("Outside")
    material("Plant")
    description("The tree's leaves rustle in the wind, dusting it with the smell of apples.")
    sound(1, "the soft rustle of many leaves")
    activator("Apple Tree")
    item("Apple") {
        location("high in the branches")
        z(15)
    }
    item("Apple") {
        location("at the base of the tree")
    }
    item("Dulled Hatchet") {
        location("leaning against the tree")
    }
}

Day Night Cycle

A location can range from 0 to 10 light. Locations that are outside

Atmospheric Effects

  • Attached to location
  • Atmospheres that add tags and effects to everything in that location.
  • Shallow water, deep water, under water, have effects, based on swimming, etc. Swimming is skill based on agility
  • Atmospheric effects like fog and water, cast words can interact with them
  • Create climates for locations to extend?

Temperature

  • Range from -10 to 10 on average, though temp could exceed these extremes
  • -10 is freezing point of water
  • 10 is boiling / spontaneous combustion
  • Locations have a temperature depending on location properties + current effects, burnining fires, snowstorms etc
  • Player has own temperature rating that is the location temp + effects, equipped items, etc

Gamestate query for what weather it is?

  • Use query to make thunderstorms more likely/only happen after heavy rain

Figure out how to specify if json is replacing (default) or appending

Hard code weather effect length to same cadence as weather tick (in same place), no need to specifiy effect length in json

Weather effects Activate every 10 game ticks Have trigger conditions that dictate if they should fire Target Conditions to determine who they hit? (Ex lightning should only strike one target) Target condition: takes a list of targets and selects one or more (body part as well?) Re-use for AI

Extract location bases overrides keyword: any map can have overrides: []. Any key in the list overrides instead of appends Converter tests?

Make the light level of outside daytime default to 10?

Make wheat field description based on light level, not time of day

Heat

Heat / light effects have an ‘emit’ effect that have a distance and strength: the emit effect casts heat/light etc to things within range If a target is flamable and it takes more fire damage than it has fireDefense, it starts burning Fire emits light in a radius from itself Fire emits heat in a radius from iteself If a target is not on fire, it takes 1 fire damage for every 10 heat it has

How to handle effects that do aoe more effects? (Fire emits heat, light)

  • Specific manager?
  • Specific kind of effect that emits conditions?

Gravity

Targets in a scene can have supportParent GravityListener: Any target that doesn’t have a supportParent and has a position of Z > 0 should fall, unless it has the NoFall tag On Scope Remove, check any target that previously had that support Parent. Remove the parent and let the item fall A falling item should fall the the scene’s lower z boundary. This is 0 by default unless there is a below connection Double check that on move to a boundary changes scene - make this work for all targets When things fall to the lower boundary, the move listener should naturally move them to the scene below

Other

Query Based effects

  • Storming: if outside + random chance
  • Locations should have tags
  • Dynamic description for location based on effects

Can body parts have actual locations (tree branches with apples etc)? Those locations could have targets with bodies / this could make it recursive

  • Possibly good for towns/houses etc

  • assume no for now but once all this done maybe...

  • locations can dictate position of targets

  • interacting with objects moves you to their position

Clone this wiki locally