[Mod] NameGen [0.1] [namegen]

Post Reply
cronvel
Member
Posts: 19
Joined: Fri Jan 11, 2019 16:50
GitHub: cronvel

[Mod] NameGen [0.1] [namegen]

by cronvel » Post

NameGen is an API mod allowing one to generate names, a kind of markov generator with some modifications.
Basically, you give it a list of names, and it can generate names that are not in the original list, but looks similar, in the same veins.

I have done this mod for the mobs mods, like mobs_humans or aliveai, so they can have more meaningful names.

How to test it:
Once in game, open the console and type: /test_namegen <generator name>.
It comes with a builtin generator named "elf", so you can type: "/test_namegen elf" on a bare install.

How to use it in your mod:
namegen.load( generator_name , [file_path] ) : load a generator and assign it a name
namegen.generate( generator_name ) : return a string from that generator or return nil if the generator does not exist.

How to create new generators:
To generate names, the generator needs a graph file in the JSON format.
That generator is a port of a Javascript/Node.js generator of mine, but only the generator part is ported, not the graph-making part.

So to create a new graph, one have to use the original Node.js project: Nomi Ninja.
To install it, you needs Node.js (and of course Npm, which comes with it).

Code: Select all

git clone https://github.com/cronvel/nomi-ninja
cd nomi-ninja
npm install
To create a new graph, copy and modify a config found in /sample, e.g. /sample/elf.kfg.
Then export the graph with this command:

Code: Select all

./bin/nomi-ninja my-source.kfg --export > my-graph.json
Copy the JSON in your mod directory and load it with namegen.load().

Some names created with the builtin elf generator:
Thrandilman
Horiand
Mánduil
Elviolil
Vondil
Elyn
Cylduilmad
Eowith
Lómowaril

None of those names were in the original list.

Source: Gitlab repo
ContentDB: cronvel/namegen
License: MIT
Last edited by cronvel on Sat Nov 30, 2019 07:48, edited 2 times in total.

User avatar
Melkor
Member
Posts: 358
Joined: Sat Sep 24, 2011 01:03
Location: Underground

Re: [Mod] NameGen [0.1] [namegen]

by Melkor » Post

nice! these generated names are very Tolkienian :)

User avatar
Hamlet
Member
Posts: 764
Joined: Sat Jul 29, 2017 21:09
IRC: H4mlet
In-game: Hamlet
Location: Lombardy, Italy

Re: [Mod] NameGen [0.1] [namegen]

by Hamlet » Post

cronvel wrote: Some names created with the builtin elf generator:
Thrandilman
Horiand
Mánduil
Elviolil
Vondil
Elyn
Cylduilmad
Eowith
Lómowaril
Wonderful! Thanks for porting it, I'm going to have fun with this :)
My repositories: Codeberg.org | My ContentDB's page | I'm on PureOS with XFCE

User avatar
Lone_Wolf
Member
Posts: 2355
Joined: Sun Apr 09, 2017 05:50
GitHub: LoneWolfHT
IRC: Lone_Wolf or LoneWolfHT
In-game: Lone_Wolf
Location: Not there, THERE!

Re: [Mod] NameGen [0.1] [namegen]

by Lone_Wolf » Post

This is neat! Great work

cronvel
Member
Posts: 19
Joined: Fri Jan 11, 2019 16:50
GitHub: cronvel

Re: [Mod] NameGen [0.1] [namegen]

by cronvel » Post

Thanks, tell me if it does the job! ;)

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests