Shades of doom
Posted: Fri Oct 31, 2003 3:03 am
My current project "Elidor" is not progressing well, you know why? because I am an RPG game fan and "Morrowind" and "Pirates of the Caribbean" are taking the little time I can spare for my computer hobbies.
But also because I want to make Elidor an RPG doom mod a bit like "DeusEx" and let the players advance their skills and stats during the game, and one of the skills that I want to give the players to work on, is stealth, and I have found a way to script it into the levels, by the help of ThingHate and a few other tricks, but while thinking about a new and better AI for doom monsters, which I posted in this thread, I found a better way to incorporate stealth into doom levels, this time not by ACS scripts but by changing the game logic a bit, and this fact has stopped my process in Elidor totally.
Thats right, because scripting stealth into the levels takes a lot of time and effort and while there was no other way to do it, I thought it worth while, but now I think that it is a waste of time, and would change the levels a lot, so if/when the "Actor Sight calculation" find it's way into the ZDoom engine, I would have to revamp my levels totally to remove the scripted stealth system from my levels and use the engine based one.
The trick to add an engine based stealth feature to the game is to change the actor code when we calculate the actor sight and target position to decide if the actor would see the target and would wake up by it's sight.
I have not looked into the code, but currently there is a function which takes the actor and target positions and looks at the level geometry to decide if the target in the view port of the actor to decide if the actor can see the target, well we can add a new calculation at the end of it to decide if there is enough light for actor to see the target, i.e. is the target is not hidden in a dark place.
In the old thread I had testes a lot of different formulas and had come out with a formula which I think is good for the purpose and here it is:
dMax = (L*L*S*V)/dFactor
dMax = Maximum visible distance
L = Target sector light value
S = Actor sight power
V = Target visiblity factor
dFactor = Global distance factor
And I think that a distance factor of 360000 if an optimum value for it.
We should have two new properties for our actors Sight-power and Visiblity, and their default value for any actor could be 100, but these values could be changed via Dehacked for the entire race of the actors and via ACS for particular actors, so that we could have specialized actors like short sighted ones of special troops with night vision headsets.
Whenever an actor sees a target, after calculating if the target is in the view of the actor, the engine can calculate this formula, taking the actor sight power, and target visiblity factor, and the light intensity of the sector that contains the target, and a global distance factor, to see if the target is within the maximum visible distance of the actor, so if the result is negative then the actor would not see the target, exactly like when the target is behind a closed door, so the actor would ignore the target.
Randy, would you implement this feature inside ZDoom, please, pretty please? because I think that it is a good addition to the game and would start a new flow of stealth based levels in which the players should stick to dark corners or maybe turn the room lights off and so on.
We can have a new MAPINFO command to let the level designers to turn this feature on, for their levels, so that the older levels would not be affected by it, and maybe we could have an option in the game options menu to turn it on for all the levels, so that we could try the older levels with this feature turned on.
And I think that we may change some current items and features behaviours while this feature is turned on, for instance:
Blur Sphere may halve the visiblity of the player while it is working and also the blurred monsters would have half of the visiblity defined for their race.
Stealth monsters should have visibility of zero when they are hidden. This applies to the hexen swamp monster as well.
When the actor's sprites are full bright (shooting frames) then their visibility should be double their normal visibility. This also applies to etire frames of lost souls and projectiles.
When actors are moving, then their visiblity should increase depending on their movement speed, we may also decrease their sight power a bit as well.
When an actor is shot by another actor, it should ignore the sight calculation formula totally and should become instantly aware of the target.
Please think about it Randy, and if you don't have the time to work on it, please assign another person to work on it, because I think that it would become a good feature for your ZDoom port.
I think if/when you implement it into ZDoom, from then on lots of the level designers would add stealth to their list of design decision parameters, and would use it in their levels.
But also because I want to make Elidor an RPG doom mod a bit like "DeusEx" and let the players advance their skills and stats during the game, and one of the skills that I want to give the players to work on, is stealth, and I have found a way to script it into the levels, by the help of ThingHate and a few other tricks, but while thinking about a new and better AI for doom monsters, which I posted in this thread, I found a better way to incorporate stealth into doom levels, this time not by ACS scripts but by changing the game logic a bit, and this fact has stopped my process in Elidor totally.
Thats right, because scripting stealth into the levels takes a lot of time and effort and while there was no other way to do it, I thought it worth while, but now I think that it is a waste of time, and would change the levels a lot, so if/when the "Actor Sight calculation" find it's way into the ZDoom engine, I would have to revamp my levels totally to remove the scripted stealth system from my levels and use the engine based one.
The trick to add an engine based stealth feature to the game is to change the actor code when we calculate the actor sight and target position to decide if the actor would see the target and would wake up by it's sight.
I have not looked into the code, but currently there is a function which takes the actor and target positions and looks at the level geometry to decide if the target in the view port of the actor to decide if the actor can see the target, well we can add a new calculation at the end of it to decide if there is enough light for actor to see the target, i.e. is the target is not hidden in a dark place.
In the old thread I had testes a lot of different formulas and had come out with a formula which I think is good for the purpose and here it is:
dMax = (L*L*S*V)/dFactor
dMax = Maximum visible distance
L = Target sector light value
S = Actor sight power
V = Target visiblity factor
dFactor = Global distance factor
And I think that a distance factor of 360000 if an optimum value for it.
We should have two new properties for our actors Sight-power and Visiblity, and their default value for any actor could be 100, but these values could be changed via Dehacked for the entire race of the actors and via ACS for particular actors, so that we could have specialized actors like short sighted ones of special troops with night vision headsets.
Whenever an actor sees a target, after calculating if the target is in the view of the actor, the engine can calculate this formula, taking the actor sight power, and target visiblity factor, and the light intensity of the sector that contains the target, and a global distance factor, to see if the target is within the maximum visible distance of the actor, so if the result is negative then the actor would not see the target, exactly like when the target is behind a closed door, so the actor would ignore the target.
Randy, would you implement this feature inside ZDoom, please, pretty please? because I think that it is a good addition to the game and would start a new flow of stealth based levels in which the players should stick to dark corners or maybe turn the room lights off and so on.
We can have a new MAPINFO command to let the level designers to turn this feature on, for their levels, so that the older levels would not be affected by it, and maybe we could have an option in the game options menu to turn it on for all the levels, so that we could try the older levels with this feature turned on.
And I think that we may change some current items and features behaviours while this feature is turned on, for instance:
Blur Sphere may halve the visiblity of the player while it is working and also the blurred monsters would have half of the visiblity defined for their race.
Stealth monsters should have visibility of zero when they are hidden. This applies to the hexen swamp monster as well.
When the actor's sprites are full bright (shooting frames) then their visibility should be double their normal visibility. This also applies to etire frames of lost souls and projectiles.
When actors are moving, then their visiblity should increase depending on their movement speed, we may also decrease their sight power a bit as well.
When an actor is shot by another actor, it should ignore the sight calculation formula totally and should become instantly aware of the target.
Please think about it Randy, and if you don't have the time to work on it, please assign another person to work on it, because I think that it would become a good feature for your ZDoom port.
I think if/when you implement it into ZDoom, from then on lots of the level designers would add stealth to their list of design decision parameters, and would use it in their levels.