randpg 0.5.2
randpg: ^0.5.2 copied to clipboard
A library for generating random rpg entities.
Randpg #
Randpg is a package for generating random rpg entities like npcs, settlements and even worlds.
This package is still in development and some versions might not be backwards compatible before v1.0.0.
To view the changelog, click here
Table of Contents #
Installation #
Follow the installation instructions on dart packages.
Features #
- Generating names for various races
- Generate npc data:
- Physical description
- Personality generator
Goals #
- World generator
- Waypoint Generator
In the Future #
- Companion Generator
- Holiday Generator
Usage #
For detailed examples check the examples folder
Generating names #
Generating a male halfling name as an example:
final Gender gender = Gender.male;
final Race race = Halfling();
final nameGenerator = race.getNameGenerator(gender);
// if you want to seed the generator:
nameGenerator.seed(1234);
print(nameGenerator.generate()); // expected output: "Cormin Shadowheart"
output might be different since dart random seed is different on different machines
Generating npcs #
Generating an elf npc as an example:
final Race race = Elf();
final npcGenerator = NpcGenerator(race);
print(npcGenerator.generate());
Generating locations\buildings #
Generating a tavern whose owner is a dwarf as an example:
final LocationType locationType = Tavern();
final Race ownerRace = Dwarf();
final locationGenerator = LocationGenerator(locationType, ownerRace);
print(locationGenerator.generate());
Generating settlements #
Generating a town of mostly orcs as an example:
final SettlementType settlementType = Town();
final Race dominantRace = Orc();
final settlementGenerator = SettlementGenerator(settlementType, dominantRace);
print(settlementGenerator.generate());
Generating landscapes #
Generating a swamp as an example:
final LandscapeType landscapeType = Swamp();
final landscapeGenerator = LandscapeGenerator(landscapeType);
print(landscapeGenerator.generate());
Generating deities #
Generating a lawful good god/goddess as an example:
final Alignment alignment = Alignment(
ethical: EthicalAlignment.lawful,
moral: MoralAlignment.good,
);
final DeityType deityType = God();
final deityGenerator = DeityGenerator(deityType, alignment);
print(deityGenerator.generate());