GithubHelp home page GithubHelp logo

godot_procedural_name_generator_database's Introduction

Godot Procedural Name Generator Database

This repo is only the data files from Godot Procedural Name Generator Plugin.

How Contribute?

Any one can contribute, from this repo, or send email to author with names data. But, we show how make it on GitHub (best way).

If your not has programming skills, just create JSON files. This files can use defaults fields: "first", "family" The default factory, get these lists in "general.json" and generate a name. This is the most simple use.

You can separate it in files, to create genders, where "general.json" store family names, "male.json" to males and "female.json" to ladies.

Put all inside a folder in ./database

If you create a rule file, put it on ./factories, this is a GDScript that the same name of database folder.

A full example of folder:

  ./addons
          /name_generator
                         /database
                                  /my_creatures
                                               /general.json
                                               /female.json
                                               /male.json
                         /factories
                                   /my_creatures.dg

Then create a fork from this repo (tutorial)

Add your files:

  git add .
  git commit -am 'Added My Creatures specie'
  git push

And create a pull request (tutorial)

Example of configuration files

A simple file
  # general.json
  {
    "first":["Adrian","Alan","Baldur","Rat"],
    "family":["the Empaler","the Cursed","the Plagged"]
  }
A gender generation
  # general.json can store family names or designation
  {
    "family":["the Empaler","the Cursed","the Plagged"]
  }

  # male.json
  {
    "first":["Adrian","Alan","Baldur","Rat"]
  }

  # female.json
  {
    "first":["Ariel","Aline","Jasmine","Zelda"]
  }
A Factory file

This is a GDScript class file. That rulled the generation. If you not provide one, the engine uses a default Generator.

  class Generator:
    var first = Array()
    var family = Array()

    func initialize(store_path): # this receives the path of directory that contains .json
      var f = File.new()
      if f.open(path + '/general.json')==OK:
        var data = parse_json(f.get_as_text())
        f.close()
        first = data.first
        family = data.family

    func generate(gender=null): # this receives gender if applicable, use default NULL
      var name = first[ randi()%first.size() ]
      name += " " + family[ randi()%family.size() ]

      return name.capitalize()

    func _init():
      pass

Reference works

godot_procedural_name_generator_database's People

Contributors

marcosbitetti avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

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.