Code Monkey home page Code Monkey logo

world's Introduction

World Generator

This is a tool and library to procedurally generate fantasy worlds.

Configuration

The best way to configure the executable is to put a world.yaml file in your working directory and pass it to the binary with the -c flag. For example:

world -c world.yaml culture

The file is structured like this:

data_dir: <data directory>
save_dir: <save directory>
save_target: <either "DO" or "filesystem">
web_domain: <final web domain>

The following environment variables configure the executable and are required if not specified in the config file:

  • WORLD_DATA_DIRECTORY: The absolute directory that contains data files for the application.
  • WORLD_SAVE_DIRECTORY: The absolute directory where files will be written to.
  • WORLD_SAVE_TARGET: Either DO to save to Digital Ocean or filesystem to save to the local file system.
  • WORLD_WEB_DOMAIN: The domain name (without protocol) remote images will serve from. For example, www.world.com.

Building

Run ./build.sh. The binary will be dist/world.

Running in Development

Run ./run.sh <command>. It will set sane defaults and use the local filesystem for saving files.

world's People

Contributors

benovermyer avatar cxong avatar davidkroell avatar knutzuidema avatar skofli avatar smortime avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

world's Issues

Requesting value with id is not always the same

Since the global random generator of the rand package is used for all random values, there can be cases where, when multiple values with an id are requested simultaneously, the value returned is not the same.

Reproduction:
Open multiple pages with an ID at the same time, e.g. in Firefox by bookmarking them in a folder and clicking "Open All in Tabs".

Reason:
The reason for this a simple race condition. When a page with an ID is requested the global random generator is seeded with that ID. Then the request is executed just like a normal one. However, if another request with an ID arrives while generation is not yet completed, it might happen that the new seed is injected in between calls for random values, thus resulting in different random values.

Solution:
I would suggest to inject a random generator seeded with the ID into a context and use that generator instead of global functions for generating random values.
This would require restructuring the random package insofar that the functions are also available as methods of a generator type.
It would also require adding context parameters to all functions/methods requiring random values.

I would be happy to do the work required if this is something that you would like to see fixed.

Replace Animal struct with Species

Currently, the animal package uses its own structure - Animal. Replace this with the Species struct defined in the species package, and convert all animals to use the new struct.

This will require touching the climate package also, as it consumes the animal package.

Adding appropriate traits is outside the scope of this issue. However, all resources need to make the transition.

Add philosophical views system based on traits

Based on the traits package, add a philosophical views system. This will be used by both the character and culture packages, at a minimum. It will replace the “views on magic” part of the culture package.

Philosophical views must use tags to differentiate opposing or incompatible views.

The culture package will use this to determine cultural norms.

The character package will use this to determine personal views.

Remove the API and refactor as a CLI tool

This is a big one.

Instead of serving an API, refactor the "world" project as a CLI tool. Output will still be JSON for now. A future task will focus on implementing other output options.

Rather than trying to rebuild all endpoints as CLI commands, just focus on two big ones: culture and heraldry.

The following commands should work:

world culture

and

world heraldry

Don't worry about implementing options for either one yet.

Source/License of Graphics

Hello, I was wondering where the graphics were obtained and what license they are under. This is an awesome tool set, just want to ensure I can fully use what is generated.

When trying to run says Sentry Not Set Up

What is Sentry, how do I get it / set it up, so I can run the built files from this project?

Edit, I made it work by adding
os.Setenv("SENTRY_DSN", "DSN Code Here")
to the main function.

Add the ability to specify configuration via file

Currently, configuration is specified with four environment variables. Add a flag -c/--config to specify a config file instead. The config file should use the YAML format, and accept arguments like this:

data_dir: /my/directory
save_dir: /my/other/directory
save_target: filesystem
web_domain: www.example.com

The equivalent environment variables are as follows:

data_dir: WORLD_DATA_DIR
save_dir: WORLD_SAVE_DIR
save_target: WORLD_SAVE_TARGET
web_domain: WORLD_WEB_DOMAIN

If both the environment variables and configuration file are specified, the configuration file values should override the environment variables.

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.