Torches, Spotlights update from the Q&A March 2014

    Joined
    Jul 1, 2013
    Messages
    57
    Reaction score
    3
    I have been thinking we do need personal lights on our character and in ships.

    What Calibri stated in the Q&A and afterwards to me in the MushroomFleet Chat room was the difficulty in showing personal torches cast upon an area without lagging out (paraphrased).

    Well I have now come up with a solution that could be copy and pasted from other parts of the game, or using their core functions.

    The player (Helmet Light) - The flash-light (US) or a torch (To others *grins*) is attached to your helmet and can be updated to be more powerful, but that is MUCH later. You turn it on and off with a keybinded press and then the cursor becomes the focus of the beam that is NOT a beam. What the light effect is is a no-clip coloured light (depends on the colour of the torch equipped helm) that is projected from the cursor like when in build mode for the block placement cube. This will move the light from cube to cube and show as if it IS a plex light. This would allow the lighting system to render the light from the player JUST like a Plex light keeping the system quick and not requiring any large amounts of new code. It could have a maximum distance of 6-10 blocks (depending upon the strength of the light source). The Helmet MUST be worn for this to work.

    The Ship (Plex-Spots) - Same as the player, but they are based on Plex-beacons that can be toggled on and off with a keybind press and turned in the 6 directions. BUT lights will only illuminate if there direction is the same as the core or cockpit currently in. This will allow landinbg lights for cockpits looking down etc. Each light can take up power when used, but the ship calculated the number of lights shining to increase the distance the light can shine. Similar to the helmet light, but using MORE blocks instead. Clever builders could even put in spot lights INside a ship with cockpits and Plex-Spots. Also when you change cockpit there is a simple if statement to turn on and off plex-spots as needed.

    if( leavingCockpit )

    if( PlexSpotsOn )

    if( PlexSpots[CurrentDirection] == leavingCockpit->direction )

    if( !PlexLights[newDirection] )

    break;

    PlexLights[CurrentDirection].ON = false;
    PlexLights[newDirection] = true;

    PlexLights[CurrentDirection] = PlexLights[newDirection];

    PlexLights[newDirection] = 0;



    So to make a new personal light series all we need is to:

    *Use a copy of the build block placement system to project a no-clip Plex-Light per frame

    *Keybind to turn on/off Helmet/Plex-Spots

    *New Block type - Plex-Spot

    I hope this helps.