User login

Navigation

Poll

I downloaded the ETQW demo and....
...I'm too busy playing for polls.
14%
...it's awesome.
43%
...it's okay, I expected better.
14%
...I'm lost in the valley, anyone have a map?
0%
...my machine won't run it. :-(
29%
Total votes: 7

Who's online

There are currently 0 users and 30 guests online.

Welcome to RUST | Gamedesign.net

Light

Submitted by KaMiKrAe-Z on Fri, 2003-11-07 23:48.

Quake 2 Light Entities

  • light
  • light_mine1
  • light_mine2

    Download Sample Map

    light


    Ask any level designer what the most time consuming part of level design is, and they will most likely answer: lighting. The fact is, lighting isn't that difficult in implementation, but rather in choices of lighting, and the amount of options available. We'll try to break down the choices here.

    Lights, since they are just point entities with working defaults, are among the easiest entities to add, but the actual method varies from editor to editor, so check the docs for yours.

    Now, on to the good stuff. Here are the flags and fields, and their uses:


    LIGHT
    This is the brightness of the light. Default is 300. The fall-off distance of the light is proportional (the brighter the light, the further it shines.)

    In order to change the light value, simply add a key of "light" with the desired keyvalue.

    One thing worthy of mention. Light entities differ from lit surfaces, in that the amount of light that a surface emits is dependent on the size of the face, whereas two light entities with the same "light" keyvalue will always emit the same amount of light, regardless of color. (which is why software Q2 always looks so bright)


    _COLOR
    (Note, a value prefixed with an underscore means that the key will be ignored if the default is not applicable. This is why "color" works here as well. It's good practice to always include the underscore, even if it works without it.)

    This is the color that the light entity will emit. The actual color is determined by a set of three numbers between 0 and 1, representing red, green, and blue, respectively. The _color values are proportional, meaning that a value of "0.1 0.1 0.1" would give you exactly the same thing as "1 1 1", and "0.5 1 1" would give you the same as "0.25 0.5 0.5"

    Example
    "_color" "0 0 1" would emit blue light in gl
    "_color" "1 1 1" would emit white light in gl
    "_color" "0.5 0.5 0.5" would emit white in gl
    "color" "1 0 0" would emit red light in gl, but kick out a "color is not a field" warning in software. (moral: use the underscore)


    STYLE
    The style key determines whether or not the light will be a dynamic light, and if so what pattern it will follow. The default is 0 (static).

    Here are the values, and their patterns. 'a' represents total darkness, and 'z' represents double brightness. 'm' is normal brightness (nabbed from the gamex86 source):

    • FLICKER (first variety): "mmnmmommommnonmmonqnmmo"
    • SLOW STRONG PULSE: "abcdefghijklmnopqrstuvwxyzyxwvutsrqponmlkjihgfedcba"
    • CANDLE (first variety): "mmmmmaaaaammmmmaaaaaabcdefgabcdefg"
    • FAST STROBE: "mamamamamama"
    • GENTLE PULSE 1: "jklmnopqrstuvwxyzyxwvutsrqponmlkj"
    • FLICKER (second variety): "nmonqnmomnmomomno"
    • CANDLE (second variety): "mmmaaaabcdefgmmmmaaaammmaamm"
    • CANDLE (third variety): "mmmaaammmaaammmabcdefaaaammmmabcdefmmmaaaa"
    • SLOW STROBE (fourth variety): "aaaaaaaazzzzzzzz"
    • FLUORESCENT FLICKER: "mmamammmmammamamaaamammma"
    • SLOW PULSE NOT FADE TO BLACK: "abcdefghijklmnopqrrqponmlkjihgfedcba"



    12-31 open for modification

    32-62 reserved by QRAD3 for switchable light styles, and 63 is reserved for testing

    In order to make a dynamic light, simply add a key of "style" and the appropriate value. (ex: "style" "5" will make a pulsing light.)


    TARGET/INFO_NULL/SPOTLIGHTS
    A light entity can only target one thing: an info_null. What happens when you target an info_null? a spot light happens. (woo) Personally, I dig spotlights, and use them a lot. Here's how you do it.

    Create a light. Give it a "target" key, and a keyvalue (we'll use "spot1".) Create an info_null at the place at which you want the spotlight to point. Give the info_null a "targetname" key, and keyvalue (again, "spot1".)

    Now, what if you want a wider spotlight? Well, that's why we have...


    _CONE
    The default _cone value is 10. The higher the value, the wider the spot. To use it, add the "cone" key, and the desired value to the light entity.


    Switchable lights
    Let's say we wan't a light to be turned on or off by some other event (be it a button, trigger, etc..) What we need to do in this case, is to set up the triggering event (in this case, a func_button) and give it a "target" (we'll use "lt1".) Now, we need to create a light, and give it a "targetname" of "lt1". We now have a light that turns off when we hit the button. If you would like the light to turn on when you hit the button, set the start_off spawnflag for the light.

    light_mine1

    light_mine2


    The light mines are simply predefined lights that are the lights that were used on the mine levels in quake2. They act like normal lights they just have a predefined shape. Here are pics of them.


    light_mine1


    light_mine2



    NOTE: If you want to rotate a light_mine (1 or 2) you have to give it an "angle" key.


    _minlight
    _minlight is a very strange key value pair that can be used with certain entities like func_door, func_button, func_rotating, etc, etc. Basically any visual entity except the item entities. What it does is makes the object glow. Lets say you have a very dark room and there is a button the player has to press but it is so dark that the player is not going to be able to find it. Well, this is where _minlight can come in very handy. Select the func_button entity and give it a key value pair of _minlight and a value of 1. This will make the func_button glow a faint white so it will be more visible.

    The glow from _minlight does not make the surronding area any brighter, just the object that has the _minlight value.

    The values for _minlight should be between 0 and 2. I have not noticed any difference with exteremly high values. 2 seems to be the max.

RUST | Gamedesign.net is your source for all the latest game-editing news and tutorials. If you are seeing this message, this means that you are using a browser that does not support CSS. Please upgrade your browser and enjoy your stay at RUST and if you have any questions, comments, or suggestions, please contact a site administrator.