VR Micro

Version 0.3, 2021-04-15
by Mark Damon Hughes

Introduction

A shared infosystem based on spatial reasoning, a world of many interconnected maps, with documents and services physically represented as objects. Users have avatars and can see and interact with each other.

Inspiration

Overview

Tech Stack


Model


Map files

Demo Map

NAME Demo Micro World

INTRO
Hello, micro world!
ENDINTRO

# N E S W
SPAWN 128 127
SPAWN 127 128
SPAWN 129 128
SPAWN 128 129

TER . grass
    SPR 1 /vrmi/img/grass-32.png 0 0 32 32
ENDTER
TER _ floor
    SPR 1 /vrmi/img/floor-32.png 0 0 32 32
ENDTER
TER % wall
    BLOCKING
    OPAQUE
    SPR 1 /vrmi/img/wall-32.png 0 0 32 32
ENDTER

FILL . 0 0 256 256
BOX % 0 0 256 256

TILES 120 120 16 16
    _._._._%%%_._._.
    ._._._.%_%._._._
    _._._._._._._._.
    ._._._._._._._._
    _._._._._._._._.
    ._._._._._._._._
    _._._._._._._._.
    ._._._._._._._._
    _._._._._._._._.
    ._._._._._._._._
    _._._._._._._._.
    ._._._._._._._._
    _._._._._._._._.
    ._._._._._._._._
    _._._._._._._._.
    ._._._._._._._._
ENDTILES

SIGN N 128 124 This way to the egress!

# Useless portal, takes you back to this map
OBJ portal
    AT 128 121 1 1
    TITLE Round Trip
    SPR 1 /vrmi/img/portal-32.png 0 0 32 32
    ACTION MAP /vrmi/map/demo.map
ENDOBJ

FILL _ 112 136 32 32

# Display help library below path area
INDEX /vrmi/help
    AT 112 136 32 32
    DIR 0 1
    ROW 2 0
ENDINDEX

Map File Format

# User-readable description, all text on line is presented as-is
# once only
NAME maptext

# Auth required to enter, default GUEST
# once only
AUTH authlevel

# All lines to ENDINTRO are displayed in output area on map load
# once only
INTRO
...
ENDINTRO

# Add x,y coords where visitors may spawn (chosen randomly).
# If none are given, center 128,128 is used.
SPAWN x y

# Define terrain type for this map
# c: ASCII char c (33-126)
# name: symbolic name
# blocking: BLOCKING, if you cannot move through
# opaque: OPAQUE, if you cannot see through
# sprtype: Animation or layout count, 1 if static, 2 if animated. Default is 1.
# Write one SPR for each count:
# sprn sprfile sx sy sw sh: Sprite index (1+), sheet filename, & image coords (sw, sh must be 8-256).
TER c name
    blocking
    opaque
    SPRITE sprtype
    SPR sprn sprfile sx sy sw sh
ENDTER

# Fill a region of tiles from x,y w*h, for setting base tiles for a map.
# Note w*h includes the starting tile.
FILL c x y w h

# Draw a box of tiles from x,y w*h, for bordering a map.
# Note w*h includes the starting tile.
BOX c x y w h

# Draws w*h array of terrain chars defined with TER, starting at x,y
# leading/trailing space is ignored.
# Note that if you have a TER with char #, it cannot be the first in a line.
TILES x y w h
...
ENDTILES

# Displays a sign sprite, and text when you move into it
# signtype: BLANK INFO WARNING ERROR N E S W
SIGN signtype x y text

# Creates an object
# name: symbolic name
# x y w h: coords & size, must not collide with another object
# titletext: All text on line is shown above object
# sprite as terrain
OBJ name
    AT x y w h
    TITLE titletext
    SPRITE sprtype
    SPR sprn sprfile sx sy sw sh
    ACTION event
    # event: command to execute when moved into:
    # MAP mapurl
    #   Load map at `mapurl`
    # TEXT text
    #   Display `text`
    # SHOW url
    #   Display `url` in document viewer
    # OPEN url
    #   Open `url` in a new browser tab
    # TELEPORT x y f
    #   f: facing, one of N E S W
    #   Move to location on same map
ENDOBJ

# Creates generic objects for an index, when the map is loaded.
# Reads url, and all `<a href="url">titletext</a>`
# become objects, starting AT x,y, not exceeding bounds w,h
# incrementing by DIR dx,dy
# If it reaches the bounds, increments starting point by ROW dx,dy
# row should be at least 2 spaces, so users can move beween rows.
# Default is DIR 0 2, ROW 2 0
# Gives up if the row moves off the map, so
# AT 96 136 32 32
# DIR 0 1
# ROW 2 0
# would display 16 rows, 32 objects high.
# Object sprites & actions depend on file extension.
INDEX url
    AT x y w h
    DIR dx dy
    ROW dx dy
ENDINDEX

Client-Server Interaction

 

EOF