Coder Social home page Coder Social logo

lmud's Introduction

λMUD


λMUD (pronounded "L-MUD" or "El-MUD") is a rather minimalistic MUD server, written in Erlang and LFE, making use of the excellent OTP libraries.

The aim is to have solid support for exploration, roleplaying, and in-game economies deployed on a highly fault-tolerant environment (which supports hot-code loads) where system crashes or reboots are more of an exotic curiosity than a commonplace thing.

Milestones

Background

Erlang/OTP is an excellent match for MUD development, with strong support for concurrency through light-weight processes, hot code upgrades, near- transparent mechanisms for distributed computing, etc.

This project has dual ancestry: originally based on the ErlyMUD code, it derives much of its new MUDness from TinyMUD servers like TinyMUSH, PennMUSH, etc.

Run Immediately

If you just want to check out the lmud server, you can do so with the following:

$ make docker-run

This will use the published docker image with a game-data volume.

Building & Running

  1. Download the latest:

    $ git clone https://github.com/lfex/lmud.git
  2. Change directory, compile the source, and make a release:

    $ cd lmud
    $ make

    Note that this requires having the following installed:

    • GNU make
    • Erlang
    • rebar3
  3. Start up λMUD:

    $ make start

    Additionally, you can start the MUD with the LFE REPL (useful if you're going to be developing or debugging):

    $ rebar3 lfe repl

Connecting a Client

  1. From another terminal, connect to the game:

    $ make connect

    This make target uses the rlwrap CLI tool, which provides readline support in telnet. That, in turn, allows you to use a command history like with your system shell (including such things as searching the command history with ^r).

    Once connected, you should see something like this:

    Trying 127.0.0.1...
    Connected to localhost.
    Escape character is '^]'.
    
    Welcome to:
    
                                  ....
                                .'   ,:
                              .'      \.___..
                            .'      .-'   _.'
                            '.\  \/...-''`\
                              :.'   /   \  :
                               :    () () /
                               (_ .  '--' ':
                                 / |_'-- .'
                                 \   \  .'_\
                                .|__  \/_/:
                               /          :\.
                              .' -./      .'{\|))
            __       M"""""`'"""`YM M""MMMMM""M M""""""'YMM
            \ \      M  mm.  mm.  M M  MMMMM  M M  mmmm. `M
             \ \     M  MMM  MMM  M M  MMMMM  M M  MMMMM  M
              > \    M  MMM  MMM  M M  MMMMM  M M  MMMMM  M
             / ^ \   M  MMM  MMM  M M  `MMM'  M M  MMMM' .M
            /_/ \_\  M  MMM  MMM  M Mb       dM M       .MM
                     MMMMMMMMMMMMMM MMMMMMMMMMM MMMMMMMMMMM
    
    An El-MUD Game Server, v0.7.0-dev
    
    ----------------------------------------------------------------
      If you are logging in for the first time, then at the 'Login'
      prompt, type the character name you would like to have (case
      insensitive).
    ----------------------------------------------------------------
    
    Login:
    
  2. Create a user.

  3. Have fun!

lmud's People

Contributors

oubiwann avatar jwarlander avatar

Stargazers

 avatar Liam Gray avatar M. Page-Lieberman avatar Ezequiel Birman avatar Simon El Nahas avatar leeyi avatar Charles Horn avatar  avatar Aria avatar Masanori Ogino avatar  avatar Xavier Van de Woestyne avatar Pouriya avatar Conrad Steenberg avatar Leonardo Rossi avatar =Bill.Barnhill avatar Benjamin Clos avatar Kaique Silva avatar paling avatar Malcolm Still avatar Fabio Ticconi avatar Eric Bailey avatar  avatar David.Gao avatar

Watchers

Robert Virding avatar paling avatar Kaique Silva avatar James Cloos avatar M. Page-Lieberman avatar Eric Man avatar

lmud's Issues

Improve/upgrade file-based game data

Even though we're going to be moving to a graph database, we're still going to need to do the following:

  • Export game data to files for management in git (namely github.com/lmud-games repos)
  • Work with db data in-memory

This will be v2 of the current file-based storage, and we'll need to support both (switchable via configuration). As such, this epic's integration into the code base depends upon the following:

Tasks:

Add "connected since" and "member since" to user data

Note: user data, not livings/character data.

Use the same file that stores the password. This will require a bump in the version of the file format.

Tasks:

  • Bump file format version
  • Update user state
  • Update user data model
  • Update character state
  • Update character data model
  • Update login functions to generate these
  • Add server functions to extract the data
  • Add shell commands to query these

Depends on:

Part of:

Change all references of "player" to "user"

I think I moved away from user to player at one point, but only got part-way through. The conflation between player and character is too easy; that conflation is harder between user and character.

Related:

Part of:

Set up milestones, create a current release

Tasks:

  • Create milestone 0.4.0 (add tickets)
  • Create milestone 0.5.0 (add tickets)
  • Create milestone 0.6.0 (add tickets)
  • Create a release for current state before making code changes (0.4.0)

Find a good graph library for Erlang

Goals:

  • Be able to perform basic graph theoretic operations: get neighbours, shortest path, reachability
  • Be able to generate visuals (probably only for debugging; maybe in-game? dunno ...)
  • Support file-based saves/exports
  • Support file-based loads/imports

It may be that we have to assemble from multiple bits ...

Add basic NPC support

Features:

  • NPC data
    • data modelling
    • characteristics such as friendly, tame, wild/fearful, hostile
  • Support animals
  • Support sentients (classic NPCs)
  • Support monsters
  • All animals, sentients, and monsters will use the same underlying NPC code

Migrate old file-based game-data to use the graph library

Part of:

Depends on:

Tasks:

  • #45
  • Support serialising graph data
    • now that vertex label data has id in it, all that's needed for the vertex is just the label data
    • for the edge we need "from", "to", and edge label data
    • pretty sure that's all that is needed ...
  • Support de-serialising graph data (to Erlang digraph)
  • Serialise old game data and write to new files
  • Ensure that when game loads, these new files are read

Support d20 play

Sub-epics:

  • Support d20 character generation
  • Support d20 NPCs
  • Support d20 monsters
  • Support d20 travel
  • Support d20 quests / experience
  • Support d20 combat

Quick search showed no Erlang-based d20 code out there, so this might be a case of creating another library for a d20 system in Erlang (or LFE).

Support running multiple games / worlds simultaneously

Tasks:

  • Refactor configuration for mudstore so that lookups/calls to the backend are done by-game
  • Refactor game server to spawn children dynamically, for each game the server runs
  • Support characters moving between games
  • Support "incarnating" as a different character in another game (e.g., dream state being a different character in a different game)

Develop a story and world as the default game for lmud

I'm thinking woods, forest ... but in extensive quantities. Maybe planet-covering. Backstory would be a massive set of cataclysms that wrecked the planet, and life is several million years into a reset-phase, after one or two extinction level events.

Time spans/ages:

  • 4th Age Decline: near complete ecological collapse and end of 4th age (equivalent of 2400 AD? total length of 4th age ~8,500 years)
  • 5th Age: Rapid (geologically speaking) temperature decline (after major spike, destruction by fire; lasts ~10,000 years)
  • 6th Age/Lost Aeon: global ice age lasting about 190-220 million years
  • 7th Age: from equator to sub-topics, temperate forests; gradual blend to boreal forests and tundra; ice caps are huge (lasts about 30,000 years)
  • 8th Age: new civilisation rises

This story would take place in the 7th age.

Resources:

image

Downloadable games / worlds

Tasks:

  • Figure out a minimally useful / maintainable set of files for describing worlds and stories
  • Devise formats for individual files
  • Devise a means of packaging game files
  • Provide a means of publishing (and downloading) them

Support any lmud games

Tasks:

  • Create game browser
  • Create game downloader
  • Create game installer
  • Create in-game, admin wizard that ties these together
  • Add new starting "room" for admins to enter the "new game" wizard
  • Support pulling in custom game commands into mudshell

Support importing game data

This functionality will essentially only be used once: to upgrade game data to the in-memory graph db (see #46). Still useful, though ...

Tasks:

  • Use filestore to load data
  • Convert loaded data to maps
  • Add support for finding / getting all data of a given type
    • all rooms
    • all objects
    • all characters
  • Add utility functions for loading all data into memory
    • add function to get list of games
    • add function to get list of tables
    • use these to create additional arity functions for mg-import:from-fs
  • Add utility functions for loading rooms into graphdb
    • add vertices for all rooms
    • add edges based upon room name, exits entry in room, and direction
  • Add utility functions for loading objects
    • add vertices for all objects
    • add edges based upon room name, objects entry in room
  • Add utility functions for loading characters
    • add vertices for all characters
    • add edge for location
    • add edges for inventory
  • Add utility functions for loading games
    • add edges for characters in games
  • Add utility functions for loading users
    • add edges for games

Some notes: we did this in ticket #68 ...

Load data from files:

(set `#(ok ,rm1) (mudgraph-v1:load "rooms" "room1"))
(set `#(ok ,rm2) (mudgraph-v1:load "rooms" "room2"))
(set `#(ok ,obj1) (mudgraph-v1:load "objects" "sword"))
(set `#(ok ,obj2) (mudgraph-v1:load "objects" "painting"))
(set `#(ok ,per1) (mudgraph-v1:load "characters" "eve"))

We'll want to be more specific with this, though ... maybe indicating the source format?

Then we convert that data to maps for use as "labels" (arbitrary data storage) on the nodes:

(set rm1 (proplists:to_map rm1))
(set rm2 (proplists:to_map rm2))
(set obj1 (proplists:to_map obj1))
(set obj2 (proplists:to_map obj2))
(set per1 (proplists:to_map per1))

We'll probably just include this in the above functions ...

Support multiple storage backends

This will essentially be a configuration change and creating an interface for all storage operations.

The "interface" will then dispatch to the appropriate backend, based upon configuration.

Depends on:

Blocks:

Tasks:

  • Identify all current game state operations
  • Create a version "0" of backend support that's just a pass-through to the data file storage
  • Update configuration
  • Add configuration logic to dispatch to this one-and-only storage backend
  • Configuration needs to be game-level, not lmud-level:
    • which backend to use will be determined by the game
    • games need to follow a specific configuration convention
    • lmud will read that to determine what backend to use

Split TODO

Tasks:

  • Create Change log / release history file
  • Move actionable items into tickets

Move file-based storage to gen_server

Tasks:

  • Make file operations as atomic as possible
  • Schedule regular saves so data is "never lost" (logins should kick off timed / recurring jobs for each user)

Add CLI support for setting access / permissions levels

This will be how someone is granted wizard / world-building rights.

Tasks:

  • Make sure the game data functions can be used without the server running
  • Create an lmudtcl LFE script
  • Add permissions command
  • Add set subcommand
  • Add --user flag
  • Add --level flag

Convert hard-coded file writes to a data model with serialisation support

Right now, the .dat files are something the original Erlang developer used to store Erlang data, but it's all formatted manually, as assembled strings. It would be better to let Erlang do the formatting (e.g., ~p).

Blocks:

Part of:

Tasks:

  • Create a mini "serialiser" that writes Erlang data to files using format/~p
  • Write some tests for it that reads this back (e.g., file:consult)
  • Look for all occurrences of 'lmud-filestore':write and replace with new function calls
  • Update the following:
    • character
    • user
    • room
    • object
  • Test, test, test

Support running lmud from Docker

Tasks

  • Find a good base image
  • Build for docker
  • Test
  • Deploy to Docker Hub
  • Add README instructions for downloading / installing from Docker Hub
    • ports
    • mounting volumes

Add character commands

  • listing associated characters
  • joining a game as a character
  • creating a new character (will kick off wizard; see #32)

Define graph models for game data

Part of:

Tasks:

  • Decide about general structure
    • explore queries for users
    • explore queries rooms
    • explore queries for objects
  • What to use for IDs
  • What additional data to store on "label"
  • How to best look up, e.g., name by ID
  • How to best look up, e.g., ID by name

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.