First, a quick update on the client project. Ryan of six months ago would probably be very upset if he knew that today, I'm ripping huge chunks of carefully-crafted code and throwing it in the trash. In making the changes I described in my last blog post, I'm finding the code to be much smaller and simpler in many areas. When I finally get the app back into a ship-quality state, I'll release an update and also the source.
Now about weather. I've mentioned before about weather and in general, environment. Many text games which permit players to wander around freely in an open world implement these in a sort of "added-on" fashion. For example, they might add an "It's raining." or "The moon hangs overhead in a cloudless sky." to an otherwise never-changing area description.
I think that approach is nice for new players, but as players get used to seeing it, they learn to ignore it because it's repetitive (and often not important to gameplay). Also because the environmental aspects are just tacked-on to the end of room descriptions rather than being integrated in a way that's unique to each area, those standard area descriptions never change. In particular, outdoor area descriptions end up being extremely bland and boring - builders can't talk about a warm breeze sighing through a forest canopy, tiny rivulets of pure rain glistening along a tree trunk, or an ancient tower gleaming in the pale moonlight, because they don't know that when the player reads that description, those details will be consistent with the current state of the environment.
My plan is to embed some conditional logic into area descriptions which will be evaluated at runtime. It will look something like this:
A long-abandoned tower dominates the sky here{RAIN?, its polished-brick facade slick with fallen rain}{CLEAR?{DAY?, gleaming in the sunlight}{NIGHT?, pale moonlight casting it in an unnatural glow}}.
This compact form would evaluate...
In the rain:
A long-abandoned tower dominates the sky here, its polished-brick facade slick with fallen rain.
On a clear day:
A long-abandoned tower dominates the sky here, gleaming in the sunlight.
On a clear night:
A long-abandoned tower dominates the sky here, pale moonlight casting it in an unnatural glow.
In all other cases:
A long-abandoned tower dominates the sky here.
Notice that not only is it (relatively) compact, but it's simple to edit in-line, eliminating the need for the complicated tools which would be introduced if I insisted on having an entirely different version of the whole area description for every combination of season, time, and weather. Further, builders don't have to take advantage of this everywhere - they can use it where it's valuable, and ignore it otherwise.
Now area descriptions can come alive, including all sorts of sights, sounds and feels that they'd ordinarily have to leave out to avoid contradictions (it's night right now, but this description is talking about the sun gleaming off this tower...). As a bonus, areas which tend to attract players back time and again will seem more organic to those players, changing over time as any real location would.
I've mostly finished the weather implementation in my game prototype, I just have to multithread it now so that weather changes on its own over time. (Currently, there are commands to advance the weather and season). Here's the feature set:
Weather changes semi-randomly over time, as you might expect. Players get notification text when the weather changes (but not the season). Area descriptions may change by season, time of day, and weather state. A player can assess the current weather state with something like LOOK AT SKY.
Weather update text is directional. That means instead of saying "It's cloudy.", builders know about the previous weather state, and can use that to craft better update messages like "The rain has subsided for now, but gray still hangs heavy overhead." or "The sun's warmth dwindles as heavy clouds drift in."
Builders can define as many weather states as they like, so the level of detail in a weather system can be adjusted as fits a region. For example, a city where many players spend lots of time might have much more detailed, less predictable, and less repetitive weather, while regions that most users visit only briefly will support a basic or even stock weather system.
Weather patterns may vary not only from region to region, but also over seasons, if builders choose to use that functionality. This will make weather in general seem more realistic as it varies over time and by location, and again reduce repetition. Weather text can now include elements specific to the region and season, for example mentioning how rain patters in the dense forest canopy overhead (during spring and summer) and how snow collects on the bare branches during the winter. In a desert, there may be little to no rain... but when the wind picks up, it scatters sand from the tops of the taller dunes.
When I implement embedded evaluable text and the day/night cycle, these weather messages will also optionally vary by time of day. That day/night cycle is next on the to-do list, followed by that evaluable text embedding. The game prototype in general is "on pause" until I release another client build.
Please tell me what you think of this system! I've included sample XML describing the weather pattern for a region below so that you can get some idea about the details. This is an example of a generic weather system - one that doesn't mention any region-specifics like trees, buildings, roads, etc. Builders may define one weather pattern for the entire world, one for each top level region, or anything in between.
<!--Three seasons are calm, with precipitation about 30% of the time.-->
<WeatherPattern>
<Season Name="Spring"/>
<Season Name="Summer"/>
<Season Name="Fall"/>
<!--Clear Sky, Calm, No Precipitation-->
<WeatherState TransitionDownProbability="1" Precipitation="false" Wind="false" Clouds="false" Storm="false">
<DescriptionText>The sky is clear{DAY? and blue}{NIGHT? and flecked with stars. Moonlight faintly illuminates your surroundings}.</DescriptionText>
<TransitionTextFromAbove></TransitionTextFromAbove>
<TransitionTextFromBelow>Your surroundings brighten a little as the {DAY?sun}{NIGHT?moon} peeks through thinning clouds.</TransitionTextFromBelow>
</WeatherState>
<!--Cloudy, No Precipitation-->
<WeatherState TransitionDownProbability=".5" Precipitation="false" Wind="false" Clouds="true" Storm="false">
<DescriptionText>The air is dry for now, but clouds cover the sky. It might rain soon.</DescriptionText>
<TransitionTextFromAbove>It's getting cloudy.</TransitionTextFromAbove>
<TransitionTextFromBelow>The rain seems to have stopped for now.</TransitionTextFromBelow>
</WeatherState>
<!--Cloudy, Precipitation-->
<WeatherState TransitionDownProbability="0" Precipitation="true" Wind="false" Clouds="true" Storm="false">
<DescriptionText>Above the pouring rain hangs a gray and solemn sky.</DescriptionText>
<TransitionTextFromAbove>Rain begins to spot your surroundings.</TransitionTextFromAbove>
<TransitionTextFromBelow></TransitionTextFromBelow>
</WeatherState>
</WeatherPattern>
<!--Winter is similar, but breezy. Sometimes it storms.-->
<WeatherPattern>
<Seasons>
<Season Name="Winter"/>
</Seasons>
<!--Clear Sky, Calm, No Precipitation-->
<WeatherState TransitionDownProbability="1" Precipitation="false" Wind="false" Clouds="false" Storm="false">
<DescriptionText>There isn't a cloud in the silent winter sky.</DescriptionText>
<TransitionTextFromAbove></TransitionTextFromAbove>
<TransitionTextFromBelow>The frigid breeze subsides, leaving a clear sky overhead.</TransitionTextFromBelow>
</WeatherState>
<!--Cloudy, Breezy-->
<WeatherState TransitionDownProbability=".2" Precipitation="false" Wind="true" Clouds="true" Storm="false">
<DescriptionText></DescriptionText>
<TransitionTextFromAbove>A gentle breeze rises, pushing the chill air closer to your skin.</TransitionTextFromAbove>
<TransitionTextFromBelow>The snow relents as gusts give way to a more comfortable breeze.</TransitionTextFromBelow>
</WeatherState>
<!--Cloudy, Windy, Precipitation-->
<WeatherState TransitionDownProbability=".5" Precipitation="true" Wind="true" Clouds="true" Storm="false">
<DescriptionText>Tiny snowflakes dance and swirl under a dome of deep gray. Occasional gusts inspire shivers despite your clothing.</DescriptionText>
<TransitionTextFromAbove>The breeze accelerates, taking the bitter cold beyond comfort. A storm seems likely.</TransitionTextFromAbove>
<TransitionTextFromBelow>Blessedly, the storm has subsided for now. The snows continue to fall, blown about by the occasional gust.</TransitionTextFromBelow>
</WeatherState>
<!--Winter Storm-->
<WeatherState TransitionDownProbability="0" Precipitation="false" Wind="false" Clouds="false" Storm="true">
<DescriptionText>Blinded by a tempest of snow swirling above, you assume the sky looms black.</DescriptionText>
<TransitionTextFromAbove>Occasional gusts become a river of frigid air, the snow a blinding swirl of gray.</TransitionTextFromAbove>
<TransitionTextFromBelow></TransitionTextFromBelow>
</WeatherState>
</WeatherPattern>