Resource Generation

I recently wrote about the type of resources that could be generated on worlds, and I’ve been doing some thinking about how to improve upon it. I think I’ve come up with a technique that works better, by reversing the order in which information is generated.

A ‘resource’ in WorldGen is something that a planet has that can be mined, farmed or otherwise obtained by a settlement. Silicate Ore is one type of resource, as are Organic Chemicals. But life also provides resources. Algae could be used to create Synthetic Food, Grasses can generate Grain through farming, and Grazers could generate Meat.

Previously, I talked about how to name the resources that represented forms of life, and I’ve decided to go down the route of using very abstract terms – Grazers and Hunters represent two classes of land animal for example. Each category probably represents many different species that fill that niche.

Previously, all data for a world would be generated using random determination. This set the physical properties of the world, but also created the resources based on various factors.

Then the text description for the world would be created based off the data, and finally the world map would be generated.

This meant that if the data generation phase decided that the world was heavily forested, with lots of ‘Tree’ resources, then the text description could take this into account, and the map could colour large portions of the land green.

The advantage of this is that the data generation step is done in code, so it’s easy to make logic decisions at this stage to ensure that what is created is meaningful.

The text generation is based off text templates which have a limited logic parser, which allows insertion of variables and some switching, mostly to allow selection of random text choices.

planet.MesoGaian=The continents of $Name are [barren|devoid of life|lifeless] but the seas, which cover $Hydrographics% of the surface, are full of life, mostly in the form of [large|huge|translucent] [jellies|fish|eels].

The above takes some properties from the planet’s data (it’s name, and percentage of water cover), and selects some random phrases from the given lists. This might produce something like this:

The continents of Nediyanuh III are lifeless but the seas, which cover 72% of the surface, are full of life, mostly in the form of huge eels.

The problem is that the text parser (based on code I wrote almost 20 years ago) is quite limited in functionality, and though it allows some quite complex switching, it’s hard to do complex logic in it. Generating the data, then creating text to match it can be hard. If a world has 88% Large Grazers, 60% Hunters and 120% Insects (the percentages just modify the rate the resources can be obtained, so Insect resources would be obtained twice as quickly as Hunter resources in this case), then ensuring the text covers that this world is infested with insects, but also has a lot of large herd animals that roam the plains is tricky.

So my decision is to switch things around a bit and move some of the data generation into the text generation layer. There is already a way for the text generator to write to the data, I’m just making heavier use of it.

So rather than having the data layer randomly generate values for all the types of living things, it will now just generate the inorganic resources. The text generators will now specify which living resources to add.

The seas here are full of [huge|massive] carnivorous eel-like creatures that are the apex hunter on this world, feeding off the [four|six|ten] legged [armoured|spiny|slimy] creatures that crawl between the kelp forests on the ocean floor. $+HugeSwimmers $++LargeSwimmers $++Crawlers $+++Kelp

The number of pluses specify how much of each resource to add. Crude, but it’s easy to hack into the current code.

Each template can be as inventive as it wants with the text and then specify the resource types itself. Since what the resources actually are can be fleshed out in the text description, we can keep the number of resource types low by using very generic terms rather than specific types of things.

The world data still specifies the general level of life – whether the world is Archaean, Complex Ocean, Simple Land etc, and so the atmosphere, temperature etc should all be reasonable. Each world type will have a list of templates for each life level it supports, and they can be split into multiple parts and mixed together to add to the variety.

The aim is to try and create enough of a description which players and GMs can wrap their heads around if the world is visited, and which is compatible with the types of trade goods the world is selling and buying. It may also affect the types of adventures available on these worlds.

Some examples of the text templates can be found in the project source, and they are continually being updated. A few examples of what is generated are given below.

The life on Tefohe III is primarily aerobic, breathing oxygen for energy. Countless species of miniscule creatures float and swim in the seas, feeding off each other as well as the algae that is abundant in the upper ocean layers.

Though Elenqueny III has evolved complicated life forms, few of them are vertebrates. The largest are long-legged tough shelled creatures with grinding maws that hunt on the seabeds. Some have bodies several metres long. Above them the seas are filled with massive floating brightly coloured jelly-like creatures with long tendrils.

The seas of Stona Ebo III are full of complex life. The dominant animals are a type of fish, scaly finned vertebrates which are a mix of algae grazers and hunters which hunt smaller fish and the various animals that inhabit the sea floor, including scaly radially limbed walkers and sessile clam-like filter feeders.

Samuel Penn