Jump to content


Photo

Nightvision: an Alternative for Ambient_world?


15 replies to this topic

Poll: Your input (7 member(s) have cast votes)

Which was better?

  1. Traditional ambient_world method (2 votes [28.57%] - View)

    Percentage of vote: 28.57%

  2. Nightvision method (1 votes [14.29%] - View)

    Percentage of vote: 14.29%

  3. Both have their own pros and cons (4 votes [57.14%] - View)

    Percentage of vote: 57.14%

Vote Guests cannot vote

#1 Sotha

Sotha

    Vertical Contest Winner

  • Active Developer
  • PipPipPipPipPip
  • 5490 posts

Posted 31 December 2016 - 08:42 AM

*
POPULAR

Hi!

 

A general issue with mappers is how to use lights. If too strong ambient_world is used, everything is looks washed out and there is little contrast between shadow and lights. On the other hand, if too low ambient_world is used, the light-shadow contrast looks gorgeous, but player has difficulty of seeing the map geometry.

 

Here is an experimental alternative to ambient_world, which hopefully helps mappers to bridge this gap. It works like this:

1) ambient_world is completely removed (it could stay, too, just give it a really low value)

2) ambient light source, a sort of nightvision, is attached to the player, and this light follows the player around

 

The result is that distant shadows look really dark, and nearby shadows are illuminated as the player approaches them, so that the player can see what is in there. Now the AI could hide from the player in distant shadows, too!

 

I made a version or the Coercion mission with this alternative lighting method.

 

Ambient_world method:

WnITOva.jpg

Nightvision:

njw6Sut.jpg

 

 

Ambient_world:

d3FoKm7.jpg

Nightvision:

kd3YHLd.jpg

 

I know, it is difficult to see from the screenshots, but try it ingame yourself. Download link for Coercion Nightvision version:

https://drive.google...iew?usp=sharing

 

Enjoy! What do you think? Which one is better?


  • jaxa, nbohr1more, Moonbo and 6 others like this
Clipper
-The mapper's best friend.

#2 Sotha

Sotha

    Vertical Contest Winner

  • Active Developer
  • PipPipPipPipPip
  • 5490 posts

Posted 31 December 2016 - 08:54 AM

Implementing Nightvision in your FM is ultra easy. You need:

1) the script given here:

void update_player_nightvision()
{

vector adjusted_origin;
adjusted_origin=$player1.getOrigin() + '0 0 64'; //must adjust origin a bit higher so that the light is in the players head.

$darkvision.setOrigin(adjusted_origin);

}

2) a trigger_timer (start_on 1 ; wait 0.01)

3) a atdm:target_callscriptfunction (call update_player_nightvision)

4) have the trigger_timer to target the atdm:target_callscriptfunction

5) a light called "darkvision" (I used for Coersion version: light_radius 400 400 400 ; noshadows 1 ; texture lights/biground1 ; _color 0.024 0.024 0.059)


  • TheUnbeholden likes this
Clipper
-The mapper's best friend.

#3 nbohr1more

nbohr1more

    Darkmod PR, Wordsmith

  • Development Role
  • PipPipPipPipPip
  • 7288 posts

Posted 31 December 2016 - 10:18 AM

I assume that you are using ai_see 0 to ensure that the attached light doesn't bother the lightgem?


Please visit TDM's IndieDB site and help promote the mod:

http://www.indiedb.c...ds/the-dark-mod

(Yeah, shameless promotion... but traffic is traffic folks...)

#4 Sotha

Sotha

    Vertical Contest Winner

  • Active Developer
  • PipPipPipPipPip
  • 5490 posts

Posted 31 December 2016 - 10:20 AM

The attached player lamp is low in light intensity that it has no effect on LG, but it is bright enough to light the surroundings visibly.
  • jaxa likes this
Clipper
-The mapper's best friend.

#5 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 31 December 2016 - 10:23 AM

I played for a little while.

 

1 - Provides darkness that's more real than when a general ambient is used.

 

2 - Every nearby surface reacted like I was wearing a miner's cap casting a faint blue glow. The metals became shiny blue as I approached, and the walls showed a point source of blue moving across them as I walked along.

 

3 - After dousing a few torches and candles, the middle and far distance became black, and I couldn't see any oncoming guards. I could hear them, but not see them. At the end of my test, a heretofore unseen guard swept out of the black yelling, "Now I've got you!" and I was dead.

 

4 - I passed a guy sleeping on a bed in a blackened room. I didn't know he was there until he woke up and asked if someone was there.

 

5 - Doors popped into existence (surprise!) as I approached and they suddenly highlighted. Less realistic than seeing the door first and then having it highlight when I closed in on it.

 

I would probably adjust the blue light to grey and tone it down some, to reduce the "miner's cap" effect.

 

I want to try this in an outdoor scene and see what it looks like. WS4 is mostly outdoors in a rainstorm with an overall bluish ambient. Surviving requires seeing oncoming patrolling guards, and I'm wondering if the nightvision approach would enhance or diminish the experience.


  • Sotha and TheUnbeholden like this

#6 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 35809 posts

Posted 31 December 2016 - 10:37 AM

Thief 4 used a hybrid approach, which might be a good compromise.

 

 I would remove the specular stage from the light attached to the player so you don't get any gleaming.


Posted Image

#7 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 31 December 2016 - 10:42 AM

Thief 4 used a hybrid approach, which might be a good compromise.

 

 I would remove the specular stage from the light attached to the player so you don't get any gleaming.

 

What did T4 use?



#8 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 35809 posts

Posted 31 December 2016 - 10:43 AM

I don't know the technical details, but they had a low-level ambient (dark areas were not totally dark), and areas in a small radius around the player were lit up further.


Posted Image

#9 Sotha

Sotha

    Vertical Contest Winner

  • Active Developer
  • PipPipPipPipPip
  • 5490 posts

Posted 31 December 2016 - 10:44 AM

Thanks for the feedback! I would be really pleased if you found this useful.

In my tests, with the test map, I could see clearly stuff in darkness within 200 units of so (the lamp radius is 400 units.) Thus, I believe it is a monitor brightness thing, and you would probably get a better experience with slightly increased gamma levels, or touching up the darkvision lamp light level a bit in the .map file.

Now that I think about it, the Nightvision should be re-calibrated in the TDM gamma-room so that people have matching experience. Monitor brightnesses will vary.
Clipper
-The mapper's best friend.

#10 grayman

grayman

    Master Builder, Coder

  • Active Developer
  • PipPipPipPipPip
  • 11493 posts

Posted 31 December 2016 - 11:50 AM

To simplify the triggering part, you could just bind the light to the player at the appropriate spot.



#11 demagogue

demagogue

    Mod hero

  • Active Developer
  • PipPipPipPipPip
  • 5090 posts

Posted 31 December 2016 - 12:01 PM

I like the idea. I remember thinking about trying it before.

I'll try it out.


Posted Image

#12 Springheel

Springheel

    Creative Director (retired)

  • Admin
  • 35809 posts

Posted 31 December 2016 - 12:18 PM

It has been tried out before:  http://forums.thedar...ased-on-player/


Posted Image

#13 kingsal

kingsal

    Member

  • Member
  • PipPip
  • 157 posts

Posted 31 December 2016 - 03:15 PM

Very cool! I like the effect you have here.

 

Have you tried out any of the other light textures? It might benefit from a stronger falloff- so objects appear / disappear at a shorter distance.  I would say that a combination of this and world ambient is a pretty elegant solution for most FMs.  However, I would be mindful of the blue coloring as some people might find it jarring.


Edited by kingsal, 01 January 2017 - 05:30 AM.

  • Anderson likes this

#14 Spooks

Spooks

    Member

  • Member
  • PipPip
  • 298 posts

Posted 31 December 2016 - 03:18 PM

To put my lot in, I would suggest you use atdm:ambient_world instead of a generic light entity for the bound light. This way, when you set up locations, you can adjust the ambient light colours in those and atdm:ambient_world would react accordingly, allowing you to give the light location-appropriate tints.


Edited by Spooks, 31 December 2016 - 03:20 PM.

My FMs: The King of Diamonds (2016)

 

Visit my Mapbook thread sometimes!


#15 jaxa

jaxa

    Advanced Member

  • Member
  • PipPipPip
  • 1153 posts

Posted 31 December 2016 - 04:15 PM

Happy new year, I'm in your closet.



#16 Obsttorte

Obsttorte

    Scripting guru, Mapper

  • Active Developer
  • PipPipPipPip
  • 4733 posts

Posted 09 January 2017 - 05:26 PM

To put my lot in, I would suggest you use atdm:ambient_world instead of a generic light entity for the bound light. This way, when you set up locations, you can adjust the ambient light colours in those and atdm:ambient_world would react accordingly, allowing you to give the light location-appropriate tints.

  • the ambient_world light is rendered differently from the other lights, so it might not yield the desired effect
  • if you want to adjust the light bound to the flame you can alter the scriptobject handling the locations (tdm_locations_settings.script or something like that). the script is intuitive and well documented as far as I remember

FM's: Builder Roads, Old Habits, Old Habits Rebuild
WIP's: Several. Although after playing Thief 4 I really wanna make a city mission.
Mapping and Scripting: Apples and Peaches
Sculptris Models and Tutorials: Obsttortes Models
My wiki articles: Obstipedia
Let's Map TDM YouTube playlist: ObstlerTube
Texture Blending in DR: DR ASE Blend Exporter

End of shameless self promotion.



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users