Forum > Serverside Modding
[C++] [WotLk] Real Stealth...
(1/3) > >>
Scytheria23:
This is going to be tricky. I'm not requesting it, but any ideas or assistance is vastly appreciated. I've started this thread because (1) it may be of interest to others and (2) somebody here may have an insight or brainwave that helps.
What I want to do:
Change the mechanics of Stealth (the Rogue ability) so that its effectiveness is dependent on the level of light around the character or npc using it. In effect, to make Stealth much less of a binary affair - currently the ability puts you in two modes, hidden or unhidden, with no grey area. I want a grey area, in which a model's transparency and statistical visibility varies by surrounding light. I'm aiming to do this for WotLK on a Trinity Core, but am open to shifting client or server if a simple solution exists elsewhere.
Problems:
WoW, as far as I can tell, does not have any mechanisms for tracking the level of light falling on a model. Certainly, the client must be passing information to the graphics hardware about this, but it's not information contained in parcels sent between the client and server. The information is only sent from client to hardware. Since client source code is (practically) unavailable, I will need to do something to the Trinity Core to make this work.
Vague Idea:
Add invisible (GM view only) gameobjects to maps wherever I want there to be light. I'll call these 'LightMarkers' for simplicity. These, of course, do not actually create light that players can see, but they simply mark light intensity. Let's have a range of Lightmarkers (Lightmarker0, Lightmarker1, Lightmarker2 ... Lightmarker 10) for a good range of light levels ranging from 0 to 10.
For example, in-game there's a torch on a wall. I want this to have a low light intensity, so I place an invisible Lightmarker3 on the same spot. The players can't see it, but it's there all the same.
The position of a model relative to any nearby Lightmarkers is calculated, and some formula or other changes the intensities and the player's distance from the Lightmarkers into a figure that I'll call 'Exposure'. Exposure ranges from 0 (complete darkness) to 1 (full, bright light). Move closer to a Lightmarker, and Exposure increases. Move away, it decreases.
The Stealth ability's code now gets re-worked to scale Stealth by the model's current Exposure. I'm not sure yet, but I'm hoping this can be dynamic (e.g. if you enter Stealth in complete darkness and then move into bright light, your Stealth efficiency changes).
Pitfalls:
I'm not sure this system will work so well if Lightmarkers are, for example, behind something. For example, if you are standing next to a wall, and there's a Lightmarker on the other side of it, your Exposure will increase... Maybe will need to give Lightmarkers a direction too?
Additional:
As well as the above, I'd ideally like the armour/weapons a model is using and its actions to have a noticeable effect on Stealth. Wear more armour, your Stealth decreases. Draw a weapon, your Stealth Decreases. Move, your Stealth decreases (based on your movement speed). Etc.
Why?
Good question. I'll be starting a 'What are you working on?' in a short while. Thanks for reading!
Scy
Ascathos:
Well, that is indeed tricky. But possible. Have lightmarkers shine in an area and make an Line of Sight check, if that fails it wouldn't affect it.
You could judge by armor type (cloth, leather, mail, etc.) and, if you want, certain armor entries to provide more or less light restriction.
Caedes:
Hey, I'm new here.
My thoughts for your problem are a bit rough, but might be helpful.
Armor Type: You could add some variation of the Night Elf racial that increases ones stealth level to leather/cloth type gear and lower the the general stealth level, that stealth abilities provide, for balancing reasons.
Light Sources: Same idea actually, you can create invisible units that provide an aura that decreases the stealth levels of units within a specific range.
The change to how Stealth works: the way your Stealth is supposed to work reminded me a bit of how Camouflage works (if I understood you right). You could generally decrease the stealth level of units to make them visible within a larger circle but add an additional effect that works similar to Cata's Camouflage (ranged dps' can't attack whereas melees can + standing still makes you completely invisible).
Another solution for the stealth-movement-speed-scaling could be a group of auras that decrease the range of spells that can be used on your stealthed target (no idea how Camouflage is coded, but there might be something that can be used for that) and increase stealth level. You could add dummy auras (that do nothing) to spells that increase movement that replace those Camouflage auras like high ranked buffs do with lower rank buffs of the same group. That would also work with my previous idea (adding those dummy auras to gear (the heavier the gear, the more dummy auras are on it) and light sources (the more light a light source provides, the more dummy auras are present, although I think that would make the number of dummy auras ridiculous)).
I hope my ideas are of any help.
regards, Caedes
Scytheria23:
Thanks for the above suggestions.
Just an update on progress. My approach has changed somewhat, now much less to do with coding. Here are the steps taken so far:
[1] Stealth (the rogue ability) has now been turned into a passive ability that is on all the time. It's visual effects (e.g. translucency and animations, speed reduction) have been removed. This means that characters can sneak up on npcs, and as long as they stay behind them are mostly undetectable. This is, of course, an improvement on the existing system in WoW where npcs have 360 vision.
[2] A new spell, a clone of the original Stealth, can be learned to enhance the passive stealth. This has the usual visual effects and animations.
[3] Light markers (invisible gameobjects) radiate stackable debuffs that decrease stealth. The nearer you are to a marker, the more it stacks.
This seems to work pretty well, but there are some bugs to iron out with line of sight, etc. I'm also not totally happy with the passive stealth which seems a little too powerful (e.g. you can stand still right in front of an npc without being detected). This should, hopefully, be a case of fine-tuning some of the spell variables.
Scy
iindigo:
For outdoor areas you might be able to modify the server core to be able to read static/baked shadow maps from ADTs. This would work similarly to how vamp extraction works, reading ADTs and converting the desired information into something more readable. The server can then factor them into stealth calculations.
Obviously this wouldn't help for light sources like torches but it would reduce the amount of manual light marker placement work necessary.
Navigation
[0] Message Index
[#] Next page
|