Code Monkey home page Code Monkey logo

dayz-lighting's Introduction

dayZ Lighting - Designed for Epoch

House and Illuminant Tower Lights.

Current version should take into account previous lag issues causesd by lighting.

INSTALLATION:

This is currently a mission until testing complete:

Copy lights folder to your mission directory and call with:

USAGE:

From your mission init.sqf call:

if (!isDedicated) then { [false,12] execVM "lights\local_lights_init.sqf"; };

Parameters:

1: Generator required ? (Boolean) - If true a generator of class name "Generator_DZ" is required to light houses. (Currently not tested) So stick with false. Is using the old code for generator detection so should work fine..

2: Lighting Amount (percentage). Is a percentage of houses within 480m of the player that can be lit. Only houses with windows that can be illuminated are counted.

CHANGELOG:

When lighting a window on a house with "_house animate ["Lights_1",1];" the state of the house "animationPhase" is broadcast to all players on the server (this can not be changed). This was the previous cause of lag as each player created more lit houses. Every change was broadcast, ultimately all houses would be lit.

Additionally, randomly failed house lights and street lights were broadcast as changes. With no control over specific lights being failed each player randomly failed their 'own' lights and broadcast each change to all other players, causing too much network traffic.

This version uses the "animationPhase" of each house as the basis for lighting for all players (incl. JIP). There is a set amount of houses that can be lit within a radius, currently 480m from the player, that is decided by the percentage entered in the init (default = 12).

No matter how many players join there will never be more than 12% (unless changed) of houses lit within 480m of each player. Other players can only light more houses if the threshold is not reached..

OPTIMISATION: Additionally, there is a boundary around the edge of the lighting radius where lightpoints are deleted as the player moves out of the area. Existing lights' brightness is updated as the player moves around, more distant lights are brighter. No updates are made until the player moves 6m from their current position..

dayz-lighting's People

Contributors

andgregor avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.