Git Product home page Git Product logo

graphgram's Introduction

graphgram

More complete documentation is available at the following links:

graphgram is a graph grammar library. It transforms graphlib graphs using a configurable, JSON-described graph grammar (see e.g. these slides by Matilde Marcolli, or this RPS article about Joris Dormans' Unexplored (which uses the technique to generate "cyclic" levels), or this Wikipedia page).

It can be used for game levels, procedural content, simulations, etc.

Scripts

Example grammars

API usage

var graphlib = require('graphlib'),
    Grammar = require('../graphgram').Grammar,
    fs = require('fs')

var grammarFile = 'grammars/dungeon.json'
var grammarJson = JSON.parse (fs.readFileSync (grammarFile).toString())

var grammar = new Grammar (grammarJson)
var graph = grammar.evolve().graph

The resulting graph is a graphlib object.

Command-line usage


Usage: node transform.js

  -g, --grammar=PATH   read grammar file (default "grammars/dungeon.js")
  -c, --canonical      use canonical schema (no syntactic sugar)
  -j, --schema=PATH    save JSON schema to file
  -C, --canonize=PATH  save canonical grammar to file
  -i, --input=PATH     read graphlib JSON file
  -o, --output=PATH    write graphlib JSON file
  -d, --dot=PATH       write graphviz DOT file
  -L, --limit=N        limit number of rule applications
  -S, --stage=N        only run one stage
  -s, --seed=N         seed random number generator
  -q, --quiet          do not print pretty log messages
  -v, --verbose        print MORE pretty log messages
  -h, --help           display this help message

graphgram's People

Contributors

ihh avatar

Stargazers

Edgar Simo-Serra avatar Niclas avatar Florian Rohrweck avatar Andrew White avatar Erlend avatar Corentin Forler avatar Rohit Dasgupta avatar Nick avatar Mark Rickerby avatar José A. Ramos avatar  avatar Aidan Smyth avatar Zaki Mughal [sivoais] avatar Nicholas Grippo avatar James Skripchuk avatar James Arruda avatar bokChoi avatar Milan Gruner avatar Andrii Syrokomskyi avatar David Buksbaum avatar Nikita avatar Mike Miles avatar Andrew Kern avatar Trevor Overman avatar Anna Allen avatar lagleki avatar Muhammad Anshar avatar Gabriel Martinez avatar Simon Strandgaard avatar  avatar Murilo Polese avatar Daniel Hines avatar Thomas Jones avatar  avatar Daniel Miller avatar  avatar Carl Olson avatar Serin Delaunay avatar J. Felix Etcetera avatar Jim Kang avatar James Singleton avatar Avery Pinko avatar Darius Kazemi avatar

Watchers

 avatar Darius Kazemi avatar James Cloos avatar  avatar

graphgram's Issues

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.