SIEGE UNIVERSITY 1 |
|
Siege University II Tutorials Modding FAQ 095: Upgrading DSII 100: The Basics of Siege Editor 201: Compass Map Radar 202: Conversations 203: Journal 204: Quest Indicator Icons 205: Start Positions 206: Teleporters 207: Town Portal Restrictions 208: Weapon Effects 209: Flick 210: Tuning Grids 211: Setting Up Good Map Lighting 212: Setting Up Simple Node Fading 215: Building Data Tables Siege University I Tutorials 200: Concepts and Terminology 201: Templates 203: Triggers 204: Moods 205: Fades 206: Elevators 211: Naming Key 213: Dungeon Siege Resource System 301: Introduction to Dungeon Siege Architecture Third Party Tutorials A Simple Mod Part One - Armor Textures A Simple Mod Part Two - A New Armor Beginners Guide to Stitching Regions How to Open and Create Tanks Making Chants Work in a New Map Ornaments Understanding the NKK Useful Links Siegetheday.org Dungeon Siege Outpost Dungeon Raider Kdawg.org - List of useful Links MCarp DS Nodes Dungeon Siege 2 at Gamefront Broken World at Gamefront |
Moods ·
What
You Need For This Tutorial ·
What
This Tutorial Assumes You Have Already Learned ·
What
This Tutorial Will Teach You ·
Mood
Usage ·
Mood
Defaults ·
Frequency
of Mood Changes ·
Location
of Mood Definitions ·
Mood
Naming Conventions ·
Mood
A ·
Mood
B ·
[mood_setting*]
·
[fog]
·
[music]
·
[sun]
·
[rain]
·
[snow]
·
[wind]
·
[frustum]
·
Mood
A ·
Mood
B ·
Mood
C ·
Mood
D Introduction A
Mood is a block of settings that control the fog near/far distances,
the fog
color, the music and how often it repeats, the ambient track and how
often it
repeats, the weather type and density, the wind speed and direction,
the color
of sunlight, EAX settings, and even (in some cases) the size of the
frustum. What
You Need For This Tutorial ·
Dungeon
Siege, updated to version 1.09B or later ·
A
text editor What
This Tutorial Assumes You Have
Already Learned ·
Siege U: 200 - Dungeon Siege Concepts
and Terminology
·
Siege U: 201 - Templates.
This is useful in
understanding the concepts of template blocks, components, and
properties. What
This Tutorial Will Teach You ·
What
Moods Are ·
What
Each of the Blocks and Fields Are ·
When
and How Moods are Used ·
Simple
and Complex Examples of Moods ·
EAX
Settings ·
Mood
Tips Overview
of Moods Mood
Usage Triggers
are placed in the world that usually have bounding boxes or some other
method
of player detection. The action in the trigger is "mood_change", with
a particular mood name specified. When a player walks into the bounding
box,
the game looks up all of the settings under that mood name and applies
them to
that character. Mood
Defaults If
you don't specify something in the mood, it will default to zero or
off. Frequency
of Mood Changes A
new mood is used anytime that we want to change anything at all from a
previous
mood. For instance, if we want a new piece of music to begin playing
when the
player reaches a certain point in the game, then we would need to set
up a
trigger that would activate a mood with that piece of music specified
under
standard_track = "[music piece]". The next place that the music will
change is when the player reaches another trigger that activates a mood
with a
different piece of music. Location
of Mood Definitions The
default location is My Documents\Dungeon
Siege\Bits\World\global\moods\[map
name]\[any name].gas. Mood
Naming Conventions Even
though moods can be kept in different files, they are all global. This
means
that the game loads all moods in all mood files, and a side effect of
that
behavior is that no two moods can have the same name. Here are the
guidelines
that we came up with to keep our moods organized. All mood names are
prefixed
by the map that they belong to. Even though this can make mood names
longer, it
will really help keep mood names unique. And since we created moods
that are
specific to each area on the world map, each mood will also be named
after the
region in which it first appears. After that, a number is used to
differentiate
between the different moods within a region, although it could just as
easily
be a descriptive word or two. The
map name is: Happyville. A
Couple Of Simple Moods Mood
A This
mood is used in map_world (The Kingdom of Ehb), in the bear cave at the
beginning of the game. It has its own music, no weather, black fog
fairly far
away from the camera, and a "cave" EAX setting. [mood_setting*] Mood
B This
mood is used in the forest just before the crypts (also near the
beginning of
the single-player campaign). The fog is dark green, and there is a
little bit
of wind. An ambient track with creaking trees is playing to help the
player
feel like they are in the woods, while creepy "crypt" music is
playing. [mood_setting*] Block
and Field Names [mood_setting*]
{ ... } All
moods begin with the [mood_setting*] block name and are enclosed in
curly
braces. mood_name All
moods need a mood_name defined. All mood names must be unique.
According to the
naming guidelines above, since bc_r1 was our bear cave region in the
map named
map_world, map_world_bc_r1_1 is the first mood in that region. transition_time This
is how long the mood will take before it completely switches to the new
values.
During the transition time, the old mood will be smoothly changing to
the new
mood. 0
seconds: fog
is white (0% black), music track #1 at 100% volume. 1
second: fog is
light gray (25% black), music track #1 at 75% volume, music track #2
and
ambient track #2 at 25% volume. 2
seconds: fog
is gray (50% black), music track #1 at 50% volume, music track #2 and
ambient
track #2 at 50% volume. 3
seconds: fog
is dark gray (75% black), music track #1 at 25% volume, music track #2
and
ambient track #2 at 75% volume. 4
seconds: fog
is black (100% black), music track #2 and ambient track #2 at 100%
volume. More
on transition time under Appendix B: Tips. interior This
is a true/false value that is used by the mood manager to control
whether or
not the fog will change color with the time of day. If interior = true,
then
the fog color will not change with the time of day. Further explanation
is
given under fog_color. [fog]
{ ... } This
block contains settings that deal with fog color and distance. fog_near_dist This
defines the distance from the camera (in meters) that the fog begins.
You can
still see past this point, usually up to the fog_far_dist, where the
fog is
100% thick. fog_far_dist This
is the distance from the camera (in meters) where the fog gets too
thick to see
through. fog_lowdetail_near_dist When
users have their detail settings bar all the way to the left, this
value will
be the new fog_near_dist. If they have the slider at the halfway point,
then
the fog_near_dist will be the average of the original fog_near_dist and
the
fog_lowdetail_near_dist. fog_lowdetail_far_dist Same
as above, except dealing with the fog_far_dist. fog_color The
fog value is made up of four components: alpha, red, green, and blue.
All of
these values go from 0 - 255, but it's in hex. So that means that the
scale is
0 - FF. The format for the color setting is 0xAARRGGBB, with AA =
alpha, RR =
red, GG = green, BB = blue. For those not familiar with hex, valid
numbers in
ascending order are 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F. Since alpha in fog
can be
treated quite differently depending on hardware and drivers, we finally
ended
up just setting all alpha values to maximum, so all of our fog settings
have FF
for the alpha. ·
Gray
fog at the first farmhouse: 0xFF646464 ·
Dark
blue fog in the Arctic Caverns: 0xFF202028 ·
Green
fog in the first forest: 0xFF323F32 ·
Smoky
lava-lit fog in the Lava Caverns: 0xFF4F2800 ·
Dusty
orange fog near Fortress Kroth: 0xFFB49363 ·
Sandy
fog in the Desert Canyons: 0xFFB09070 The
brightness of the fog will change with the time of day. This is
behavior defined
in the mood manager. At night, the fog color will be 50% of the defined
value,
morning/evening 75%, day 100%, and mid-day (noon) 125%. Since the fog
actually
will get brighter than you define it, I recommend having none of your
color
values be over C0 (C0 and higher will all get translated to FF during
the time
when the fog is brightest) unless you prevent the fog from changing
color by
setting interior = true. fog_density Unfortunately,
this is a mostly-useless setting. It is supposed to govern how thick
the fog is
between the near and far dist, but most video cards don't bother to use
this
information. This setting is still here for the video card and video
driver
combinations that support it. The scale is 0 -> 1.0, which is
least thick
-> most thick. You'll find that most of our moods have set this
to 0.5. [music]
{ ... } This
block contains all ambient track and standard track settings, and the
EAX
setting. room_type This
is the EAX setting. EAX, when enabled on a soundcard that supports it,
will
filter many of the sounds in Dungeon Siege through reverb that you
specify
here. If you want to make it sound like the player is in a cave, set
the room
type to rt_cave. The default is rt_generic, which is a setting with no
reverb.
All possible settings can be found in Appendix A,
as well as world\global\moods\default_moods.gas.
standard_track This
is the standard track, usually used for music. As long as a file is
located in
sound\Music, it can be specified here. You don't need to provide the
extension
of the file. standard_repeat_delay This
value is the number of seconds of silence to have after the end of the
track.
After this silence, the music will play again. For any looping tracks,
this
should be 0. standard_intro_delay This
value is the number of seconds of silence to have before the track
plays for
the first time. This can be useful if you are using a piece of music
that
starts with a sudden emphasis, but you are transitioning into the mood
for
several seconds. Without an intro delay, the music would begin playing
right
away, but it would start out very quiet. Putting in a standard intro
delay that
is equal to (or longer than) the transition time will guarantee that
the music
will start at full volume. ambient_track This
is simply another track that will play at the same time as the music
track. It
is a great place to have a small looping track that plays creaking
trees, or a
gentle wind sound. The game doesn't really care what you put here - you
could
use this to play a second piece of music at the same time as the
standard music
track. ambient_repeat_delay This
value is the number of seconds of silence to have after the end of the
track.
After this silence, the ambient track will play again. For any looping
tracks,
this should be 0. ambient_intro_delay This
value is the number of seconds of silence to have before the track
plays for
the first time. If you want to use the ambient track to play a second
piece of
music, you can use this to stagger the two pieces of music, so that the
ambient
piece doesn't start until the standard piece is done. battle_track,
battle_repeat_delay,
battle_intro_delay Setting
these values will have no effect unless you also modify
mood_manager.skrit to
actually play this track. This buried feature has a possible use for
advanced
modders. See Appendix B: Tips for further
explanation of possible uses. [sun]
{ ... } If
you want to override the default sunlight color table, then you will
need to do
it inside a [sun] block. The way this works is just the same as in the
timeofday.gas file: [00h00m]{
color = 0xFFA4700F; } There
is no limit to the number of time blocks as long as they fit the proper
format.
For example, XXhYYm, where XX is the hour between [0-23] and YY is the
minute
between [0-59]). The color of the sunlight will transition smoothly
between
these colors. [05h00m]{
color = 0xFFFF0000; } // red At
exactly 5am, the sunlight color would be a bright pure red. Immediately
after
this it will begin lessening the red and gaining more green until noon,
when it
will be completely green. Immediately after noon, it will begin gaining
blue
and lessening green until 7pm, when it will be pure blue. After 7pm, it
will
begin gaining red and lessening blue until 5am, when it will be pure
red again.
[rain]
{ ... } Rain
settings go inside a rain block. rain_density This
is how thick the rain will be. Default is 0 (not raining). The maximum
is
defined in config\weather.gas (we set it to 300). lightning This
can be set to either true or false. If true, then it uses settings in
config\weather.gas to determine how often the lightning will flash and
how long
after the flash the thunder occurs. [snow]
{ ... } Snow
settings go inside the [snow] block. snow_density is the only snow
setting,
currently. snow_density This
is how thick the snow will be. Default is 0 (not snowing). The maximum
is
defined in config\weather.gas (we set it to 400). [wind]
{ ... } Wind
settings to inside the [wind] block. wind_velocity Velocity
of the wind, in meters per second. Default is 0. If you set this above
5, you
may see very strange things happen with effects that are not wind
immune, if
you make any. In tests, monsters that breathed non-wind-immune fire had
a lot
of trouble hitting players right in front of them when the wind was set
to 20+.
We tend to leave the wind at 5 or less. wind_direction Direction
of the wind, specified in radians angles from the north vector. So pi/2
would
be east, pi would be south, etc. [frustum]
{ ... } If
you are going to set the frustum width and height, it needs to be
inside of a
frustum block. Warning!
Danger! Advanced stuff! Frustum settings are really powerful and
dangerous!!
frustum_width Measurement
is meters, recommended value is 45. We chose this number after
carefully
weighing world detail vs. system performance. This number is the radius
of the
frustum, where the player character is at the middle. That means that
45 meters
out from the character in all directions, the world is loaded. If this
number
is changed to 55, you could push the fog out farther and you wouldn't
see the
edge of the world, because you have pushed back the edge of the world
itself.
The major downside of this is that you have dramatically increased the
number
of things that the game has to keep in memory and actively process. frustum_height Measurement
is meters, default is 1000. We chose this number just because it was
large
enough that we wouldn't have to worry about it. This number was chosen
before
we came up with the crazy idea of really tall towers. When we came up
with
towers that would have bad guys on every floor, we suddenly had too
many
monsters in the frustum, so we changed the frustum height to 60. Even
this is
pretty large; it's very unlikely that you would ever notice in-game
that the
frustum isn't infinite in the vertical dimension. A
Practical Exercise This
is an example of writing a new mood and setting a trigger to give the
mood to
the player. [mood_setting*] First,
we need a name. The name of your group is DSF, the map is LaserWorld,
and the
region is arena3 (let's say). Here's a good name for the mood: mood_name
= dsf_laserworld_arena3_1; When
the player arrives at the arena, we want the fog to turn blue pretty
quickly.
Use with a two-second transition and flag the arena as "interior": transition_time =
2.0f; Let's
set up the blue fog. Start the fog fairly far away from the player, and
have a
10-meter distance from where the fog starts to where it's too thick to
see
through. Why? Well, it's nicer looking than having a sudden solid line
of fog.
For the color, we want a dark blue fog. Use a small amount of red and
green,
with a larger amount of blue: 0xFF202030 will work. I pulled a value
out of the
air here...if you really cared about the color, it would be good to
look at it
in-game and adjust it as needed. For fog_density, see the explanation
in the
field definitions above.
[fog] Next...some
music. We're going to use the music track "cool_techno.mp3", and it
loops, so we will make sure to set the repeat delay to 0 (leaving the
delay
field out would do the same thing). The room type is a very large room,
so an
EAX value of "arena" seems like it would fit.
[music] Ta
da! We now have a mood that looks like this: [mood_setting*] The
next step is to make a trigger that will give this mood to a player in
the
game. If you haven't read Siege U: 203A - Triggers I
and Siege U: 203B - Triggers II,
then these
instructions may not make sense to you - I recommend consulting those
documents! Four
Complex Moods Mood
A This
mood is used just outside of the Utraean Peninsula's castle. It is
rainy, with
a moderately dark gray fog. Transition time is 6 seconds to make it
start
raining kind of suddenly, yet give the fog time to change without being
too
obvious. A [frustum] block is present, explicitly setting the frustum
measurements to the defaults (not generally needed, see the above
comments in
the [frustum] section. [mood_setting*] Mood
B This
mood has darker fog, a little more rain, some wind, and lightning
turned on.
The transition time is short because none of the changes are very
severe. [mood_setting*] Mood
C This
mood is used in an unusual place in the Utraean Peninsula. The player
is
ascending a mountain, and this is after they have climbed up out of a
forest
and they are about to go inside a cave. After going through the cave,
they will
come out in snowy terrain. So this mood has some wind and just a tiny
bit of
snow (there are also some snow decals on the ground in this area). The
fog is
dark gray, keeping nearly the same level of brightness as the previous
fog,
just getting rid of the forest green. The fog is also closer than
normal. This
is to create a feeling of being in a foggy bank at high altitude. [mood_setting*] Mood
D This
mood is on top of the mountain. It has the overridden [sun] block to
prevent
seeing yellow snow, and our brightest fog. There is wind, along with a
wind
sound in the ambient track. Note the extremely close neardist for the
fog; this
forces the player to view everything (including their own character)
through
fog, reinforcing the feeling of being of being in a foggy snowstorm. It
is
snowing, with moderately strong wind. [mood_setting*] Conclusion That
concludes this Siege U section on Moods. We have covered the definition
and
composition of moods, where and when moods are used, and how often
moods are
updated. We have looked a several examples of simple and complex moods.
As you
can see, creating moods doesn't have to be hard. There are plenty
already
available, and if you want to make your own, cutting, pasting, and
editing an
existing mood is the easiest way to get started. Have fun with moods
and good
luck! Appendix
A: EAX Settings This
is a list of all EAX settings. They are self-explanatory. Appendix
B: Tips ·
Transition
time is really a powerful tool. You can make drastic changes in fog
color much
less noticeable by having them take 20 seconds. You can change music
very
suddenly to a loud battle song, or gently switch from one background
piece to
another. Anytime the player goes from inside to outside or vice versa,
they
will expect to see a very rapid change in the fog. Likewise, they won't
be
expecting any quick changes while they are marching through a forest or
field.
By working with these expectations you can keep mood transitions as
invisible
or obvious as you want. ·
Go
ahead and go a little crazy with the fog colors. Black is usually
required when
in a dungeon, but when the player is outside, gray gets boring. If
someone had
told me near the beginning of the project that we would end up having
red,
orange, green, blue, purple, and gray fogs, I'm not sure I would have
believed
them. Gray works most of the time, but adding a little color to the fog
can
make the environments feel more realistic. ·
Sometimes,
it's nice to have a lot of moods with subtle changes between them. You
could
use a whole series of moods with different levels of gray fog so that
as the
intrepid adventurer got closer to the Den of Evil, it gets darker, and
darker,
and darker... (This would also make it so that if they turned around
and walked
away, they would walk back through the mood triggers, making it
lighter, and
lighter...) ·
The
battle_track is a third music track that can be used, but it will take
a little
extra work to get it to work, and you will have to deal with skrit. It
was
originally added so that the standard track could play while the player
was
exploring, and then the battle track would play while the player was
fighting.
Fighting is so common, however, that it became an annoyance to have two
different tracks of music constantly starting up and then changing. So
the
battle track became an unused feature. The mood_manager.skrit doesn't
even play
this track...but it could. It is located at world\global\moods\mood_manager.skrit.
Discussion of the mood manager is beyond the scope of this introduction
to
moods. If enough demand is there, a 300-level document may be called
for and
created. ·
The
weather will have a chance of getting randomly more or less dense every
15
seconds. This behavior is defined in the mood manager. It will never go
below
50% or above 150% of the value specified in the mood. The wind will
also vary
in speed and direction in a similar manner, never going more than +/-
50%
velocity. If the rain goes over density 200 this way, lightning will be
turned
on. If the rain goes below density 200 this way, lightning will be
turned off. |