Design and documentation journal for my interactive fiction (text games); also reviews and other miscellaneous stuff.

Tuesday, June 29, 2010

Community spreadsheet finished-ish

So I wrapped up the wildlife community data-collection yesterday (or at least Phase I).

The current table deals with quite a few specifics; there's a few things that will probably only be used as internal checks, but most have a direct impact. 49 "regular" communities that might be auto-genned or created through natural succession processes, plus a few different lakeshores, a couple cliffs, and a cave environment. Because of obvious game balance issues, those last categories do not auto-spawn.

These are not, of course, the descriptions or anything - just raw data to work with. But it was a boatload of work, and I feel very good having a first run-through.

These are the categories of data:

Fertility: A rough overall measure of soil fertility. I have no intention of tracking this for wild places, but it becomes important if the player wants to farm a particular location, or when determining succession. (I seemed to start by using high/moderate/low and switched to rich/moderate/poor later. Yeah, that'll have to be fixed.)

pH: Combined with moisture and fertility, these are the most predictive of plant types. pH is one of those things that will probably stay static. Right now, pH range is a list of two values, so: {65, 75}. The first is the lower range of pH in the community, the second the upper. If I wanted to, I could then categorize a particular room as acidic or neutral. I haven't done the coding yet, but it's straightforward enough.

Slope: From flat to cliff, in list form. Wetlands tend to be the flattest subset of communities, and things roll more in the drylands (and, of course, cliffs are cliffs.) Good for helping determine drainage, likelihood of flooding/drought, erosion for farmland, and nice immersion opportunities for wilds. I'm considering features like gullys and things, and stream placement.

Moisture: A tremendous determiner of plant-life and succession. Change the moisture level, and everything changes. Significant in farming, although wetlands would probably be drained, and moisture levels will depend more on precipitation and soil type than natural environment. These values range from saturated to dry.

Climax: Signals whether or not to check community for succession without an event. Every community gets checked when there's fire or something, but natural passage of time changes some communities (grassland -> savannah -> forest) but not others (a mature old-growth forest is an entity unto itself).

Soil Depth: I may take this out; it contributes to windthrow likelihood and erosion, but doesn't seem as important now as it did a few weeks ago. Still, I probably won't remove it until I know I won't use it. An uncomfortable number of the entries are sheer guesses.

Succession Possibilities: Given the natural passage of time, options for what a community may turn into. This is a brute force way of handling succession. It's not as complete as I'd like, since understanding the dynamics at work is challenging at best, and my data is very incomplete. Without disturbance, does a dry prairie turn into an oak barrens, or a pine barrens? Either? This list needs checking over.

Flood, fire, and beavers: These tend to knock succession "back" or change it significantly. Increased flooding may kill trees. Fire may kill fire-vulnerable trees, or all trees. Beavers can redirect streams, increasing or decreasing water flow. I'm well aware this category is mostly raw guesswork, but brute force manipulation is better than nothing, and keeps every room in the game from proceeding directly to forest and staying there.

Likely Nearby Types: What communities tend to be nearby. Some of this was helpfully provided by Michigan. Some of it was made up by me. (Michigan's lists tend to be shorter; I made mine by association.) I intend for this list to affect map generation, increasing the likelihood that a bog will be near a muskeg. This list is related to the succession possibilities and flood, fire and beavers lists, but tend to be a little longer.

Canopy Range: Hard numbers at last. Like pH, canopy range is a list with two numbers, bracketing the range. Canopy is a neat shorthand for tree density, size, and shading. Tree density is inadequate because some rather dense forests still let lots of light in; there may be tens of thousands of aspen per acre, but on the forest floor, you've still got dappled sunlight. Under an oak forest, with fewer trees, you get deeper shade because the canopy is closed. These tend to be guesses, but guesses based on examples. I have no doubt I'll need tweaking. The idea is that during generation, the number, age, and type of tree will create a canopy in the range given. When the shade in a location exceeds the canopy range, it might kick up to another community. For example, if enough oaks grow in an oak savannah, it may transition to a southern dry mesic forest (essentially an oak dominated forest). If no forest-y succession type is listed for a location, it will check and see if it can "match" current conditions with more canopied communities.

For example: A bog is essentially unforested: it has a canopy range of o-10%. Anything over that, and it will look at its succession possibilities column. Muskeg is the only option, but if nothing was listed, it would look for a community matching its current statistics, and become something new.

The difficulty of getting the coding right for the latter bit is what made me do the Succession Possibilities column in the first place. I plan to do it, but hope it will not ever need to be used. Things being what they are, there's probably multiple options that can create communities with statistics that fall outside the normal range. For example, our bog is now a muskeg. A bog has a pH range of 3.0-5.0 ({30, 50}), and a muskeg has a range of 3.2-4.3 ({32-43}). What if our original bog had a pH of 3.0?

My idea right now is to implement a sort of regression to the mean, where numeric values will gradually "pull" towards the mean value of a range. It's not actually cheating; biologic and chemical values do change over time, often showing this tendency to move away from extremes. But it's something I'm not going to implement for quite a while, because a better idea may occur to me.

Tree density: So, canopy is awesome. It is. But sometimes, a quick check is better. How many seedlings to try planting in a place per year? What's the likelihood there will be 10 young trees vs. 1 old tree in a prairie? Besides, canopy requires math. Kind of a lot of math. (Take sum of: each tree, look at its height and species, multiple density of species by height.) Tree density is quick.

Wind Risk: How much wind hits a place, and how likely is it to cause damage? Mostly windthrow, but may also play a role in events.

Flood Risk: How likely a place is to be flooded. Floods can trigger succession, wipe out crops, sweep away items, and in extreme cases, may be catastrophic.

Fire Risk: Chance of significant surface fire. Fires can trigger succession, but they can also maintain communities; dry prairie would quickly become something else if there were not regular fires. The risk ranges from low (as rare as once per 1,000 yrs.) to high (as often as every 10 yrs.) to regular (as low as 1:10).

Fire's deeply problematic from a play view: on one hand, having a wildfire sweep through and destroy the player's house, barn, crops, animals, etc. is kind of awesome and I approve. (Sort of. Maybe not the animals.) On the other hand, it's random destruction that is completely catastrophic, and sort of a break of trust. (And I'd be pissed if it were me playing.) Plus, fire is kind of like a rope: the permutations for how it should behave and what it can do are really, really troubling. I may have to do fires more or less locally: only in the location that spawned them, plus surrounding fire-vulnerable places. Or maybe I should drop the idea altogether.

Forest Types: So the foresters of America have a very long list of different groups of trees that tend to be found together. These are not communities in any sense of the word: they're both less specific, in that certain forest types are found all over the US in huge gloms, and more specific, in that they specific groves and smaller associations of species than communities tend to. Unfortunately, I haven't been able to find a good source for this data online, except scattered far and wide. So this column is there to remind me to hit the research library and see if I can get a reference book.

Dominant trees: What I hope will be the basis for forest types later. The trees most likely to be found in a location, usually comprising about 80% of the trees. This is for initial world generation, as well as future seeding purposes.

Minor trees: The other 20% of tree species. Usually there are more of these. For example, a prairie fen is dominated by tamarack, but occasionally you'll also find yellow birch, red maple, or American elm there. The minor trees are extra nice because there's a decent chance that two otherwise identical communities will actually have different minor trees, some quite rare. The opportunity for a player to find a grove of wild plums amongst a large deciduous forest is pretty neat. It also gives some trees true dominance: maples, oaks, spruce, balsam fir are all over the place, both as major and minor species.

--

I'm hoping all this info will help me do two things: create a world that feels unique and interesting and real, and then model changes to the world over time in a way that provokes curiosity and pleasure, but doesn't require too much head-scratching for the player - if she doesn't notice, that's okay, just as in the real world.

There's no way to do this to the extent I'd like to, but hopefully there's enough to give the world a solid veneer.

No comments:

Post a Comment