RPGista 600 Report post Posted June 3, 2012 So I was playing the alpha game from the guys that created Penumbra and I noticed they had a neat simple feature in regards to the way ambient light works - like Doom3/TDM, in that game if there are no ambient lights in the map, shadows are pitch black, but there's a radius around the player inside which details start to become visible (around 15-20 meters?) - you start to see things gradually as you aproach a pitch black area (would probably be a simple way of simulating better eye perception at close range). Technically you could say its a very subtle omnidirectional lamp attached to the player, and what is good about it is that you can still see things you need when you are reasonably close to them, but far away areas are hidden from you, keeping their mysteries and surprises. Not only that, but even this simplistic aproach is a lot more realistic than TDM's ambient world light washing over the whole map as far as you can see to infinity, that literally kills the sense of darkness in several overbright missions (not even talking about the way it makes most textures look bad and washed out). I was wondering if this could be added to the mod somehow as an optional feature, or if it could be accomplished by a mapper without needing to edit the engine - I can see many situations where it would be desireable to keep the player immersed in true darkness, but still able to barely see close by things as he investigates them. Its hard to see in this video because there are generally lights around, but its visible in the flare scene, he throws the flare but you can see that the area around him is brighter than the far corners of the room (which are pretty much completely dark): http://www.youtube.com/watch?v=YaXDvR2sw-4 Quote Share this post Link to post Share on other sites
nbohr1more 1884 Report post Posted June 4, 2012 To be fair, the use of Ambient_World is supposed to be "just barely visible" and real lights aremeant to provide the illumination. Some mappers trade in brighter Ambient_World for performanceverses the former. Yes, several Doom 3 mods have attached an ambient light to the player to achieve something similarto the above. I believe the ambient in Sikkmod essentially does the same too but it's based onRebb's Ambient detection scheme. I have noticed when I walk my dog late at night that a different effect seems to come into play.Dim objects become blurry as they are more distant while illuminated objects seem to remain in focuslonger. This seems like a natural fit for targeted DOF... Quote Please visit TDM's IndieDB site and help promote the mod: http://www.indiedb.com/mods/the-dark-mod (Yeah, shameless promotion... but traffic is traffic folks...) Share this post Link to post Share on other sites
Tels 267 Report post Posted June 4, 2012 I think we should add "control doors and drawers" with mouse - then we can say we already got all what Penumbra got minus the physics Aynway,it is a shame they dont use the D3 engine, then we could use their work, too. Quote "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950) "Remember: If the game lets you do it, it's not cheating." -- Xarax Share this post Link to post Share on other sites
rebb 13 Report post Posted June 4, 2012 this simplistic aproach is a lot more realistic than TDM's ambient world light washing over the whole map as far as you can see to infinity, that literally kills the sense of darkness in several overbright missions (not even talking about the way it makes most textures look bad and washed out). I agree, the world-encompassing ambient is a too simplistic approach to the problem - and a world-encompassing system was never the goal of the "improved ambient" Doom3 shaders, it was local ones. Nothing should stop a mapper from using a very dark world-ambient, and strategically ( and carefully ) place local ambient lights around the map to approximate radiosity or draw subtle attention to an area. I believe Penumbra doesn't even use a special type of light, but a very low standard light attached to the player view. Quote Share this post Link to post Share on other sites
i30817 24 Report post Posted June 4, 2012 If you think something like this is better, why not make darkradiant have that as default instead of the current system? Quote Share this post Link to post Share on other sites
nbohr1more 1884 Report post Posted June 4, 2012 (edited) If I understand correctly, since the Ambient light shader has been broken into it's own VFP in 1.08,it will be much less expensive to use ambient lights for decoration and variation. Up till now thishas not been utilized much due to performance concerns. That said, several threads have had discussionsabout what the intended Ambient_World value should be verses what mappers appear to be doing. A possibly bigger problem is that some Monitors will make some Ambient_World values look too darkwhile others will be too bright. End User calibration would be the key here. If the Ambient_World level were strictly enforced to be very low that would curb these bad habits butwould reduce flexibility of it's use. It's probably not worth the argument to set that in stone. Edited June 4, 2012 by nbohr1more Quote Please visit TDM's IndieDB site and help promote the mod: http://www.indiedb.com/mods/the-dark-mod (Yeah, shameless promotion... but traffic is traffic folks...) Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 5, 2012 Yes, several Doom 3 mods have attached an ambient light to the player to achieve something similarto the above. I just tried binding the ambient_world light to the player and the binding dosent take - whats the actual namer of the player when you want to bind things to it..? I would like experiment with this and to that end -reduced its radius and moved the ambient_world to the blue room (so the game dosent complaint about it being missing).Then create a light with (7x7 at grid 7) normal ambient light and bind that to the player. Quote Share this post Link to post Share on other sites
Flanders 12 Report post Posted June 5, 2012 Don't attach the ambient light but a regular light. Quote Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 5, 2012 Yer, been trying that also - normal light with "texture/biground1" and the following binds - "bind" "info_player_start_1"bind" "info_player_start"bind" "player1""bind" "idplayer1""bind" "idPlayerStart" - but none of the above worked, an idea on the correct entity name of the player so I can bind a light to it..? Quote Share this post Link to post Share on other sites
rich_is_bored 281 Report post Posted June 5, 2012 I suspect key/value pairs won't work because they are initially processed during map load, prior to the player being spawned. A script should work. Quote ModWiki Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 5, 2012 Ah ok, I spotted a thread you replyed to over at D3W back in 2006, and you suggested the same then. But I have no idea how to knock up said script, can anyone help with this as I would like to see how this would look in-game with tdm. Quote Share this post Link to post Share on other sites
Tels 267 Report post Posted June 5, 2012 name your light entity "player_ambient_light" then: $player_ambient_light.bind( $player1 ); put that in the main routine of your map script. (player1 is only valid in single player mode, that is why that hack will never work for MP where there are more than one player) Quote "The reasonable man adapts himself to the world; the unreasonable one persists in trying to adapt the world to himself. Therefore, all progress depends on the unreasonable man." -- George Bernard Shaw (1856 - 1950) "Remember: If the game lets you do it, it's not cheating." -- Xarax Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 5, 2012 put that in the main routine of your map script. (player1 is only valid in single player mode, that is why that hack will never work for MP where there are more than one player) Cool I didnt think it was gonna be that simple (I remember seeing that on D3W). And when if at all with TDM become MP, and its a simple enough change to revert the ambient world light back to std. Quote Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 6, 2012 $player_ambient_light.bind( $player1 ); didnt work, get an error at map start saying that "player_ambient_light" isnt an object or something similar. Quote Share this post Link to post Share on other sites
Xcen 103 Report post Posted June 6, 2012 (edited) $player_ambient_light.bindPosition( $player1 ); void setup_objects(){ entity light; $light = sys.spawn( "light" ); $light.setShader( "lights/ambientlightnfo" ); $light.setRadius( 384 ); $light.setColor( .1,.1,.1 ); // $light.noShadows( 1 ); $light.bind( $player1 ); $light.setOrigin( '0 0 0' );} void main (){ setup_objects (); sys.print( "\n Ambientlight created!\n" );} Edited June 6, 2012 by Xcen Quote Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 6, 2012 Blimey, ok - will try this when I get home, thanks! One question though, will it work as its an ambient light, not a normal light.. Quote Share this post Link to post Share on other sites
New Horizon 470 Report post Posted June 6, 2012 If I'm understanding the desired effect (that the light trails off into the distance), you wouldn't want to use the ambientlightnfo as it has 'no fall off' in the radius. The problem with this approach though is that our AI depend on a world ambient in order to see in low light levels. This would be a pretty drastic change in how AI and level design interact in TDM. The ambient_world used in our missions is not supposed to be very bright, it's only supposed to be used to eliminate the pitch black Doom 3 shadows. Now that it has been broken off into a separate interaction shader, the performance has increased quite a bit on my machine. Quote Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 6, 2012 But if I set the radius big enough (Im thinking 6x6 at grid 7) to so its the same as the usual distance the Ai would be able to see the player anyway it would be fine. Removing the ambient work light complete dosen't stop the Ai from patrolling. The thing I found with the AW_light removed is a big increase in perf, one area that regularly where the DC count hits 2000 with the AWL in the usual configuration, dropped to 1300. Quote Share this post Link to post Share on other sites
New Horizon 470 Report post Posted June 6, 2012 It's not just for seeing the player though, the AI also need to see missing items, fallen comrades...etc. I'm pretty sure they rely upon ambient lighting to see in many cases. Now that ambient lighting is properly fixed, there is really nothing stopping us from placing multiple ambient world lights in different zones of the map. Tels already came up with a great way to adjust the ambient light on the fly with the old system, but now we should be able to truly customize the experience. We just need code to support it I suppose....so that the game knows how to transition from ambient_world_1 to ambient_world_2 and onward. With that type of system, the ambient lighting zones could be as big or as small as we wish them to be and completely customized for each area. I'm sure that could lead to some nice performance gains too. I'm a bit apprehensive about switching to a completely different system at this stage. Quote Share this post Link to post Share on other sites
Springheel 4350 Report post Posted June 6, 2012 It's not just for seeing the player though, the AI also need to see missing items, fallen comrades...etc. I'm pretty sure they rely upon ambient lighting to see in many cases. Yes, removing ambient_world would certainly have an impact on the AI. (though if there's no "ambient_world" the code just moves to the largest ambient and uses that instead, IIRC). Frankly, I'm not sure what the problem is that a player-attached light is supposed to solve. 1 Quote TDM Missions: A Score to Settle * A Reputation to Uphold * A New Job * A Matter of Hours Video Series: Springheel's Modules * Speedbuild Challenge * New Mappers Workshop * Building Traps Share this post Link to post Share on other sites
New Horizon 470 Report post Posted June 6, 2012 Frankly, I'm not sure what the problem is that a player-attached light is supposed to solve. It would certainly improve performance since there would no longer be a single light being drawn over the entire map at all times, but placing multiple world ambients throughout the map would achieve the same goal and provide even more diversity in terms of scene lighting. Would make more sense to me to do it this way since it wouldn't break the existing system. Quote Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 6, 2012 Yes, removing ambient_world would certainly have an impact on the AI. (though if there's no "ambient_world" the code just moves to the largest ambient and uses that instead, IIRC).Frankly, I'm not sure what the problem is that a player-attached light is supposed to solve. Are you saying that having no ambient means the AI would totally blind? rather than just not be able to see the player..? And mostly I am just curious to see how it looks in-game, but if if has tangible benefits and doesn't have negatively effect Ai ability to navigate then why not..? Quote Share this post Link to post Share on other sites
New Horizon 470 Report post Posted June 6, 2012 Are you saying that having no ambient means the AI would totally blind? rather than just not be able to see the player..? Yup. The AI depend on ambient light. I think that a light strapped to the player has fewer benefits than being able to create multple world ambient zones. 1 Quote Share this post Link to post Share on other sites
Bikerdude 3736 Report post Posted June 6, 2012 Would make more sense to me to do it this way since it wouldn't break the existing system.Hmm, the map I would like to try this one has 3 Zones, and would a prime candidate for having an ambient for each zone. Quote Share this post Link to post Share on other sites
New Horizon 470 Report post Posted June 6, 2012 It should be possible now with the source code for us to recognize any light with ambient_world in it and treat it accordingly based on whether or not the player is standing in that zone. Quote Share this post Link to post Share on other sites