Jump to content
  • 0

axeman

Question

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..? 

Link to comment
Share on other sites

Recommended Posts

  • 0

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

Link to comment
Share on other sites

  • 0

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 ?

Link to comment
Share on other sites

  • 0

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:

Link to comment
Share on other sites

  • 0

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.

Link to comment
Share on other sites

  • 0

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. 

Link to comment
Share on other sites

  • 0

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!

Link to comment
Share on other sites

  • 0

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 ?

Link to comment
Share on other sites

  • 0

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 >.<

Link to comment
Share on other sites

  • 0

Have just put in a totally re-written lighting system for testing, is available from my github, currently as a mission: https://github.com/andgregor/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 :) 

 

Link to comment
Share on other sites

  • 0

Yes i did, changed it to "true"

 

is it possible that my server somehow "reminds" old files or something? because it doesn't matter if i outcomment the original lightning in epoch or not, it looks exactly the same O_o

 

Have you got the new line (for the mission lights) in init.sqf:

if (!isDedicated) then {
        //Lights
        [false,12] execVM "lights\local_lights_init.sqf";//[REQUIRE GENERATOR (true/false),Light Chance %]
        };
Link to comment
Share on other sites

  • 0

Sorry was pretty busy last two weeks...

 

Yes i changed it and used your new line (but i had it on true -> requires generator, right?). But my server had a problem where it still "remembered" the old settings somehow (idk how that's even possible if i delete certain added scripts...).

 

I'll try it with the 1.0.4 Update again tomorrow or so. would be very nice if it finally works for me ^^

 

thanks for your help again :)

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
×
×
  • Create New...