Giter Site home page Giter Site logo

waterlily's People

Contributors

embraceltd avatar

Watchers

 avatar

waterlily's Issues

Max number of carried items

A max number of items that the player can carry should be defined in the config. Setting it to -1 enables the player to carry an infinite number of items.

Create generic classes for commands, conditions, actions and operations

In order to create a truly customizable game engine, the available commands (TAKE, DROP etc) should be defined in the config rather than being hard coded. This requires the creation of classes for commands, conditions, actions and operations.

The idea is that a command should have a target action.

An action should have a list of conditions that must be fulfilled in order to perform the action.

The action should also have a list of operations. If all conditions are met, the operations are executed.

A condition typically consists of getting a property value of an item and comparing it to a certain value. If not equal, a message is output and execution of the action returns false. I.e. 'You don't have the hammer'.

An operation typically consists of setting a property of an item to a new value.

The completed action should output a description of what was done, i.e. 'You take the hammer'.

Example

Command: take hammer

The command is interpreted as a verb, 'take', and an object, 'hammer'.

The verb 'take' is defined in the config and associated with an action.

The action has a list of conditions for the object to be taken by the player.

  • Item.carry == false (that you don't have it already)

  • Item.location == userLocation (that the hammer is present)

  • Item.canTake == true (that it can be picked up unlike, let's say, a car)

It has a list of operations:

  • Set item.carry = true

The action has a CompletedMessage:

  • 'You take the hammer'

A command object can have a list of synonyms (GET, TAKE, PICK, SNATCH, GRAB) etc.

Conclusion

A command object contains:

  • a list of command (verb) synonyms

  • a named target action

An action object contains:

  • a name for retrieval

  • a list of conditions

  • a list of operations

  • a CompletedMessage

A condition object contains:

  • a condition definition, a string that defines what item, what property, what value and what comparison operator to use.

  • a FailureMessage

An operation object contains

  • an operation, a string that defines what to do

Create "trig" instruction

Let triggerActions only be triggered by trig instruction. Remove option to trigger actions by conditions. TriggerActions can be triggered by Actions and other triggerActions.

Syntax: trig:{triggerActionName}

Example: "trig:takeBottleExplosionAction"

Define pathways

People, animals and moving objects (like trains) could have a pathway, defined as an array of location numbers, which they move along, one step for every new turn. A pathway could optionally be started by triggering an event, otherwise it starts when the game starts.

Make turns time limited

A turn is defined as the events between two player commands. The 'wait' command was created to prepare for the concept of turns (in that it progresses one turn without doing anything).

In order to spice up the game, there should be a time limit of 1 minute after a player issues a command, after which the game engine sends a 'wait' command and forces a new turn.

If there is a pending detonation action, the player would be killed if he/she just sits idle without getting out of the location.

Put intro text in config

Put the games intro text in the config to allow for customization, and put less focus on the engine's intro text.

Output a mention of the engine in the "header box", don't include it in the config. It shouldn't be possible to edit out.

Example: A config setting like:

"intro" : "DEERWOOD 1.0 BY EMBRACE LTD."

would output


  • DEERWOOD 1.0 BY EMBRACE LTD.
  • Powered by Waterlily Engine

Refactor conditions to avoid hard-coding

Try to define conditions and special events as config properties instead of hard-coding them. This will require new objects and new properties in existing objects.

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.