New feature: dynamic (flash-)lighting[message #318629]
|
Sat, 04 May 2013 01:15
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
dynamic (flash-)lighting
As I can't stand cuddly bears crying in the dark, I added dynamic lighting to the game. How dynamic it is really depends on wether I caught all relevant spots, so don't expect wonders.
Basically, every item can now be defined to be a flashlight. A flashlight has the ability to light a few tiles in front of the merc who has the thing in his hands. I update the lighting to his movements, thereby creating (more or less convincing) the illusion that the light source moves.
Flashlights need batteries to work (they drain relatively slow). They can be turned on and off via item transformation. Only those items in your hands that are flashlights/have flashlight attachments and have batteries are considered to be on - only they will make light. Flashlights also don't work on the surface during the day, because there is no need to.
http://www.youtube.com/watch?v=Xad0Trvl1_A&feature=youtu.be[/video]
This video shall serve as demonstration.
Take special note of the fact that Raider only sees the enemy when the light is on, and that the flashlight does not go through walls.
The only new tag in Items.xml is , an UINT16-entry. Items that have a value > 0 are considered flashlights, this is also the range in tiles that the light shines.
This is in the trunk as of r6061 and GameDir r1667. Useable flashlights are the Rifle LAM-Flashlight Combo and the new Flashlight item (#1636), which also works as a melee weapon (remember, anything can be a flashlight, including attachments).
Note that there may still be some instances that should cause a light redraw but don't - please notify. This is actually the hard part.
And before you ask: No, I will not make flashlights work out of the inventory. 'Cause its uncool. :armsfolded:
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: New feature: dynamic (flash-)lighting[message #318651]
|
Sat, 04 May 2013 13:08
|
|
anv |
|
Messages:258
Registered:March 2013 |
|
|
Wow, that's absolutely amazing!
Just imagine: pitch black night, enemies with flashlight patrolling the area, your mercs frantically run from one tree by the road into the shadows of another, to hide from the light. May totally turn a stealthy approach upside-down.
Or going into the crepitus lair and having to choose between turning the flashlight off and fighting in the dark, or actually see something in the front of you but becoming a walking target, as flashlight betrays your position.
Or preparing for massive Drassen counterattack at night by giving Biff, Flo and other C-list guys flashlights, and positioning them in the direction of an anticipated attack, while militia and your pros can take potshots at clearly visible enemies from the safety of the shadows. Possibilites are endless!
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: New feature: dynamic (flash-)lighting[message #318690]
|
Sun, 05 May 2013 03:23
|
|
Flugente |
|
Messages:3507
Registered:April 2009 Location: Germany |
|
|
SevenfmOne thing is unclear for me:
camo/stealth penalties when on/off? I did not alter camo or stealth. I simply add or remove light. If one is caught when turning on light, its not because of insufficient stealth, but due to being exposed in bright light.
HawkeyeCould this be added to light emitting objects in game? Such as lamps outside a doorway, which could be shot to shroud it in darkness? That has always existed ingame. Streetlights (like in Drassen SAM) emit light at night, but stop doing so when hit with a LAW. I suspect this happens when the structure receives enough damage. Wether or not that can be lowered is very likely jsd-based.
HawkeyePerhaps it would pave the way for searchlights used by the enemy? I assume you mean static searchlights that occupy one tile, which would then be controlled and turned by a merc behind it. This is actually very hard. I did not implement this for some of the same reasons I struggle to implement static MGs:
- MGs/searchlights need a separate structure. This would have to be creatable to all existing maps. We had a minor breakthrough last summer, when we hacked GENERIC_1 to have up to 65536 entries. This theoretically allows us to have one tileset (that every map uses) that has all structures we'd ever need. Unfortunately, structures spawned this way lack functionality (shadows, door properties etc.) as these are more or less hardcoded.
Having searchlights being soldiers instead (like tanks) is a bad idea, as this lowers the amount of soldiers per team. - This would need more or less continuous interaction of player and structure. We do not have anything like that anywhere. Any continuous functionality that depends on a soldier's animstate is a freaking nightmare to do, as the animstate continuously changes.
Apart from that, creating more light sources like flashlights is no problem.
SevenfmTurning light on and off in closet?
As we already have map switches, and can already have action items that use light traps, I suspect this has already been possible, but never tried.
SevenfmNice feature! May the enemies counter-attack you when you flash the light in front of them? Do they also get advantage of seeing further if your flashlight is on / can they use the flashlight feature too by night? Switching on lights gives everybody the chance to interrupt. As people in bright light are highly visible, they do suffer from that, as they are likely to be interrupted.
Bright light increases visibility of the bright tiles for everbody.
The AI can use that feature, but can't handle it properly. The current AI causes them to back down when they are in front of bright light. They turn around... and now the new tile in front of them is bright too! They basically turn nonstop, rendering them useless. As we now have someone seriosly upgrading the AI, this might be easy to solve once we get to such finetuning.
HeadhunterCool stuff! How long is the step from this to being able to shoot out sentry lights at night? As said - already possible with street lamps.
HeadhunterDid you change the regular night-time vision range? No.
anvJust imagine: pitch black night, enemies with flashlight patrolling the area, your mercs frantically run from one tree by the road into the shadows of another, to hide from the light. May totally turn a stealthy approach upside-down. I did a funhack that gave all enemies flashlights once their alarm level rose to red an above. The result was quite impressive: Fire a burst, and suddently flashlights pop up all over the map. Sadly, the current AI cannot handle flashlights on enemies as described above.
@merc05: the current flashlight is supposed to be a 30cm MagLite, which one can also use as a club. Could you alter the pic in that regard?
MaalstroomIf the enemies are using the flashlight we should be able to spot them! Well yes. When you use flashlight, you are visible too, so you will be noticed easily.
TaisNow we're on the subject of lights, how about construction lights that you can place on the map and that will light up an area... Use the map editor (or was your point something different?)
MaalstroomWould be very cool to have them triggered by movement. This does not fit the game in my view, and would be very hard to implement, so no.
Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|