Differences between revisions 7 and 8
Revision 7 as of 2023-10-24 11:09:06
Size: 18244
Editor: fluffy
Comment:
Revision 8 as of 2023-10-24 11:12:23
Size: 18359
Editor: fluffy
Comment: Clarify season number/name
Deletions are marked like this. Additions are marked like this.
Line 26: Line 26:
You can override the weather patterns by modifying the properties stated above. For example, if you want to override the month of June to have a different season, you can set the room's property `weather/month/06` to, say, 10, and then create a new set of weather patterns, e.g.

{{{
lsedit here=weather/season/10/weatherpatterns
You can override the weather patterns by modifying the properties stated above. For example, if you want to override the month of June to have a custom season, you can set the room's property `weather/month/06` to the name of the season (which doesn't have to be a number, despite the MUCK-global setup), and then create a new set of weather patterns, e.g.

{{{
@set here=weather/month/06:plaid
lsedit here=weather/season/plaid/weatherpatterns

How the weather system works

The SpinDizzy weather system, which is contained in the MPI macro {sdweather}, works by mapping the current month to a season, the current day to a weather pattern, and the current hour to a description within the weather pattern.

These properties are kept on the global environment, but theoretically can be overridden on a per-room or sub-environment basis.

The season mapping lives in the property weather/month/%m (e.g. weather/month/03 for March). For example, on the global environment, weather/month/05 (May) is set to season 4 (Spring).

The weather pattern lives in the list at weather/season/{&seasonNum}/weatherpatterns. The specific choice in weather pattern is by a fairly annoying algorithm: 1 + mod(offset + day_of_year*day_of_year, num_patterns), where offset is an arbitrarily-defined weather pattern offset (currently 0) and day_of_year is the day number within the current year (from 1 to 365 most years). It's essentially random (sort of), chosen on a per-day basis.

Once the weather pattern is selected, the time of day is selected using the MPI timesub function, using the environmental _prefs/hoursPerDay property to determine the actual length of the day. This is globally set to 23.

There are a few other MPI macros you can use for local scripting purposes:

  • {sdmorning}: 1 if it's morning, 0 otherwise

  • {sdmidday}: 1 if it's midday, 0 otherwise

  • {sdevening}: 1 if it's evening, 0 otherwise

  • {sdnight}: 1 if it's night, 0 otherwise

  • {sdhours}: The current time of day, in hours (0-23)

  • {sdseconds}: The current time of day, in seconds (0-86399)

Using the weather system

To add the current weather to the description of a room, add {sdweather} to the description.

You can override the weather patterns by modifying the properties stated above. For example, if you want to override the month of June to have a custom season, you can set the room's property weather/month/06 to the name of the season (which doesn't have to be a number, despite the MUCK-global setup), and then create a new set of weather patterns, e.g.

@set here=weather/month/06:plaid
lsedit here=weather/season/plaid/weatherpatterns
.del 1 $
weather/local/plaid
.end

lsedit here=weather/local/plaid
.del 1 $
The sky appears to be a black and navy-blue plaid. It feels like it's approximately 11 PM.
The sky appears to be a black-and-gray argyle with thin silver flecks. It feels like midnight.
Stars shine through the thin sateen film of the sky. It feels like 1 AM or so.
(... and so on ...)
.end

Or, if you would like to use the current SpinDizzy season cycle, you can use seasons 1, 3, and 4 (there is no 2 for some reason), which roughly map to summer, winter, and spring, respectively (although perhaps bizarrely, March is also set to have summer weather).

SpinDizzy global environment

The known global configuration is listed below; however, this is only for your reference and only accurate as of October, 2023.

Seasons per month

Here are how the months of the calendar year map to the SpinDizzy weather season:

  1. season:3
  2. season:3
  3. season:1
  4. season:4
  5. season:4
  6. season:1
  7. season:1
  8. season:1
  9. season:1
  10. season:1
  11. season:3
  12. season:3

Patterns

Here are the patterns available for each season:

Season 1

2006/nightandday

Season 3

2010/frost
2010/frost
2010/frost
2010/snow
2010/snow
2010/snow
2010/snow
2010/snow
2010/frost

Season 4

2011/spring
2006/nightandday
2011/spring
2011/spring
2011/spring
2006/nightandday
2006/nightandday
2011/spring
2011/spring

Weather patterns

Here are the hourly strings for each of the global weather patterns.

2006/nightandday

Bright stars shine in the pitch black sky -- and move, barely fast enough to be noticed, southwest.  It seems around midnight.
Bright stars shine in the pitch black sky -- and move, barely fast enough to be noticed, southwest.  It feels like it's about 1 am.
Low clouds, shining silver in the light of an absent moon, obscure the drifting stars.  It's about 2 am from the way the place feels.
Low clouds, shining silver in the light of an absent moon, obscure the drifting stars.  It feels like 3 am.
Low clouds, shining silver in the light of an absent moon, obscure the drifting stars.  It seems like it's around 4 am.
Stars still shine in the dark western sky, but they fade around the zenith, and the sky turns blue with a ribbon of red on the eastern horizon.  It feels like 5 am.
Stars still shine in the dark western sky, but they fade around the zenith, and the sky turns blue with a ribbon of red on the eastern horizon.  The time's something like 6 am.
Stars still shine in the dark western sky, but they fade around the zenith, and the sky turns blue with a ribbon of red on the eastern horizon.  It's something like 7 am.
Morning clouds dot the cyan sky.  The sun is not clearly visible.  Call it 8 am, 'solar' time.
Morning clouds dot the cyan sky.  The sun is not clearly visible.  It feels like 9 am by the sky.
Morning clouds dot the cyan sky.  The sun is not clearly visible.  It's somewhere around 10 am by how the light moves.
It's a bright 11 am.  While no clouds obstruct the sky neither is there a sun.  
It's a bright noon.  While no clouds obstruct the sky neither is there a sun.  
It's a bright 1 pm.  While no clouds obstruct the sky neither is there a sun.  
Shadows grow eastward, and a light haze obscures the afternoon sky.  It's about 2 pm local time.  
Shadows grow eastward, and a light haze obscures the afternoon sky.  Right now it's around 3 pm effectively.
Shadows grow eastward, and a light haze obscures the afternoon sky.  It feels like about 4 pm.
Poofy and convoluted clouds highlight all manner of reds and oranges to the west; in the east, the stars come out.  It's getting on 5 pm in a sense.
Poofy and convoluted clouds highlight all manner of reds and oranges to the west; in the east, the stars come out.  It's something like 6 pm from how it feels.
Poofy and convoluted clouds highlight all manner of reds and oranges to the west; in the east, the stars come out.  The time's around 7 pm from the sky.
Plenty of stars shine in the early night sky even as they slide southwest.  City lights give the horizon a warm glow, and the sky a dark purple tone.  It feels like 8 pm.
Plenty of stars shine in the early night sky even as they slide southwest.  City lights give the horizon a warm glow, and the sky a dark purple tone.  It seems around 9 pm.
Plenty of stars shine in the early night sky even as they slide southwest.  City lights give the horizon a warm glow, and the sky a dark purple tone.  It seems to be about 10 pm.
Bright stars shine in the pitch black sky -- and move, barely fast enough to be noticed, southwest.  It seems to be about 11 pm, by the sky.

2010/frost

The air feels cold, with a touch of wind in the starry night sky.  It seems to be about 11 pm, by the sky.
The air feels cold in the dim, star-filled night and the wind is picking up.  It seems around midnight.
Bright, shifting stars do little to help the chilly, brisk air.  It feels like it's about 1 am.
Stars shine brightly all over the sky, the star-field slowly shifting in the freezing air.  It's about 2 am from the way the place feels.
Bright, shifting stars light the way in the clear, cold sky.  It feels like 3 am.
Starlight shimmers off of crystalline frost forming on the ground.  It seems like it's around 4 am.
A blanket of frost covers everything in the crisp, still air.  It feels like 5 am.
Ribbons of light begin to form on the horizon, a sign the cold air will soon bite less.  Frost covers everything.  The time's something like 6 am.
Morning light begins to fill the cold sky, revealing a blanket of white frost.  It's something like 7 am.
Bright light completely fills in the cool, sunless sky, illuminating much frost.  Call it 8 am, 'solar' time.
The cold air begins to warm, the frost dissipating.  It feels like 9 am by the sky.
It's cool out, the last of the frost removing itself from view.  It's somewhere around 10 am by how the light moves.
It's cool out, the wind lightly blowing in the clear, sunless sky.  It's a bright 11 am.
It's cool out, the wind blowing a fair amount in the lightly clouded, sunless sky.  It's a bright noon.
It's just warm enough to be comfortable in the windless, clear, and sunless sky.  It's a bright 1 pm.
It's just warm enough to be comfortable, though a cool wind is blowing some clouds across.  It's about 2 pm local time.
It's a little cool out with a light wind.  Small clouds dance across the sunless sky.  Right now it's around 3 pm effectively.
It's cool out, with a very light wind in the cloudless, sunless sky.  It feels like about 4 pm.
The sunless sky slowly turns orange and purple in the cool, still air.  It's getting on 5 pm in a sense.
Brilliant sunset colors wash over the sunless sky in the cold, crisp air.  It's something like 6 pm from how it feels.
Reds and purples dance on the horizon of the sunless sky in the crisp, cold air.  The time's around 7 pm.
Twilight causes stars to just barely peek through, the wind picking up in the cold air.  It feels like 8 pm.
The air chills the landscape under the darkened sky.  It seems around 9 pm.
Cold wind howls through the landscape at night, the starlight really beginning to show.  It seems to be about 10 pm.

2010/snow

Clouds blot out the stars, and the cold wind howls as the snow picks up.  It seems to be about 11 pm, by the sky.
Clouds blot out the stars, and the cold wind howls as the snow picks up.  It seems around midnight.
Patchy clouds blot out some of the bright stars in the still, cold air.  Snow uniformly covers the ground.  It feels like it's about 1 am.
The cold air is still and crisp.  Bright stars illuminate the eerie winter wonderland.  It's about 2 am from the way the place feels.
The cold air is still and crisp.  Bright stars give the snow a dreamy look.  It feels like 3 am.
The cold air is still and crisp.  Stars give the snow a ghostly appearance.  It seems like it's around 4 am.
The cold air is still and crisp.  Ice forms over some of the snow on the ground.  It feels like 5 am.
Clouds obscure some of the light, but the day is dawning over the snowy landscape.  The time's something like 6 am.
Clouds obscure much of the light, most of it reflecting off the snowy landscape.  It's something like 7 am.
Dark clouds begin to dissipate in the brightening sky, yielding to a winter wonderland.  Call it 8 am, 'solar' time.
The bright, sunless sky reflects off the snow in the chilly air.  It feels like 9 am by the sky.
Blinding light seems to come from all directions; pure, white snow covers everything.  It's somewhere around 10 am by how the light moves.
The cold, cloudless sky is brightly lit; pure, white snow is everywhere.  It's a bright 11 am.
The bright, sunless sky shines down on a winter wonderland, doing little to warm it.  It's a bright noon.
The cold air is still, not disturbing the pure, white snow which blankets everything.  It's a bright 1 pm.
The air is cold, but not biting.  The top surface of snow melts just a fraction.  It's about 2 pm local time.
The air almost feels comfortable, but only briefly.  Very thin layers of snow melt.  Right now it's around 3 pm effectively.
Clouds begin rolling over the sky in the cold air, causing the snow blanketing everything to look darker.  It feels like about 4 pm.
Dark grey clouds cover the sky, blocking much of the light.  It's cold out, hardening the snow on the ground.  It's getting on 5 pm in a sense.
Dark grey clouds release snow in the dim sky.  It's something like 6 pm from how it feels.
Snow fills the air as it blankets the cold, darkening landscape.  Dark clouds obscure the sky.  The time's around 7 pm.
It's quite dark out, clouds covering the entire sky.  Snow falls heavily on the cold ground.  It feels like 8 pm.
Clouds blot out the stars and snow falls everywhere.  It seems around 9 pm.
Clouds blot out the stars and snow drifts about in the wind as it falls.  It seems to be about 10 pm.

2011/spring

The air is pleasantly cold, and Spengolight reflects from dewdrops on the grass.  it's 11:00 PM.
Stars shine in the inky sky, so bright and think we could be sailing through a shimmering sea.  The wind blows through the shining midnight.
Leaves rustle in a gentle breeze, cold enough to make you shiver.  It's 1:00 AM.
The air is sweet with the taste of moisture, while the chirps and scurryings of insects provide a soundscape to the new leaves, buds, and closed flowers.  Spengo is low in the sky, call it 
2:00 AM.
A faint hint of false dawn appears in the eastern sky, softened to just above imagination by a mist in the air.  The time is 3:00 AM.
The sky is dark again, no moon, no faux-sunlight, and something has even blocked out the stars.  The world is blanketed in darkness and it's four in the morning.
Light begins to return, mostly in the east, but a soft pinkish-gold paints the horizon in every direction.  It's still dark straight up, but the 5:00 AM dawn is bringing in the day.
The daylight is upon us, dim still, and grey clouds block out the sky.  Even if there were a sun, it would be invisible.  It's 6:00 AM.
Birds have started to sing, and the grey clouds covering the sky are concealing a stronger light.  The first flower opens when it hits 7:00 AM.
A soft wind, cool, but just warm enough to be stimulating rather than chilling blows, carrying a soft scent of rain to come.  The grey skies make it hard to pick a time, but it could be 
around 8:00 AM.
Rain starts, gradually at first, barely perceptible as a fine spray.  Visually, it's hard to resolve it as drops rather than a mist.  The time is 9:00 AM.
The rain seems to have grown stronger, with heavy (but infrequent) drops plainly felt.  They play on windows and rooftops, or more fuzzily on leaves and grass.  It's 10:00 AM.
The rain continues falling, the ground drinking in a promise of May flowers to come.  It's a delightful but damp 11:00 AM.
The world hits its peak of brightness, and noon starts to chase the rain away.  The drops are more infrequent and the air has warmed some.
The rain has almost stopped, and a warm wind blows from the south.  The thinning clouds allow the 1:00 PM light to shine.
The clouds are white and puffy, huge rifts allowing in shafts of brilliance, seeming outlined in the air by a lingering mist.  It's 2:00 PM.
The clouds and mist are banished by the 3:00 PM light, remaining moisture from the rain sparkles in curved leaves and clinging to the ends of stems.
The southern wind dries the world, the moist soil and sweetly humid air the only remnants of the rain before.  The fading light seems appropriate to 4:00 PM.
A few clouds have returned, low in the sky.  Seeming placed there to give colour to the retreating light.  It's still too bright to be evening, making it about 5:00 PM.
More clouds fill the sky, casting shadows over patches of the ground and colouring the fading light.  It's still warm, but the temperature has clearly dropped now that it's hit 6:00 PM.
The world is in twilight, the only natural illumination coloured and diffuse from fieldlight scattered through wispy clouds.  It's 7:00 PM.
A Zephyr blows, carrying the heat away with it.  The air starts to cool rapidly as the twilight fades away.  The night is just starting at 8:00 PM.
Spengo is on the horizon, rising to light the night.  The spring night has a snappy chill of excitement and living things stirring after the winter.  It's 9:00 PM.
Dew condenses from the cold air, covering leaf and blade alike, obvious to any bare step.  Spengo moves higher in the sky, at about the right angle for 10:00 PM.

Weather debugging object

Here is how to make a "weatherball" which gives you the ability to inspect the SpinDizzy weather system.

@create weatherball
@desc weatherball=You see a little snow globe which reflects the current weather. You can 'weather show' to see more about it.
@action weather show=weatherball
@link weather show=$nothing
@succ weather show={if:{&arg},{lexec:mpi/{sublist:{&arg},1,1, },this},{list:usage,this}}
lsedit weather show=usage
.del 1 $
Usage:
 
weather show now
    Shows the current month, season, and pattern
 
weather show seasons
    Shows the way that months map to season numbers
 
weather show patterns [seasonNum]
    Lists the patterns in use by the given season number
 
weather show list [patterns]
    Lists the strings given by a given pattern
.end

lsedit weather show=mpi/now
.del 1 $
{with:seasonNum,{prop:weather/month/{ftime:%m,{tzoffset},{secs}} },Season: {&seasonNum}\r
    {with:numChoices,{prop:weather/season/{&seasonNum}/weatherpatterns#},numChoices: {&numChoices}\r
    offset: {prop:weather/offset}\r
        {with:patternNum,{add:1,{mod:{add:{eval:{prop:weather/offset}},{with:day,{ftime:%j,{tzoffset},{secs}},{mult:{&day},{&day}} }},{&numChoices}} },
            patternNum: {&patternNum}\r
            {with:weatherProp,{prop:weather/season/{&seasonNum}/weatherpatterns#/{&patternNum}},
                weatherProp: {&weatherProp} ({prop:{&weatherprop}#} entries)\r
                Current weather: {timesub:{mult:{prop:_prefs/hoursPerDay},60,60},0,{&weatherProp}}\r
            }
        }
    }
}
There are {prop:_prefs/hoursPerDay} hours per day.
.end

lsedit weather show=mpi/seasons
.del 1 $
{for:month,1,12,1,{tell:month:{&month} season:{prop:weather/month/{right:{&month},2,0}} }}
.end

lsedit weather show=mpi/patterns
.del 1 $
{with:seasonNum,{sublist:{&arg},2,2, },seasonNum:{&seasonNum}\r
{prop:weather/season/{&seasonNum}/weatherpatterns#} patterns:\r
{list:weather/season/{&seasonNum}/weatherpatterns}
}
.end

lsedit weather show=mpi/list
.del 1 $
{with:weatherProp,{sublist:{&arg},2,2, },weatherProp:{&weatherProp}\r
{with:count,{prop:{&weatherprop}#},{&count} patterns:\r
{list:{&weatherProp}}
}
}
.end

WeatherSystem (last edited 2023-10-24 11:12:23 by fluffy)