1999Q4/
<!-- MHonArc v2.4.4 -->
<!--X-Subject: [MUD&#45;Dev] weather -->
<!--X-From-R13: [nggurj [vunyl <qvnoybNorfg.pbz> -->
<!--X-Date: Mon, 11 Oct 1999 10:36:16 &#45;0700 -->
<!--X-Message-Id: Pine.BSF.4.10.9910090148130.28352&#45;100000#shell9,ba.best.com -->
<!--X-Content-Type: text/plain -->
<!--X-Head-End-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title>MUD-Dev message, [MUD-Dev] weather</title>
<!-- meta name="robots" content="noindex,nofollow" -->
<link rev="made" href="mailto:diablo#best,com">
</head>
<body background="/backgrounds/paperback.gif" bgcolor="#ffffff"
      text="#000000" link="#0000FF" alink="#FF0000" vlink="#006000">

  <font size="+4" color="#804040">
    <strong><em>MUD-Dev<br>mailing list archive</em></strong>
  </font>
      
<br>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
<br clear=all><hr>
<!--X-Body-Begin-->
<!--X-User-Header-->
<!--X-User-Header-End-->
<!--X-TopPNI-->

Date:&nbsp;
[&nbsp;<a href="msg00029.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00032.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Thread:&nbsp;
[&nbsp;<a href="msg00037.html">Previous</a>
&nbsp;|&nbsp;<a href="msg00036.html">Next</a>
&nbsp;]
&nbsp;&nbsp;&nbsp;&nbsp;
Index:&nbsp;
[&nbsp;<A HREF="author.html#00028">Author</A>
&nbsp;|&nbsp;<A HREF="#00028">Date</A>
&nbsp;|&nbsp;<A HREF="thread.html#00028">Thread</A>
&nbsp;]

<!--X-TopPNI-End-->
<!--X-MsgBody-->
<!--X-Subject-Header-Begin-->
<H1>[MUD-Dev] weather</H1>
<HR>
<!--X-Subject-Header-End-->
<!--X-Head-of-Message-->
<UL>
<LI><em>To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Subject</em>: [MUD-Dev] weather</LI>
<LI><em>From</em>: Matthew Mihaly &lt;<A HREF="mailto:diablo#best,com">diablo#best,com</A>&gt;</LI>
<LI><em>Date</em>: Sat, 9 Oct 1999 01:56:00 -0700 (PDT)</LI>
<LI><em>Reply-To</em>: <A HREF="mailto:mud-dev#kanga,nu">mud-dev#kanga,nu</A></LI>
<LI><em>Sender</em>: <A HREF="mailto:mud-dev-admin#kanga,nu">mud-dev-admin#kanga,nu</A></LI>
</UL>
<!--X-Head-of-Message-End-->
<!--X-Head-Body-Sep-Begin-->
<HR>
<!--X-Head-Body-Sep-End-->
<!--X-Body-of-Message-->
<PRE>
Hi everyone. I'm wondering if any of you have good weather systems in your
game, and if so, how it works. Achaea's weather "system" at the moment is
a pile of crap, and I've designed a new one. I'm hoping that you all can
suggest some improvements. I'm reasonably happy with my design, but there
is definitely room for improvement.

I've included my design notes below, though the design isn't complete. I'm
mainly interested in a) criticism of my formulas to determine
temperature, wind, and humidity, and b) my system of generating storms. 

If anyone has any good criticism, I'd appreciate hearing it. (Note that I
just copied and pasted from my notes to my coders, so ignore any specific
details.)

Weather design:


Each area in the game will have the following data associated with
weather:

Base Temperature (base_temp) (in degrees F)
Base Humidity (base_humid) (1-100)
Base Wind (base_wind) (1-infinite, though 100 is considered
hurricane-force winds)

   The above three statistics indicate a sort of average for those
factors, for that area. They are the points towards which the "current"
equivalents (see directly below) statistics will gravitate towards, by
virtue of some formulas I've come up with.

Current Maximum Temperature (current_max_temp) (in degrees F) (This is the
maximum
  temperature at approximately 3 pm. It's assumed that as you move away
from 3
  pm in either direction in time, the day gets cooler, generally speaking)
Current Actual Temperature (current_temp) (in degrees F) (This is the
current_max_temp modified for time of day and humidity. The higher the
humidity, the more heat the air retains)
Current Humidity (current_humid) (1-100)
Current Wind (current_wind) (1-infinite)


Beta (beta) (indicates how sensitive the area is to overall weather
change. Practically speaking, the higher the beta, the bigger swings in
weather. Chicago would have a large beta, for instance, whereas Death
Valley or the Arctic would have a low beta. A beta of 100 (100%) indicates
that the area will tend to change exactly with the weather front. A beta
of 1% indicates that an area will be hardly affected at all by continental
fronts or time of year. A beta of 200% would be somewhere like chicago,
where the weather swings wildly from season to season, and with various
atmospheric conditions)


The "base" factors will bet set by me, and we will need the following
commands to deal with setting and looking at area weather data:

WEATHER &lt;area short name&gt; &lt;statistic&gt; &lt;value&gt;. Make this performable by
coders only.

If the final two fields are omitted, then the WEATHER verb should just
display all the stats for an area. Incidentally, the replica that hold the
information for an area are held in data 23 in a room.

WEATHER FRONTS

Approximately every 2 hours (don't make it exactly two hours, make it like
an hour and 51 minutes, for instance, to spread loads), a new weather
front system will begin affecting each continent. There's only one
continent right now, but it'd probably be good if this was coded in order
to work with multiple continents. How a weather front is determined will
be detailed further below in this document. However, each weather front
will have the following stats:

Temperature modifier
Humidity modifier
Wind modifier

These modifiers will be applied to the current weather in a location with
the formulas I'll include below.


APPLYING WEATHER FRONTS TO CURRENT WEATHER IN A LOCATION

This is the core of the weather system. Every minute, check all the areas
in the game. For each area, do a random(45). If the result is 1, then the
below formulas will be applied to change the current temperature,
humidity, and wind in a location. 

First, I will explain how temperature is determined. Temperature is a
combination of the following factors:

Beta, that continent's weather front, base temperature, current
temperature, current humidity, time of year, and time of day.

The idea behind the formula is to allow temperature to vary within an
area, but to tend towards the base_temperature for the area, modified by
time of year and time of day.

The weather_diverge variable is set to 20 by me. It determines how far
away from the basepoint temperatures can freely swing before force is
exerted on the calculation. 

The front_temp_mod variable is how many degrees + or - F that the front
has (yes, I know this isn't realistic in the sense that it makes all areas
on the continent vary somewhat in the same direction, but the formulas are
complicated enough so that it shouldn't really be too noticeable)

The month_mod variable is the modifier in degrees C for the month. The
months and their corresponding constants are:
1: -30
2: -20
3: -10
4: 0
5: 10
6: 20
7: 30
8: 20
9: 10
10: 0
11: -10
12: -20


The distance_from_3pm will be a number 1-30. Our days are 1 hour long, and
the day is advanced every minute. 3 pm is 37.5, so just use 38 as the high
point of the day, temperature-wise. thus, if the day counter was 28,
distance_from_3pm would be 10. If the day counter was 1, then
distance_from_3pm would be 22. It can never be negative.

The formula is:

var=((beta*front_temp_mod/100)+current_temp - base_temp)
If var is negative, change it to positive.

modifier=weather_diverge/var

current_max_temp=((modifier*(beta*front_temp_mod)+current_max_temp)+(beta*month_mod)*random(.85-1.15)

current_temp=current_max_temp-((distance_from_3pm*2)*(100-current_humidity)). 

The current_actual_temp can have some other modifiers, and needs to be
calculated on the fly.

From day counter 48 to 11, inclusive, the current_temp will be
random(5-10) degrees lower. This is to represent that the direct radiation
from the sun contributes to warming during the day.

If the current weather conditions are light clouds, drop temperature
random(2-4) degrees. If current weather conditions are heavy clouds
(necessary for any sort of precipitation), then drop temperature
random(4-6 degrees) (more about these issues below).

That, then is how temperature is determined. I will design the effects of
weather on players later, and will probably use heat indexes so that
players are more affected by wet heat than dry heat.

DETERMINING HUMIDITY

The principle behind humidity is much the same as behind temperature, but
it's a simpler formula. You modify current humidity in two conditions:

1) if it is to be affected by a weather front (remember, every minute,
1/45 chance of this)
2) periodically during precipitation


Formula for when it needs to be affected by a weather front:

var=((beta*front_mod)+current_humid-base_numid)
if var is negative, make positive

modifier=weather_diverge/var

current_humid=(mod*(beta*front_humid_mod)+current_humid)

The second way of changing humidity will be dealt with under the
precipitation section.

WIND

The formula for determining how much the wind in an area is currently
blowing (not adding in direction. Too complicated and artificial seeming
considering there aren't exits from every direction in every room, even
while flying in the air) is:

var=((beta*front_mod)+current_wind-base_wind)
if var is negative, make positive

modifier=weather_diverge/var

current_wind=(modifier*(beta*front_wind_mod)+current_wind)


WEATHER CONDITIONS AND PRECIPITATION

If, during a weather front change, the temperature drops more than 20
degrees from the max temp for that day, and the temperature is still above
32, then we get fog. The practical effects of fog are that you cannot see
adjacent locations with glance or squint. Have fog in an area last random
10-25 minutes.  Remember that room flag 59 means that the room is
permanently fogged.

Precipitation works as follows:

Weather goes in the following order:
clear skies
light clouds
heavy clouds
drizzle/flurries
Light rain/light snow
Heavy rain/heavy snow
Downpour/blizzard

If the current temp is below 32, then precipitation will be of the snow
variety. 

Every minute, all the areas will be cycled through. The chance of going
either up or down a level of weather is the beta for that area. If it is
going to change, then the chance that it will move UP a level is the
current humidity of the area. (if it's at clear skies, it can't go down,
and if it's at downpour/blizzard, it can't go up). If it's going to change
and doesn't move up, it will move down.

During precipitation, humidity will be lowered as follows:
Every 5 minutes of drizzle: -1
Every 5 minutes of light rain: -2
Every 5 minutes of heavy rain: -3
Every 5 minutes of downpour: -4

Precipitation will stop, and things will revert to heavy clouds when
precipitation reaches the base humidity for that area.


That's the rudimentary design then. I have to write messages for a)
changing weather conditions, b) sentences describing weather conditions
that will be pre-pended to outdoor rooms descriptions, and c) periodic
'atmospheric' messages reflecting the current weather.

--matt




_______________________________________________
MUD-Dev maillist  -  MUD-Dev#kanga,nu
<A  HREF="http://www.kanga.nu/lists/listinfo/mud-dev">http://www.kanga.nu/lists/listinfo/mud-dev</A>

</PRE>

<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<HR>
<ul compact><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><A NAME="00057" HREF="msg00057.html">Re: [MUD-Dev] weather</A></strong>
<ul compact><li><em>From:</em> Greg Miller &lt;gmiller#classic-games,com&gt;</li></ul>
<li><strong><A NAME="00036" HREF="msg00036.html">Re: [MUD-Dev] weather</A></strong>
<ul compact><li><em>From:</em> Mik Clarke &lt;mikclrk#attglobal,net&gt;</li></ul>
</UL></LI></UL>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<UL>
<LI>Prev by Date:
<STRONG><A HREF="msg00029.html">Re: [MUD-Dev] Algorithms for an Infinite Universe</A></STRONG>
</LI>
<LI>Next by Date:
<STRONG><A HREF="msg00032.html">Re: [MUD-Dev] Alternate Character Sets (Telnet Question)</A></STRONG>
</LI>
<LI>Prev by thread:
<STRONG><A HREF="msg00037.html">Re: [MUD-Dev] Dan Kegel: A few notes on writing multiplayer games</A></STRONG>
</LI>
<LI>Next by thread:
<STRONG><A HREF="msg00036.html">Re: [MUD-Dev] weather</A></STRONG>
</LI>
<LI>Index(es):
<UL>
<LI><A HREF="index.html#00028"><STRONG>Date</STRONG></A></LI>
<LI><A HREF="thread.html#00028"><STRONG>Thread</STRONG></A></LI>
</UL>
</LI>
</UL>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
<ul><li>Thread context:
<BLOCKQUOTE><UL>
<LI><STRONG>Re: [MUD-Dev] Affect of personalizing cannon fodder mobs</STRONG>, <EM>(continued)</EM>
<ul compact>
<ul compact>
<LI><strong><A NAME="00059" HREF="msg00059.html">Re: [MUD-Dev] Affect of personalizing cannon fodder mobs</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Thu 14 Oct 1999, 18:36 GMT
</LI>
</ul>
</ul>
</LI>
<LI><strong><A NAME="00034" HREF="msg00034.html">[MUD-Dev] Interesting little discussion going on at /.</A></strong>, 
Nathan F Yospe <a href="mailto:yospe#hawaii,edu">yospe#hawaii,edu</a>, Mon 11 Oct 1999, 21:29 GMT
<LI><strong><A NAME="00033" HREF="msg00033.html">[MUD-Dev] Dan Kegel: A few notes on writing multiplayer games</A></strong>, 
J C Lawrence <a href="mailto:claw#varesearch,com">claw#varesearch,com</a>, Mon 11 Oct 1999, 18:31 GMT
<UL>
<li>&lt;Possible follow-up(s)&gt;<br>
<LI><strong><A NAME="00037" HREF="msg00037.html">Re: [MUD-Dev] Dan Kegel: A few notes on writing multiplayer games</A></strong>, 
Bruce Mitchener, Jr. <a href="mailto:bruce#puremagic,com">bruce#puremagic,com</a>, Mon 11 Oct 1999, 21:29 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00028" HREF="msg00028.html">[MUD-Dev] weather</A></strong>, 
Matthew Mihaly <a href="mailto:diablo#best,com">diablo#best,com</a>, Mon 11 Oct 1999, 17:36 GMT
<UL>
<LI><strong><A NAME="00036" HREF="msg00036.html">Re: [MUD-Dev] weather</A></strong>, 
Mik Clarke <a href="mailto:mikclrk#attglobal,net">mikclrk#attglobal,net</a>, Mon 11 Oct 1999, 21:29 GMT
<UL>
<LI><strong><A NAME="00039" HREF="msg00039.html">Re: [MUD-Dev] weather</A></strong>, 
Matthew Mihaly <a href="mailto:diablo#best,com">diablo#best,com</a>, Mon 11 Oct 1999, 22:03 GMT
</LI>
</UL>
</LI>
<LI><strong><A NAME="00057" HREF="msg00057.html">Re: [MUD-Dev] weather</A></strong>, 
Greg Miller <a href="mailto:gmiller#classic-games,com">gmiller#classic-games,com</a>, Thu 14 Oct 1999, 18:12 GMT
<UL>
<LI><strong><A NAME="00086" HREF="msg00086.html">Re: [MUD-Dev] weather</A></strong>, 
Matthew Mihaly <a href="mailto:diablo#best,com">diablo#best,com</a>, Mon 01 Nov 1999, 18:38 GMT
</LI>
</UL>
</LI>
</UL>
</LI>
</UL></BLOCKQUOTE>

</ul>
<hr>
<center>
[&nbsp;<a href="../">Other Periods</a>
&nbsp;|&nbsp;<a href="../../">Other mailing lists</a>
&nbsp;|&nbsp;<a href="/search.php3">Search</a>
&nbsp;]
</center>
<hr>
</body>
</html>