18 Feb, 2008, goran wrote in the 1st comment:
Votes: 0
Greetings,

I have added the very beginnings of a Temperature system to my game.
Right now it pretty much just saves a min and max temperature in each
area file. I know what I would like to do with this for starters just not sure
about how to get it done. Also maybe some insight and advice on the
matter.

Each area has a min and max temperature and I want to take those
two numbers and get a random from them. This would be that area's
current temperature. Maybe during the area's reset period or after so many
ticks? I would like to adjust that random number abit based on night and day
and perhaps sector(desert, hills, city, tundra, etc).

Any ideas or help are welcome :) just not sure where to start in the code
18 Feb, 2008, KaVir wrote in the 2nd comment:
Votes: 0
If you're using some sort of wilderness or overland system, then you might want to consider tying the temperature to that - otherwise it'll seem rather odd for the temperature to suddenly leap from one extreme to the other as you move between areas.

You could also try basing the temperature on the current season, rather than just a random number between min and max.

What do you plan to use the temperature for? Will you have lakes freezing in the winter so that people can walk on them? Will the distinction between rain and snow be defined by the temperature system? What about dynamic descriptions to reflect settled snow, etc? Will clothing have a 'warmth' rating for protecting the covered parts from frostbite and such?
19 Feb, 2008, goran wrote in the 3rd comment:
Votes: 0
I do not have a wilderness or overland system. After I posted this question I did think of
a few things some of which you mentioned.

Clothing would have some sort of 'rating' in a very hot part of the game wearing heavy armor
might tax the player forcing them to locate armor that would be better suited for that temperature.
This would cover things like heat stroke, frostbite, etc.

I would like to rewrite the weather system to include the use of temperature. I believe the
stock weather system is lacking..so maybe a rewrite is in order.

Thank you KaVir for your input!

Back to the drawing board :)
19 Feb, 2008, drrck wrote in the 4th comment:
Votes: 0
You can come up with some fairly simple formulae for generating temperatures based on geographic location, what day of the year, what time of day, and any current weather systems (if you have weather implemented somehow).

The easiest way to do so would be to start with a geographical average temperature. For example, Earth ranges from -50F to 90F, depending on geographic location, with a pretty symmetric distribution from cap to cap (cold to hot to cold again). This deviation very closely resembles a negative cosine curve, so you could use avg_tmp = -100 * cos ( y_coord ) or something to that effect.

You could also add a seasonal modifier. Earth differs a lot based on region, but on average, the average temperature differences for the seasons are spring/autumn = summer - 5F, and winter = summer - 10F. This deviation is a sine curve, so maybe something like avg_tmp += 10 * ( sin ( season ) + ( .25 * pi ) ).

After that, you can add a daylight modifier, which will be another cosine curve.

And finally, you can add miscellaneous modifiers, such as whether or not you're indoors, near a fire, etc., as well as factor in weather systems that drastically affect temperature. Note that after generating the average temperatures via the methods above, you can also dynamically create ranges (they will be more extreme at the caps/equator, and during summer/winter). Once you have logically sound ranges, you can then grab your random number generator to figure out the precise temperature at any given place at any given time.
20 Feb, 2008, Conner wrote in the 5th comment:
Votes: 0
drrck said:
For example, Earth ranges from -50F to 90F, depending on geographic location, with a pretty symmetric distribution from cap to cap (cold to hot to cold again). This deviation very closely resembles a negative cosine curve, so you could use avg_tmp = -100 * cos ( y_coord ) or something to that effect.

You could also add a seasonal modifier. Earth differs a lot based on region, but on average, the average temperature differences for the seasons are spring/autumn = summer - 5F, and winter = summer - 10F. This deviation is a sine curve, so maybe something like avg_tmp += 10 * ( sin ( season ) + ( .25 * pi ) ).

After that, you can add a daylight modifier, which will be another cosine curve.

And finally, you can add miscellaneous modifiers, such as whether or not you're indoors, near a fire, etc., as well as factor in weather systems that drastically affect temperature. Note that after generating the average temperatures via the methods above, you can also dynamically create ranges (they will be more extreme at the caps/equator, and during summer/winter). Once you have logically sound ranges, you can then grab your random number generator to figure out the precise temperature at any given place at any given time.

Hmm, very interesting methodology, and probably more than adequate for most games in general.. but I gotta ask, are you living on the same Earth as me? Winter where I live is way colder than summer - 10F, frankly, even spring/autumn = summer - 5F would be a VERY mild spring/autumn seriously pushing unseasonably warm. And I live in the nice temperate United States in a little place called Virginia, but I've also lived in quite a few other parts of the U.S. and found the same to be largely true in all of them. We won't even get into the real extremes (Death Valley, the various deserts of the world, Antarctica, etc) because you did mention that the temps would be more extreme at the caps/equator, though I would posit that there are some other localities that get pretty far from the median as well.
20 Feb, 2008, KaVir wrote in the 6th comment:
Votes: 0
Conner said:
Winter where I live is way colder than summer - 10F, frankly, even spring/autumn = summer - 5F would be a VERY mild spring/autumn seriously pushing unseasonably warm.


Where I live (Munich), the average temperature is around 30°F in January and 70°F in July, with extremes as high as 97°F and as low as -16°F. That's the sort of range I'd be looking at if I wanted locations in the mud world which were both hot in summer and cold in winter.

Personally I've not bothered explicitly implementing temperature, because it's pretty much irrelevant to my setting, but I do make the assumption that summer is hot and winter is cold from a purely cosmetic standpoint (not just for the dynamic descriptions, but also for the clothing worn by villagers).
20 Feb, 2008, drrck wrote in the 7th comment:
Votes: 0
Conner said:
Hmm, very interesting methodology, and probably more than adequate for most games in general.. but I gotta ask, are you living on the same Earth as me? Winter where I live is way colder than summer - 10F, frankly, even spring/autumn = summer - 5F would be a VERY mild spring/autumn seriously pushing unseasonably warm. And I live in the nice temperate United States in a little place called Virginia, but I've also lived in quite a few other parts of the U.S. and found the same to be largely true in all of them. We won't even get into the real extremes (Death Valley, the various deserts of the world, Antarctica, etc) because you did mention that the temps would be more extreme at the caps/equator, though I would posit that there are some other localities that get pretty far from the median as well.


I noted that my figures were averages. There are tons and tons of places on Earth where seasonal differences are (very close to) nil, and also, as you posited, lots where they are much greater. The average of these averages is winter = summer - 10F and spring/autum = summer - 5F, though. Note that this is just the difference created by seasons, and excludes other factors, which can affect temperature differences much more than seasons do. I think you're under the impression that because the average temperature where you live is X during winter and Y during the summer that the seasonal difference is X - Y, but it's not that simple. Average temperature during a season is affected by far more than seasonal difference (which really only amounts to the difference caused by the tilt of the Earth). Discrepancies in seasonal averages could be affected by ocean currents, precipitation, etc. - all of which may happen during particular seasons, but are not related to what a season actually is.

Anyway, I was trying to give the most simplistic possible way of going about such a system. Obviously there are many "better" ways that would give more accurate temperatures, but would be exponentially harder to implement and pretty much outside the scope of a MUD ;)
20 Feb, 2008, syn wrote in the 8th comment:
Votes: 0
I wish I lived in one of those average of average areas.

0-30f at winter time kinda sucks :D

Though… so does 70-95f or so in the summer, ah well.

-Syn
20 Feb, 2008, David Haley wrote in the 9th comment:
Votes: 0
Out of curiosity, drrck, what are your sources for those temperature figures?
20 Feb, 2008, syn wrote in the 10th comment:
Votes: 0
Id be curious to know as well.

I cant imagine that the equatorial areas would bring the average down that far. /shrug

-Syn
20 Feb, 2008, Hades_Kane wrote in the 11th comment:
Votes: 0
I live in Louisiana.

The other day, we had temperatures in the teens (the high being in the 30s)

A few days later, we were hitting temps in the 80s.

When you are averaging, though, you lose those extremes.
20 Feb, 2008, syn wrote in the 12th comment:
Votes: 0
Thats true, but the average for the season of winter and for summer is generally much different in my home state and across much of the US. Take Alamosa CO for example. in Winter it averages temps of 19F, and summer of 64F or so. That is much wider then a 10F gap.

The short term gains and losses were not what I was talking about, but the actual average of the season, from almost every state I have been in is nowhere near a 10F gap.

Though, the extreme of 80F would still skew the average data, as it is another point, though given enough days in a season its impact should be less then if it was say, the average of 5 days.

-Syn
20 Feb, 2008, drrck wrote in the 13th comment:
Votes: 0
syn said:
Thats true, but the average for the season of winter and for summer is generally much different in my home state and across much of the US. Take Alamosa CO for example. in Winter it averages temps of 19F, and summer of 64F or so. That is much wider then a 10F gap.

The short term gains and losses were not what I was talking about, but the actual average of the season, from almost every state I have been in is nowhere near a 10F gap.

Though, the extreme of 80F would still skew the average data, as it is another point, though given enough days in a season its impact should be less then if it was say, the average of 5 days.

-Syn


I explained this earlier. The difference between the average temperature in winter and the average temperature in summer is not the same as the seasonal difference due to the tilt of the Earth (which is relatively small compared to what you're talking about). There are a lot of other factors to consider - weather, ocean currents, latitude, etc.

Interestingly enough, temperature differences like you're talking about are actually more severe in the "temperate" climates than at the extremes (caps/equator). Antarctica's average summer temperature and winter temperature only differ by ~40F.
20 Feb, 2008, KaVir wrote in the 14th comment:
Votes: 0
DavidHaley said:
Out of curiosity, drrck, what are your sources for those temperature figures?


I'd also be interested to see this source, because +/-10 °F sounds way off.

drrck said:
Antarctica's average summer temperature and winter temperature only differ by ~40F


http://en.wikipedia.org/wiki/Vostok,_Ant...

"During the long winter, temperatures average about -65 °C (-85 °F); in the brief summer, about -30 °C (-25 °F)".
20 Feb, 2008, David Haley wrote in the 15th comment:
Votes: 0
It's kind of funny to say that the tilt of the Earth isn't the only factor and then go on to cite latitude as a factor… :wink: Anyhow, I'm still curious to hear what your source is for this data. (I'm not disputing it, I'm just trying to figure out where you got it.)

Incidentally, people shouldn't be considering just the USA when trying to see if these figures make sense; the USA is just one place in a fairly big world, after all. Besides, as drrck said, the measures are averages of averages, which means that you're taking averages over the averages of all the places in the world. (Whether or not you accept that data would depend on where the data comes from, though, hence why I asked about the sources.)
20 Feb, 2008, syn wrote in the 16th comment:
Votes: 0
I wasnt replying to your statement with that. It was to the post above it.

Lat does play a role, thats correct, as does the tilt which is the largest reason for a seasonal temperature change. I.e. summer, and winter. So the seasonal difference in averages for Alamosa CO is roughly 40F, where I live in MA its a bit less then that.

That was all I was saying. I understand you were trying to be simplistic, but a flat 10F seasonal variance i do not see as being the case, so originally was just wonderin where ya got the data :)

-Syn
21 Feb, 2008, Conner wrote in the 17th comment:
Votes: 0
I had fully noted that he was talking about averages, and later even corrected himself to say averages of averages, but I am still inclined to think that his data is incorrect. Either way, I still stand by what I said earlier, it is an interesting approach to the issue at hand and might well be very valid data for a given mud's world. I just don't believe that it's correct for the world I live in in real life. As for not considering just the U.S., okay David, I've traveled to many other places and can use the internet as a resource for further data, but I have a great deal of trouble collaborating his numbers no matter where I seem to go. Perhaps if he'd answer the direct question you asked of where he had gotten his data, we'd all be "in the know".
21 Feb, 2008, David Haley wrote in the 18th comment:
Votes: 0
Indeed, answering the sources question would be easiest. KaVir provided a source giving contrary data for at least the pole; even though it's Wikipedia, at least it's something.

The only way I can find for the averages to kind-of make sense is that the equatorial region is the largest on Earth, and therefore the surface area there is greater than elsewhere; the equator has relatively small temperature variations across seasons, and so that might be skewing the average. Still, there is more to the Earth than just the equator, and the differences are substantial elsewhere…
21 Feb, 2008, drrck wrote in the 19th comment:
Votes: 0
KaVir said:
http://en.wikipedia.org/wiki/Vostok,_Ant...

"During the long winter, temperatures average about -65 °C (-85 °F); in the brief summer, about -30 °C (-25 °F)".


Vostok is the coldest place on Earth. You can't pick the coldest spot (which has a record low of some -120F or something absurd) and say that the average temperatures there are indicative of the whole continent.
21 Feb, 2008, drrck wrote in the 20th comment:
Votes: 0
DavidHaley said:
It's kind of funny to say that the tilt of the Earth isn't the only factor and then go on to cite latitude as a factor… :wink: Anyhow, I'm still curious to hear what your source is for this data. (I'm not disputing it, I'm just trying to figure out where you got it.)


The tilt of the Earth and latitude are two different factors (although they share a lot of similarities). The easiest way to explain is to point out that the southern hemisphere is colder (on average) than the northern hemisphere, even though both get equal sunlight exposure over the course of a year.
0.0/41