Jump to content


Photo

dayZ Night Lighting

dayz epoch house lights illuminant tower lights

  • Please log in to reply
28 replies to this topic

#1 axeman

axeman

    Epoch Developer

  • Moderator
  • 523 posts

Donator

Posted 15 October 2013 - 10:37 PM

The latest patch has the culmination of all of the work done on lighting so far for dayZ.
 
Street Lights: The street lights are enabled by default, adding the lighting system allows you to set a failure percentage. The lower this is set the more the street lights will flicker off and fail.
 
House Lights: Currently buildings that can not be entered will be lit, this is also based upon the lighting percentage, the higher this is the more houses will be lit.
 
Illuminant Towers: The towers that can be climbed that have a spotlight on each corner will be lit..
 
New Features:

  • House lights are now brighter at a distance. This allows the player to see distant houses up to 600m (with default settings can be set to 1km). During the night when running from the coast or through the forest heading north, this is a beacon, an oasis in the dark guiding your player to the next town..
  • Generators: Placing a generator will effect the surrounding lighting depending on your settings. If a generator is required it will light all illuminant objects within it's range. If a generator is not required houses will be lit yet a placed generator will force the surrounding lights to be 100% reliable (this allows a low lighting percentage and enabling of lights through generator placement).
  • Chance: Set this high or low, I like a very low chance of lighting, this fails lots of street lights causing them to flicker and go off.. House lights are few and far between yet generators cause all of the surrounding houses and street lights to be lit also.

See the dayZ Epoch Lighting Wiki for more details and put any feedback or questions about the lighting system here..
 
To enable the lighting simply uncomment the line at the bottom of your init.sqf to look like this:

//Lights
[0,0,true,true,false,56,280,600,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

Being stalked by several zombies through a dimly lit night time village..? 


  • vbawol, bFe and caboose1 like this

#2 drunkenjawa

drunkenjawa

    Survivor

  • Member
  • PipPipPip
  • 98 posts

Posted 24 October 2013 - 10:46 PM

I had a question about this: By the way, with this lighting system, nights are sooooo much better on Lingor now :D We are no longer perma day because of this feature, so thanks a lot for that :)

 

I have mine set up like this, basically just the default that doesn't require the generator to light up houses etc:

 

[0,0,true,true,false,58,180,440,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

 

I also have a helipad that's sitting approximately 4 stories high, with a few light poles around it. Sometimes the lightpole lights work, other times they don't - figured that was just because of the random chance setting and I like that idea. However - I have a generator set up on the bottom floor, about 100m away.

 

Now assuming I understand it correctly, turning this generator on (it was placed there before the lights were built if that makes any difference) should automatically light my lights up if they aren't going, within 180m? Because they aren't being lit up. I was wondering if I possibly needed the generator on the same level e.g. 4th story, as opposed to on the ground, to pick these lights up?

 

I will try placing a generator directly underneath it soon, but pretty sure it's within that 180m range in a straight line. I can still hear the generator going itself, however they aren't the most stealthy of machines lol



#3 axeman

axeman

    Epoch Developer

  • Moderator
  • 523 posts

Donator

Posted 25 October 2013 - 08:49 AM

Glad you like them :)

 

The plot poles shouldn't be effected by the lighting code currently, I will double check with the latest patch. Arma does have a built in limit on how many lights can be seen at once. I have noticed with the plot poles that this limit seems to kick in a lot earlier.

 

As you walk around you will notice lights 'coming on' as you get closer and others, behind you, going off. This is the engine balancing the lights that can be seen. One way to demonstrate this is to park loads of cars, about 10, all with their lights on, ideally in a city / town car park which also has lights on.. Then walk up and down the row of cars..

 

When you are on the helipad are the lights lit ?



#4 Simbo

Simbo

    Newbie

  • Member
  • Pip
  • 1 posts

Posted 25 October 2013 - 05:35 PM

Just like to say thx for the work u have done , a good lighting system adds so much ambience to the game .

My question is that the other day we placed a few light poles up around our base but after about 4 days they seemed to have stopped working and are missing the bulbs out of them , is that normal and we have to destroy and replace the whole things every few days ? :unsure:



#5 axeman

axeman

    Epoch Developer

  • Moderator
  • 523 posts

Donator

Posted 25 October 2013 - 05:53 PM

I will check. To be honest I haven't done a great deal with the light poles beyond testing them for any conflicts with the lightning system.

Sounds odd, i know :) the light poles use the asc_eu bulbs and were in game before I started adding the rest of the lights.

My first thought would be have they been shot out ? I will also check if they degrade like other base items.

I will be bringing the light poles into the overall light system and, if feasible, would like to use the bulbs for all of the street lights.

And thanks, glad you like the lighting.

#6 drunkenjawa

drunkenjawa

    Survivor

  • Member
  • PipPipPip
  • 98 posts

Posted 29 October 2013 - 05:31 AM

Sorry - will be testing this tomorrow then will update!



#7 drunkenjawa

drunkenjawa

    Survivor

  • Member
  • PipPipPip
  • 98 posts

Posted 31 October 2013 - 07:25 PM

Well it never got to night time during my testing period lol - I will update here though as soon as I get a chance!



#8 drunkenjawa

drunkenjawa

    Survivor

  • Member
  • PipPipPip
  • 98 posts

Posted 04 November 2013 - 08:41 PM

Sorry - I never got to test this at night, and now my base has started despawning, taking the helipad and lights with it, so I can't test it now. Incredibly frustrating.



#9 boxman80

boxman80

    Hardened

  • Member
  • PipPipPipPip
  • 194 posts
  • LocationHartlepool, UK

Posted 26 November 2013 - 12:45 PM

Has anyone had any problems with desync with this script enabled on night times? We get some horrendous de sync that makes the server unplayable on a  night time and im wondering if this could have something to do with it. Anyone else encounter this? 


DayZcraft - Build, Kill, Survive!

b_560_95_1.png

Provided by The BSB Network - Gaming for grown ups!

 


#10 axeman

axeman

    Epoch Developer

  • Moderator
  • 523 posts

Donator

Posted 26 November 2013 - 01:53 PM

What settings do you have on your init ? Do you have any server packs installed ? Some of them come with the early standalone version of the lights..

#11 calamity

calamity

    Hardened

  • Member
  • PipPipPipPip
  • 348 posts

Donator

Posted 02 December 2013 - 06:14 PM

thankz for this too. workz great



#12 boxman80

boxman80

    Hardened

  • Member
  • PipPipPipPip
  • 194 posts
  • LocationHartlepool, UK

Posted 03 December 2013 - 11:03 AM

What settings do you have on your init ? Do you have any server packs installed ? Some of them come with the early standalone version of the lights..

 

 

We've got nothing out of the ordinary installed (safe traders, AI, side missions , a few custom map edits, etc) and certainly nothing specific to lighting. I commented out the lighting section in the INIT file and now the lag has stopped. 


DayZcraft - Build, Kill, Survive!

b_560_95_1.png

Provided by The BSB Network - Gaming for grown ups!

 


#13 Starkvix

Starkvix

    Newbie

  • Member
  • Pip
  • 3 posts

Posted 06 December 2013 - 06:48 AM

I have added street lights to our admin camp but they do not work at night.  Do I have to edit //axeStreetLights = compile preprocessFileLineNumbers "\z\addons\dayz_code\compile\local_lights_street.sqf"; in local lights ini to get them to work.  Please let me know what to do.  Thanks!



#14 axeman

axeman

    Epoch Developer

  • Moderator
  • 523 posts

Donator

Posted 08 December 2013 - 10:45 AM

If they are the standard streetlight objects they should light on their own along with the map ones.

What class names are you using for them ?

#15 MadHatter05

MadHatter05

    OG Member

  • Moderator
  • 126 posts
  • LocationVirginia, USA

Donator

Posted 12 December 2013 - 05:50 AM

Does anyone else experience massive server desync / lag when this is turned on? (when the server switches from day to night and lights activate)


MadHatter05

pu2X2RN.pnggbWsXlj.pngexxYmAt.pngiTjAAmf.pngcCUxOQY.png

Gamer, Streamer, IT Professional.


#16 axeman

axeman

    Epoch Developer

  • Moderator
  • 523 posts

Donator

Posted 12 December 2013 - 09:22 AM

I have been having a good look at this and am pretty the issue is with the lightpoints syncing between clients. Most likely as they are failed, have tested this and found that players can see the same lights going off, even though it should be a local effect some syncing is definitely going on.

 

The worst kind of desync I have seen is when 2 people, at least one with a high ping are attempting to sync, try getting in a vehicle on a server when you have a high ping and the driver has a low ping for a similar example.. In relation to the lights I believe that everyone is running the script which randomly fails a light, they most likely will fail different lights and then those light failures are being broadcasted to all of the other players.

 

I am going to remove all of the 'fancy stuff' from the lights and make them static, probably reduce the numbers in the early days and give it another good test. 

 

Lights are a strange beast in Arma, am going to have to test just how far the syncing goes on too, if a tower light is created in Cherno does a player at Stary get the information ?



#17 silvan78

silvan78

    Newbie

  • Member
  • Pip
  • 6 posts

Posted 07 January 2014 - 09:05 PM

Could i request few more craftable light sources.. like airstrip light, table lamp, ceeling /wall lamp?



#18 yani9o

yani9o

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 26 January 2014 - 07:32 PM

I'm having a little bit of a problem with the lightning (or i'm just to stupid to get it right, or it's not meant for that purpose at all xD):

 

I would like to do the following: No lights at all (no street-lights, no house-lights, not even the crafted ones), ONLY if you set up a generator nearby (so you have to create a generator-network to light up a city or your newly made camp xD)

 

Is that possible somehow?

 

My settings at the moment:

 

[0,0,false,false,true,0,100,0,[0.698, 0.556, 0.419],"Generator_DZ",0.1] execVM "\z\addons\dayz_code\compile\local_lights_init.sqf";

 

Start and end-time are the standard, house and street lights off, generator option yes, to be sure, make the "fail"-chance to zero. - what am i doing wrong?

 

thanks for helping and sorry if i oversaw something obvious...

 

I searched the web for an hour now >.<



#19 axeman

axeman

    Epoch Developer

  • Moderator
  • 523 posts

Donator

Posted 26 January 2014 - 10:48 PM

Have just put in a totally re-written lighting system for testing, is available from my github, currently as a mission: https://github.com/a...r/dayZ-Lighting

 

There is an option in there to turn off street lights, I put it in purely to see the brightness of the house lights without the additional ambient lighting created by the street lights.

 

Line 11 of local_lights_init.sqf change to 

_noStreetLights = true;

this will scan for all street lights within the set radus from the player (currently 600m) and switch them off. Creates a nice effect as you can see lights at a distance but all the local lights are off.

 

These current lights do have a generator option, current testing has only been fully carried out with it set to false, all of the generator code is the same as before so should work just the same.. in init.sqf use:

[true,12] execVM "lights\local_lights_init.sqf";//[REQUIRE GENERATOR (true/false),Light Chance %]

Again, generator requirement not tested. The 12 indicates the percentage houses that will be lit in the area..

 

 

TESTING:

 

If you want to try it out, comment out the existing lighting code (in init.sqf) and add this as a mission from the github. I would very much appreciate some feedback as I am confident that I have fixed the lag issue.

 

 

LAG ISSUE:

 

When setting a house to animate one  of it's AnimationSources, i.e lighting up the window, that is broadcast across the network, regardless of any setting. I have now based the lighting system on this requirement. Lights must be created by each player to be visible (house windows do not), before a player would wander around and light houses randomly based on a percentage, if the player stood in the same spot eventually all house lights would come on..

 

When I talk about lights / lightpoints, these are #lightpoints, exactly the same as a vehicle headlight. A house window will provide light to the window but provides no ambient lighting, so the surrounding is still dark, this is where this lighting system comes in as a lightpoint is created and managed. If a player logs the light will lose it's parameters but will still exist as an object. Another player can not see the parameters but can see a globally create lightpoint (which is why they are now local objects only).

 

Now only lightable houses are selected and a strict control is kept over the number of houses lit, also if one player lights the houses, other players will see those and will light no more. You should be able to have 10 people stand in Cherno and only 12% of the available houses will be lit and all players will see the same houses lit. AFter which no more houses will be lit. Additionally, as you walk out of the area there is a band around the full radius where lightpoints are deleted, a cleanup of sorts, probably not totally required but I like to clean up after myself ;)

 

Tower lights are still the same and tested, they are so few and far between that they won't cause an issue. I have currently removed the random failure of lights as this only adds to the netcode traffic. If testing pans out I will be adding in one or two 'failed lights' per 1km radius but want to have sparks and sounds to make it really worthwhile..

 

I believe, with this now, Arma will deal with the netcode assuring that lag will not occur over distance, as people at NWAF have no need to know the state of lighting in Cherno, I would assume that it would be safe to light all houses as the map should be designed to handle all houses to be lit at night, to be tested on a busy server and lightpoints to be taken into consideration too :) 

 



#20 yani9o

yani9o

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 26 January 2014 - 11:15 PM

Tested it, just commented out the existing line for the lightning and added you new line at the end of the init.sqf (and put in the files from github in the lights folder) => nothing changed, still all lights on ^^






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users