ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/doc/Developers/weather
Revision: 1.2
Committed: Thu Sep 7 21:42:52 2006 UTC (17 years, 8 months ago) by pippijn
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
State: FILE REMOVED
Log Message:
Moved documents to doc/historic

File Contents

# Content
1 $Id$
2 Guide to basic crossfire weather system:
3
4 1) As a DM, how do I turn on the weather?
5
6 In your settings file, there are a few settings that affect weather. To
7 turn on weather, you must turn on the worldmap* settings. Simply
8 uncomment them, and leave them as the defaults. Second, you want to set
9 dynamiclevel to something you are happy with:
10
11 Dynamiclevel:
12
13 0) No weather.
14 1) Weather happens, players are affected, but there are no visual cues.
15 2) Weather creates visual effects on the map, like puddles, rain, fog, etc.
16 3) Weather creates items on the map, like herbs, flowers, apples in
17 trees, etc. Possibly trees defoliate in the winter, etc.
18 4) Rivers and lakes will appear as a product of rainfall, snowmelt.
19 5) The map will be entirely dynamic. Trees and deserts will appear
20 depending on the weather conditions in those areas.
21
22 When you first start the weather system, it will generate all the basic
23 maps for the weather. These maps are located in your var directory.
24 Each map will contain data for the world on things like elevation,
25 humidity, sky conditions, temperature, etc. The initial generation of
26 the elevation, water and humidity maps takes about 30 minutes on a fast
27 machine. You will only have to suffer through this once, unless you
28 delete one of those maps. If you delete one, it is advised to delete all
29 three of those, as they are generated in one pass. If you feel some part
30 of the weather has gone out of control, you can delete the maps at any
31 time, and regenerate them at startup.
32
33 As the game sits idle, it will slowly process the worldmap, adding
34 weather. For a newly started server, this can lead to blockiness in the
35 weather. It is advised that you set the fastclock setting to 1, and run
36 the game for an hour or two (without players), to let the weather smooth
37 out. As it runs, it will depost overlay maps of the world in
38 var/maps/world. When you have 900 of these, it has made one pass. It's
39 not advised to run the game in fastclock mode normally.
40
41 If you want to see the weather visually, compile the "maps" program in
42 the utils directory. (gcc -o maps maps.c). Go to your var directory,
43 and run it there. It will process your *map files, and generate ppm's
44 you can look at, to see the weather formations.
45
46
47 2) How does the weather work?
48
49 There are two types of things in the weather system. Computed values,
50 and random values.
51
52 Pressure is the only random value.
53
54 The world is divided into a 100x100 grid of "weathermap squares" (WM). Each
55 square is computed every game hour.
56
57 The game computes humidity by looking at the amount of water in the
58 current WM. It then compares the pressure of nearby squares, to compute
59 wind direction and speed. Humidity is pushed to nearby squares, via the
60 wind. The temperature is mostly static, but is computed by the distance
61 from the poles (NW and SE corners of the map) and the current season. In
62 addition, the elevation of the area is taken into effect, as is
63 windspeed. The equator moves up and down the map, as the seasons change,
64 to simulate a reverse season for north and south hemispheres.
65
66 Once the game has all of these values, it compares them against
67 eachother, and computes the sky conditions for the current WM. After
68 computing the sky conditions, the game then performs the actual changes
69 (if any) to the maps.
70
71 Changes to the map occur under two conditions: 1) The map was entered
72 by a player. 2) The game loads and saves 1 tile per game hour, slowly
73 moving across the world.
74
75 3) I want to make a special snow to cover "some arch".
76
77 Look at the table at the beginning of weather.c. Add your special snow,
78 and the name of the arch to that table. Also, add your snowtype to the
79 avoidance table, to allow it to melt, and avoid the game double-stacking
80 the snow on your square.
81
82 4) Can we make spells to affect weather?
83
84 Yes. But remember that the game is constantly recalculating the
85 weather. If you want something that will affect an area of the world for
86 a long period of time, you will need to modify the weather code to
87 special case that. Temperature, for example, is constantly recalculated,
88 your spell will only work for 1 game hour.
89
90 That being said.. some amount of player fiddling can be done without
91 special code. For example, if you were to crank the pressure of a WM
92 square up really high, and put the humidity of that square at 100%, over
93 a few game hours, that square would essentially become the eye of a
94 storm, as the wind would pick up moving outwards from it, spreading the
95 humidity. Eventually, the game will flatten it out on it's own, but
96 there will be a lingering effect for many hours to come. Feel free to
97 experiment with such things.
98
99 Things that are recaulculated:
100 temperature
101 sky conditions
102
103 Things that are smoothed/spread:
104 humidity
105 pressure
106 wind
107
108 I advise that you do not mess with the elevation or water maps, as those
109 are not recalculated over time. If you change the water % of a WM
110 square, and don't put it back, it will stay that way until the DM deletes
111 the watermap and regenerates.