Git Product home page Git Product logo

goat-tower's Introduction

goat-tower

## Initial Ideas http://i.imgur.com/wQM9vkr.jpg ## Installation/Use 1. git clone [email protected]:nijotz/goat-tower 1. cd goat-tower 1. mkvirtualenv goat-tower 1. pip install -r requirements.txt 1. createdb goattower 1. cd goattower 1. python load.py tests/fixtures/story.yaml yaml 1. python cli.py nijotz look 1. python cli.py nijotz north 1. etc... ## Design The design of Goat Tower is relatively simple. Goat Tower is a heavily MOO influenced, relational and modifiable game. The game consists of a world, which is populated by Actors. Actors have several key properties and a list of attributes. The key properties are as follows:
  • Parent ID
  • Name
  • is_player

Every Actor has a parent actor, because everything is inside of something else (probably). It is possible to build a graph wherein several nodes exist with no parents. The decision behind this choice was to allow for diversity in locomotion, mainly that you can move north, south, or into weird complex situations like 'move temporally into the past' or 'move south into Jimmy's mind'.

In addition to the key attributes of every actors are certain mutable attributes. These are designed to be things like 'zombiness', 'sickness', 'health', 'panic', 'resemblance to President Reagan' or really anything else that can be thought of. This is to keep the game dynamic and modifiable from inside.

For example, you could construct an Actor such that using 'look' in it's vicinity would set the player on fire, or a self-perpetuating memetic virus that overrides every say command with the rick roll text.

The command structure is hierarchical in a similar fashion to the Actor model. Actions on Actors can be accomplished with an augmented subset of simple CRUD commands. Deleting, modifying or creating new attributes, in addition to things that cannot be implemented using those like `say_text`.

The precedence for command execution is a fall through structure that goes Game -> Player Actor -> Children Actors -> Parent Actor -> Children of the Parent Actor. This allows you to have certain system commands that will not be overridden by uppity actors.

When executing commands, a lookup in the database is performed to see if the current item in the precedence chain has a corresponding command (Command.regex). If it does, another lookup is performed to get any Code objects that correspond to that command.

This structure lets you have many commands that can be executed at once, or a rich command that sets you on fire, moves you north and lowers your health attribute to 0 while displaying the text 'Fire destroys the room you are in'.

The syntax for getting commands to work is currently in flux.

goat-tower's People

Contributors

kyleterry avatar nijotz avatar qpfiffer avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

goat-tower's Issues

create help command

iterates over and prints out all the other commands [with descriptive text?]

Locations should be unique

Traceback (most recent call last):
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/flask/app.py", line 1836, in __call__
    return self.wsgi_app(environ, start_response)
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/flask/app.py", line 1820, in wsgi_app
    response = self.make_response(self.handle_exception(e))
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/flask/app.py", line 1403, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/flask/app.py", line 1817, in wsgi_app
    response = self.full_dispatch_request()
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/flask/app.py", line 1477, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/flask/app.py", line 1381, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/flask/app.py", line 1475, in full_dispatch_request
    rv = self.dispatch_request()
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/flask/app.py", line 1461, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "./web.py", line 57, in api
    result = do_goat_things(username, command)
  File "./web.py", line 38, in do_goat_things
    engine.handle_text(user.actor.id, command)
  File "./goattower/engine.py", line 66, in handle_text
    self.run_code(actor_id, *matches[0])
  File "./goattower/engine.py", line 99, in run_code
    self.api.run_method(code.method, code.args, context)
  File "./goattower/api.py", line 29, in run_method
    getattr(self, method_name)(*json.loads(args_json_string), context=context)
  File "./goattower/api.py", line 63, in update_location
    location = self.session.query(Actor).filter(Actor.name == location).one()
  File "/var/www/goat-tower/local/lib/python2.7/site-packages/sqlalchemy/orm/query.py", line 2702, in one
    "Multiple rows were found for one()")

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.