Skip to content

Overview of directories and files

Rocky Bevins edited this page Jul 6, 2019 · 1 revision

/server.js

Server startup, command parsing, and public file access.

/config.js

Game configuration. Port, name, etc.

/package.json

Standard npm package file to ease dependency installation (enabling 'npm install').

/src/

All game code is found in this directory.

/world.js

Initial world setup, container for connected players and areas. Helper functions for broadly grabbing game objects. Core message sending functions.

/commands.js

All in-game commands.

/character.js

World entity functions; along with character creation supplements.

/dice.js

Dice rolling utility with various helper functions; for example: getStrMod, calExp, getMods

/rooms.js

Functions related to parsing room data. Examples: getMerchants, getWaterSources, addItem.

/skills.js

Class skills

/spells.js

Class Spells. Much like skills.js -- but triggered through a command -- generally 'cast'.

/ticks.js

Game timers. Things like decay time, in-game time, respawn, random save and a generic AI 'heartbeat' via the onAlive event.

/templates/

Skeletons for various game objects. Any properties found on the template can be expected to be on the in-game object. Templates are merged into related game objects upon boot via a custom extend method.

/entity.json

The template for all game creatures, including players.

/area.json

Object template for areas.

/room.json

Object template for rooms.

/exit.json

Object template for room exits.

/item.json

Object template for game items.

/time.json

Template for the time tracking object attached to World.time.