Mud-Buds / libraryinth-spire

A back-end social MUD written with node.js and socket.io, complete with immersive storytelling.
https://libraryinth-spire-new.herokuapp.com/
1 stars 0 forks source link

[UX] Refine command parsing to handle more variable inputs #11

Closed smooto closed 4 years ago

smooto commented 4 years ago

We want players to be able to focus on gameplay and puzzle-solving, rather than being frustrated by a rigid command system. Our parser should be able to handle a variety of inputs to ensure a smooth user experience.

Goal Intended output is an array of strings, ordered like so:

const action = parsed[0]; //use
const object = parsed[1]; //key
const target = parsed[2]; //door

Variable inputs with the same intent should consistently reproduce the same output (and, therefore, the same behavior from the game).

Considerations

Example edge cases base command: use key door

Resources Natural NLP -- supports POS tagging

Rolling our own It may be easier/more lightweight for us to create our own POS tagger from scratch. One benefit is that we can distill tagging categories to just what we need to separate wheat from chaff in our context.

Step 1: ID tags and build lexicon

POS tag examples
Action ACT use, look, take
Item ITM key, table, door
Particle PRT at, on, with

Step 2: build out tokenizer and functions to tag tokens based on lexicon

Step 3: create rulesets & functions to separate object/target, etc.

Step 4: unit test and integrate