Python: Animal Generator

First one done.

python_animalgen

not expert enough to give tips really but might be useful to someone (or me after a gap)

the way i did it was to take the tabular data and put it into a collection of what Python calls a tuple which you can then put into a collection and access as an array so for example adding all the terrain types and their various modifiers into terrain tuples and then bundling them into a tuple of tuples

d0 = ‘Desert’, 3, -3, ‘other’
d1 = ‘Badlands’, -3, -3, ‘other’
d2 = ‘Prairie’, 4, 0, ‘other’
d3 = ‘Hills’, 0, 0, ‘other’
d4 = ‘Mountains’, 0, 0, ‘other’
ds1 = ‘Crater’, 0, -1, ‘other’
ds2 = ‘Gorge’, -1, -3, ‘other’
ds3 = ‘Caves or Ruins’, -4, -1, ‘other’
dryterraintable = [d0,d1,d2,d3,d4,ds1,ds2,ds3]

so the animal size modifier of the ‘Badlands’ terrain type can be accessed as dryterraintable[1][2]

(indexs go 0,1,2 etc)

typing in all the table entries can take a while but once they are all set up going from step to step on the generator is simple enough.

Mine is slightly more complicated as the initial reason was related to my “Early Colonization ATU”. There, I was generating uncolonized planets with native primitive sentients and wanted to quickly generate candidate animals as the precursors of those sentients from the world stats rather than selecting a specific terrain type. That’s why there are two options.

In the early colonization ATU i’m taking atmosphere 2-9 as earth-like but earth at different stages: 2-3 is early earth with life only in the oceans, 4-5 is mid earth with life in the sea and beginning on land, 6-9 is the full deal. To that end i divided the Traveller terrain types into dry, wet and sea categories and atmosphere 2-3 only picks from the ‘sea’ category, atmos 4-5 picks from sea and dry, atmos 6-7 picks from all three. When sea and other categories are both available the hydro proportion weights which is picked.

The second option just picks a terrain from a list and randomly generates an animal based on that.

It’s rough but it does what I need.

As an example one of the colony sites, Irila, in my early colonization sub-sector is a new colony with a native friendly sentient as the most intelligent species (i.e. ant, dolphin, chimp type intelligence) and world stats of 568. These species can somehow become the hook for a particular world in some way.. The idea is to keep generating critters until something jumps out.

The first up is a sea surface dwelling man-sized triphibian social grazer. The social herbivore/grazer part fits with being friendly so maybe some kind of giant flying insectoid critter whose life cycle somehow involves both sea and land. Maybe caste based so it’s only the leaders who are sentient / near sapient.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: