[Done for V0.45] Better lighting management?
Posted: Thu Sep 21, 2006 8:24 pm
Hi GG and thanks for your great game engine!
How light is handled in RTC doesn't provide a good "gameplay" experience, for the following reasons:
a) Why have two spells in the game, Torch and Light, when one is enough, simply by casting it one more time? In the original game, Light was useful because, once you had it, you finally has access to great lighting conditions. Personally, I like to play games with brightness hypered to the roof, but I also like the idea that you do not immediately gain such things. With currently the effect of Torch stackable to that of the Light spell, this second spell becomes redudant/useless to the game.
In short: I liked that Torch did put a "limit" on the available lighting. I also liked that you had to take care of keeping enough mana in reserve in case your magic torch went out, because you could not cast Torch a tens of times in advance to make its duration hours instead of minutes.
b) The lighting spells durations become way too long BECAUSE the effects are fully stackable. I can "train for a while" and can EASILY cast Torch 20 times with a single mana-sleep-cycle of my 4 heroes and thus have enough lighting to last nearly the ENTIRE GAME. IMHO, this is the equivalent of completely removing that part of the game (i.e. handling your lighting).
c) Stacking of spells should not be infinite. After all, when you have a helaing potion in hand, casting more times the healing potion spell doesn't make a super-duper-potion, right? I think handling the lighting in the same way would provide a better gameplay experience.
*** So, I suggest handling lighting could be dealt with in this manner instead:
First, what the following questions must be answered:
(A) Is the DARKNESS spell to be really useful to the party in this game?
The answer should be yes, of course. Otherwise it is simply just bad game design to put in a useless game element in a game!
Given the nature of the darkness spell, it makes traveling in the dungeon really hard, thus the only way to make that spell useful is if it makes the party "less detectable" by the enemies. Enough so to justify the party being unable to see the walls!
Thus, the "Sight" and "Detection" ranges of most creatures should be directly affected by the lighting conditions. Under a certain light-level threshold, sight and detection ranges should start degrading, let's say linearly and by rounding up (to keep things simple) (but keep it to a minimum of one -- the spell is not "invisibility").
For example, if lighting is currently at 75% of the minimum threshold, and a monster detects at 5 squares, the monster will now "LIGHT_ADJUSTED_"detect at a range of 3.75 squares instead, rounded up to 4 squares.
In combat in darkness, the party is much less effective, bu so should be most monsters. The main advantage of fightng in darkness is thus that the player has MORE TIME TO REACT TO EVENTS (combat seemingly slows down). Also, mana regenerates a bit, so lengthening some battles will help in some situations. Amd magic is unaffected, thus a party with magic will have the upper hand against melee-only monsters. However, some monsters should have LOW-LIGHT VISION and/or even DARKVISION attributes so casting Darkness isn't always a good idea. But most monsters should rely on normal sight just like the party does.
All of this is quite simple to program and implement with only a few lines of code. In the lines of code where monsters try to see/detect the party, simply split "Sight Range" and "Dectetion Ranges" variables into Creature_Sight_Range, Light-Adjusted_Sight-Range, Creature_Detection_Range, and Light-Adjusted_Detection-Range variables, and determine Visibility_Effectiveness as a fraction of Current_Lighting_Level divided by Minimum Threshold, then if above 1.0 set to 1.0, then use this fraction between 0.0 and 1.0 to compute Current Lighting_ Values from Creature_ values and this fraction, rounding up to an integer. Adding LOW-LIGHT and DARK VISION attributes special qualties to monsters can be done later.
(B) How hard is it to go from light to darkness and vice-versa?
Usually, good gameplay should allow for the following:
- When a spell is cast, it is because the player needs it RIGHT NOW.
- A player controls his spells, so theoretically could be allowed to '"dismiss" his own magic in order to do the opposite. Dismissing would be inherently a given if the player tries to cast a spell effect which goes contrary to a previously cast spell.
According to this, Torch/Light magic should GREATLY ATTACK Darkness magic, and vice-versa. If I cast Light 10 times, it should not take 10 castings of Darkness to attain dark conditions, AND VICE-VERSA.
(C) What is the difference exactly between a LO version and a MON version of the same lighing spell?
For gameplay reasons, I recommend making the difference in light intensity between a LO Torch and a MON Torch relatively small. Otherwise, a game such as Dungeon Master where the party stays low level for a long time will tend to have "not enough lighting" at first, and when the party is high enough level to cast OH IR RA, the apparent lighting difference between using the Torch and the Light spell would not be sufficient to warrant its use.
Also, since the Light spell is already a "more powerful version of lighting", it also should not have any (if at all) difference between its LO and MON light intensity values.
The main difference, then, in the powers are in the DURATION of the spell effects. Durations should be linear accotrding to the power rune: it is not more cost effective to cast the biggest spell (duration-wise), it just saves on clicking for repeated castings.
Also, contrary to the original DM, the light spell should last long enough to be cost-effective useful (even if it costs more than Torch, its cost-per-minute-of-gaming should not be prohibitive).
(D) Just what kind of lighting stacking do we want?
Here is where opinions may diverge greatly.
Personnally, I'd make it so that casting a lighting spell stays simple enough to be programmable without pullng one's hair out, but create a behavior that keeps the "must manage lighting" element clearly inside the game (rather than during a one-shot wizard training session with one of the easiest sells), while making the player clearly see what happens as soon as he casts such spells. Thus, the super-simple-to-code "ine variable pool of lighting", as it currently seems to be defined in RTC, is simply not appropriate.
Keeping each casting of a lighting spell as a separate entity is also not very appropriate, because such list of objects to parse at every moment could become very long and bog the game down.
*** PROPOSED:
When cast, a light spell generates light at a constant rate, until such time X where its emitted light suddenly reduces at a relatively fast pace.
Like this:
(X axis is time, Y axis is light power)
--------------
--
--
--
Since constantly seeing the light go down in intensity is something that most player find bothersome i.e. the point of recast is not DURING the slope, but bery near the BEGINNING of the slope, then it is useless to make the slope vey long. It need be just long enough to let the player "feel that its light is going out" and "escape from danger to find a safe spot". Thus, the slope going from 100% to 0% should occur within seconds, not minutes. You play, when SUDDENLY' you see a slight light degradation, followed a few second later by another, and another, etc. Not the "you see a slight light degradation, and you can play for several minutes more before seeing another". The way a Torch or magical light should behave should be more like a candle: it generates constant light for a LONG time, then it starts to recuces its light and goes out quickly when its '"fuel" is fully expended.
Note that the torch object should be a bit more like this, too (but not as much as the spells).
eg. Instead of
Current: 100% = 1 minute, 75% = 2nd minute, 50% = 3rd minute, etc, 25% = 4th minute, out = 5th minute.
A Torch object should be more:
100% = 1-2-3rd minutes. 75% = 4th minute 50% = 4minute 20 seconds, 25% = last 20 seconds.
i.e. full light for most of the duration, then linear diminution over remaining time.
And for a Torch spell:
100% = first 4 minutes 45 seconds
75%-50%-25% = each 5 seconds for last 15 seconds.
(ok, I don't have the exact time durations values but you get the idea).
These things are very simple to code with a duration and a "max light" threshold.
So for example (using arbitrary values: 100% = enough light to feel comfortable, 50% = this is a bit too dark to be really useful, 200% = really bright, and 300% = way too bright).
Base Intensity Duration
LO Torch = 75% 2 minute
MON Torch = 125% 12 minutes
LO Light = 175% 1 minute
MON Light = 225% 6 minutes
Once the dration is elapsed, the intensity diminishes at a good clip, lets say for example - 1% per second.
(linear interpolaton for other spell powers)
Now, the "fun and hard" part is when "spell stacking" comes in.
Casting more spells should provide more light, right?
Yes, but only up to a certain point.
Casting more spells should provide light for longer, right?
Maybe, maybe not!
If we want the player to "manage" ihs light in-game, then the answer is more "no" than "yes".
But how can we compute this "easily"?
The proposed "solution":
Keep a list of light sources. Each has a given lighting power.
The effective lighting value is simply the square root of that power.
(try it with real torches or check your physics on the web!).
Casting darkness "destroys" a LOT of torch/light sources.
The clincher, is how to prevent the list from becoming too long, so as not to slow down the game?
Simply limit the number of active light source to some fixed low-number Any extra light source cast is then compared to the other ones, using the following formula: INTENSITY times SQRT OF REMAINING DURATION, and the "weakest energy" spell is removed from the list (or other appropriate equation). Note that remaining duration is "less important" than intensity.
Thus, a player may cast 4 LO torches to get double-the-light, but he won't get both x4 the light and x4 the duration at the same time (which is what occur with a unique "light pool" variable).
Also, I'd strongly consider that casting Torch or Light dispels all active Darkness, and vice-versa. Casting light after casting darkness and still not seeing anything is very frustrating, especially when those spells are cast in emergency situations. The player should be able to use these spells proactively during combat to escape, flee or avoid detection altogether, or to quickly bring the light back up to see just what the heck is attacking him. So a single LO TORCH dispelling all previously cast darkness spells could make sense, at least in a gameplay fashion.
Finally, in the event that light spells don't stack, make sure the durations are USEFUL to prevent having to cast the spells all the time, which also can be very frustrating.
I wonder myself, just HOW DID THE ORIGINAL ST GAME HANDLED LIGHT?
Optionally, this would require some extra code but would be well worth it:
- Make the TORCH item not light automatically but require a new item:
the LIGHTER The Light Torch command is used to light up an unlit torch held in the other hand. Putting the torch on the ground on in any inventory slot except a hand unlights it.
- Castingt the Torch spell requires that the character casting the spell having an unlit TORCH IN HAND (even a burnt-out torch). That torch gains a blue-fire aura just like a real torch, and works the same way.
Or, a bit more simple to code:
- Casting the Torch spell requires that the character casting the spell having a TORCH IN HAND (even a burnt-out torch). Whatever fire the torch had is overriden by the magical torch spell. That torch gains a blue-fire aura just like a real torch, and works the same way (if can even be removed and put back, albeit the spell's duration continues to elapse even when in inventory). When the magic torch goes out, after a lshort interval if the torch still has any capability it lits back up by itself (yellow fire).
This variant makes the torch spell useful, but require a character to use up one hand to light the party! Stacking torches for more light is possible, but require even more hands.
Pax.
How light is handled in RTC doesn't provide a good "gameplay" experience, for the following reasons:
a) Why have two spells in the game, Torch and Light, when one is enough, simply by casting it one more time? In the original game, Light was useful because, once you had it, you finally has access to great lighting conditions. Personally, I like to play games with brightness hypered to the roof, but I also like the idea that you do not immediately gain such things. With currently the effect of Torch stackable to that of the Light spell, this second spell becomes redudant/useless to the game.
In short: I liked that Torch did put a "limit" on the available lighting. I also liked that you had to take care of keeping enough mana in reserve in case your magic torch went out, because you could not cast Torch a tens of times in advance to make its duration hours instead of minutes.
b) The lighting spells durations become way too long BECAUSE the effects are fully stackable. I can "train for a while" and can EASILY cast Torch 20 times with a single mana-sleep-cycle of my 4 heroes and thus have enough lighting to last nearly the ENTIRE GAME. IMHO, this is the equivalent of completely removing that part of the game (i.e. handling your lighting).
c) Stacking of spells should not be infinite. After all, when you have a helaing potion in hand, casting more times the healing potion spell doesn't make a super-duper-potion, right? I think handling the lighting in the same way would provide a better gameplay experience.
*** So, I suggest handling lighting could be dealt with in this manner instead:
First, what the following questions must be answered:
(A) Is the DARKNESS spell to be really useful to the party in this game?
The answer should be yes, of course. Otherwise it is simply just bad game design to put in a useless game element in a game!
Given the nature of the darkness spell, it makes traveling in the dungeon really hard, thus the only way to make that spell useful is if it makes the party "less detectable" by the enemies. Enough so to justify the party being unable to see the walls!
Thus, the "Sight" and "Detection" ranges of most creatures should be directly affected by the lighting conditions. Under a certain light-level threshold, sight and detection ranges should start degrading, let's say linearly and by rounding up (to keep things simple) (but keep it to a minimum of one -- the spell is not "invisibility").
For example, if lighting is currently at 75% of the minimum threshold, and a monster detects at 5 squares, the monster will now "LIGHT_ADJUSTED_"detect at a range of 3.75 squares instead, rounded up to 4 squares.
In combat in darkness, the party is much less effective, bu so should be most monsters. The main advantage of fightng in darkness is thus that the player has MORE TIME TO REACT TO EVENTS (combat seemingly slows down). Also, mana regenerates a bit, so lengthening some battles will help in some situations. Amd magic is unaffected, thus a party with magic will have the upper hand against melee-only monsters. However, some monsters should have LOW-LIGHT VISION and/or even DARKVISION attributes so casting Darkness isn't always a good idea. But most monsters should rely on normal sight just like the party does.
All of this is quite simple to program and implement with only a few lines of code. In the lines of code where monsters try to see/detect the party, simply split "Sight Range" and "Dectetion Ranges" variables into Creature_Sight_Range, Light-Adjusted_Sight-Range, Creature_Detection_Range, and Light-Adjusted_Detection-Range variables, and determine Visibility_Effectiveness as a fraction of Current_Lighting_Level divided by Minimum Threshold, then if above 1.0 set to 1.0, then use this fraction between 0.0 and 1.0 to compute Current Lighting_ Values from Creature_ values and this fraction, rounding up to an integer. Adding LOW-LIGHT and DARK VISION attributes special qualties to monsters can be done later.
(B) How hard is it to go from light to darkness and vice-versa?
Usually, good gameplay should allow for the following:
- When a spell is cast, it is because the player needs it RIGHT NOW.
- A player controls his spells, so theoretically could be allowed to '"dismiss" his own magic in order to do the opposite. Dismissing would be inherently a given if the player tries to cast a spell effect which goes contrary to a previously cast spell.
According to this, Torch/Light magic should GREATLY ATTACK Darkness magic, and vice-versa. If I cast Light 10 times, it should not take 10 castings of Darkness to attain dark conditions, AND VICE-VERSA.
(C) What is the difference exactly between a LO version and a MON version of the same lighing spell?
For gameplay reasons, I recommend making the difference in light intensity between a LO Torch and a MON Torch relatively small. Otherwise, a game such as Dungeon Master where the party stays low level for a long time will tend to have "not enough lighting" at first, and when the party is high enough level to cast OH IR RA, the apparent lighting difference between using the Torch and the Light spell would not be sufficient to warrant its use.
Also, since the Light spell is already a "more powerful version of lighting", it also should not have any (if at all) difference between its LO and MON light intensity values.
The main difference, then, in the powers are in the DURATION of the spell effects. Durations should be linear accotrding to the power rune: it is not more cost effective to cast the biggest spell (duration-wise), it just saves on clicking for repeated castings.
Also, contrary to the original DM, the light spell should last long enough to be cost-effective useful (even if it costs more than Torch, its cost-per-minute-of-gaming should not be prohibitive).
(D) Just what kind of lighting stacking do we want?
Here is where opinions may diverge greatly.
Personnally, I'd make it so that casting a lighting spell stays simple enough to be programmable without pullng one's hair out, but create a behavior that keeps the "must manage lighting" element clearly inside the game (rather than during a one-shot wizard training session with one of the easiest sells), while making the player clearly see what happens as soon as he casts such spells. Thus, the super-simple-to-code "ine variable pool of lighting", as it currently seems to be defined in RTC, is simply not appropriate.
Keeping each casting of a lighting spell as a separate entity is also not very appropriate, because such list of objects to parse at every moment could become very long and bog the game down.
*** PROPOSED:
When cast, a light spell generates light at a constant rate, until such time X where its emitted light suddenly reduces at a relatively fast pace.
Like this:
(X axis is time, Y axis is light power)
--------------
--
--
--
Since constantly seeing the light go down in intensity is something that most player find bothersome i.e. the point of recast is not DURING the slope, but bery near the BEGINNING of the slope, then it is useless to make the slope vey long. It need be just long enough to let the player "feel that its light is going out" and "escape from danger to find a safe spot". Thus, the slope going from 100% to 0% should occur within seconds, not minutes. You play, when SUDDENLY' you see a slight light degradation, followed a few second later by another, and another, etc. Not the "you see a slight light degradation, and you can play for several minutes more before seeing another". The way a Torch or magical light should behave should be more like a candle: it generates constant light for a LONG time, then it starts to recuces its light and goes out quickly when its '"fuel" is fully expended.
Note that the torch object should be a bit more like this, too (but not as much as the spells).
eg. Instead of
Current: 100% = 1 minute, 75% = 2nd minute, 50% = 3rd minute, etc, 25% = 4th minute, out = 5th minute.
A Torch object should be more:
100% = 1-2-3rd minutes. 75% = 4th minute 50% = 4minute 20 seconds, 25% = last 20 seconds.
i.e. full light for most of the duration, then linear diminution over remaining time.
And for a Torch spell:
100% = first 4 minutes 45 seconds
75%-50%-25% = each 5 seconds for last 15 seconds.
(ok, I don't have the exact time durations values but you get the idea).
These things are very simple to code with a duration and a "max light" threshold.
So for example (using arbitrary values: 100% = enough light to feel comfortable, 50% = this is a bit too dark to be really useful, 200% = really bright, and 300% = way too bright).
Base Intensity Duration
LO Torch = 75% 2 minute
MON Torch = 125% 12 minutes
LO Light = 175% 1 minute
MON Light = 225% 6 minutes
Once the dration is elapsed, the intensity diminishes at a good clip, lets say for example - 1% per second.
(linear interpolaton for other spell powers)
Now, the "fun and hard" part is when "spell stacking" comes in.
Casting more spells should provide more light, right?
Yes, but only up to a certain point.
Casting more spells should provide light for longer, right?
Maybe, maybe not!
If we want the player to "manage" ihs light in-game, then the answer is more "no" than "yes".
But how can we compute this "easily"?
The proposed "solution":
Keep a list of light sources. Each has a given lighting power.
The effective lighting value is simply the square root of that power.
(try it with real torches or check your physics on the web!).
Casting darkness "destroys" a LOT of torch/light sources.
The clincher, is how to prevent the list from becoming too long, so as not to slow down the game?
Simply limit the number of active light source to some fixed low-number Any extra light source cast is then compared to the other ones, using the following formula: INTENSITY times SQRT OF REMAINING DURATION, and the "weakest energy" spell is removed from the list (or other appropriate equation). Note that remaining duration is "less important" than intensity.
Thus, a player may cast 4 LO torches to get double-the-light, but he won't get both x4 the light and x4 the duration at the same time (which is what occur with a unique "light pool" variable).
Also, I'd strongly consider that casting Torch or Light dispels all active Darkness, and vice-versa. Casting light after casting darkness and still not seeing anything is very frustrating, especially when those spells are cast in emergency situations. The player should be able to use these spells proactively during combat to escape, flee or avoid detection altogether, or to quickly bring the light back up to see just what the heck is attacking him. So a single LO TORCH dispelling all previously cast darkness spells could make sense, at least in a gameplay fashion.
Finally, in the event that light spells don't stack, make sure the durations are USEFUL to prevent having to cast the spells all the time, which also can be very frustrating.
I wonder myself, just HOW DID THE ORIGINAL ST GAME HANDLED LIGHT?
Optionally, this would require some extra code but would be well worth it:
- Make the TORCH item not light automatically but require a new item:
the LIGHTER The Light Torch command is used to light up an unlit torch held in the other hand. Putting the torch on the ground on in any inventory slot except a hand unlights it.
- Castingt the Torch spell requires that the character casting the spell having an unlit TORCH IN HAND (even a burnt-out torch). That torch gains a blue-fire aura just like a real torch, and works the same way.
Or, a bit more simple to code:
- Casting the Torch spell requires that the character casting the spell having a TORCH IN HAND (even a burnt-out torch). Whatever fire the torch had is overriden by the magical torch spell. That torch gains a blue-fire aura just like a real torch, and works the same way (if can even be removed and put back, albeit the spell's duration continues to elapse even when in inventory). When the magic torch goes out, after a lshort interval if the torch still has any capability it lits back up by itself (yellow fire).
This variant makes the torch spell useful, but require a character to use up one hand to light the party! Stacking torches for more light is possible, but require even more hands.
Pax.