1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

[Poll] Are you guys interested in colored lanterns?

Discussion in 'Groups' started by -Q, Mar 28, 2015.

?

Are you guys interested in colored lanterns?

This poll will close on Jul 28, 2098 at 1:27 AM.
  1. No.

    1 vote(s)
    14.3%
  2. Yes.

    6 vote(s)
    85.7%
Thread Status:
Not open for further replies.
  1. -Q

    -Q Donator

    Messages:
    153
    I am. I've been designing a mod that provides very refined colored lanterns, called "Q's Perfect Lanterns". Here's a screenshot from an earlier build:

    perfect_lanterns_v2.png

    Here's the current feature list:
    • Six colors: red, green, blue, yellow, cyan, magenta. These are the primary and secondary colors, which are optimal when mixing colors.
    • In addition to casting light, the colors of the lantern sprites themselves change, allowing you to have blue and green fire. The inventory icons change color as well, and the lantern becomes named with the color.
    • To change the color, you simply hold the "interaction" key that you normally use with buildings. It allows you to increment through the six colors, then loops back to the default "white" light.
    • The floating button to change the color displays the next color name, as well as a picture of the next colored lantern.
    • Can place on wood, stone, and dirt back-wall at your cursor using the "throw" key. If your cursor is not over a good position, you will throw it instead.
    • When placing, it beautifully auto-aligns to the tile grid.
    • You can easily pick it back up off of the wall using the normal pickup key.
    • It detects if you try to place it behind walls, or in water, and disallows you from doing so.
    • If it's hit with an arrow, it pops off of the wall.
    • If the structure to which it is attached collapses, it will collapse as well.
    As you can see, I've put an immense amount of detail in these lanterns. Here's a few more recent screenshots, displaying the updated inventory icons and sprites.

    perfect_lanterns_v3_screen1.png perfect_lanterns_v3_screen2.png perfect_lanterns_v3_screen3.png

    There's also a few technical features in the mod I'd like to highlight as well

    Technical features:
    • All functionality in encapsulated in the Lantern.as and Lantern.cfg files, with no external dependence. It does not modify any shops or other scripts.
    • There are no new script files or sprite sheets, only those that overwrite the vanilla lantern data. This makes it easy to install, and minimizes any possible linking errors.
    • The mod emulates all of the normal back-end behavior of the original lantern, so any scripts dependent on a 'normal lantern' will work perfectly.
    • Most importantly, nearly all of the extra functionality is implemented in hook functions. That means although there is a lot of code, it only executes once. The tick function of the lantern is disabled while being held, while being on the ground, and while being in the inventory. The only time it ticks is while it is placed on a wall... and then, it ticks a miniscule 4 times per second, to check if the wall is collapsed or not.
    • This means that this script is efficient, and has very low computational overhead.

    As well, I have a few advanced ideas I've been wanting to try to implement:

    Planned features:

    Color menu with sliders:
    A configurable color menu, with sliders that allow you to define your own color. It will then detect the closest lantern sprite in color, and display that as the sprite, while casting the color you chose. For simplicity, it will have the 6 default colors as buttons in the menu. This is so that you don't have to mess with the slider every time you want to change the color of a lantern.

    Better falling:
    Make it so performing any damage on the lantern causes it to fall, not just on arrow collision.

    Animated inventory icons:
    I have an idea for animating the inventory icons themselves - so you will see the lantern in your inventory actually flickering in the current color.

    Circuit system to sync up multiple lights to a single color at once:
    If you had a normal lantern, you could open up its "color menu" and spend coins/material to convert it into a "control lantern" which you would then be able to use to spawn "child lanterns". The child lanterns would automatically update their color with the settings in the control lantern, allowing you to choose the color of an entire base from one control room. The ability to change the color would be disabled from the child lanterns. If the master lantern was destroyed, the child lanterns would be destroyed also. The master lantern would have a unique sprite and inventory icon, and extra health. On opening the "control lantern" menu, you would see blue lines going from your control lantern to the various child lanterns.

    Ability to burn wood inside a lantern to make it have a larger light radius:
    Like the control lantern, you would upgrade a normal lantern to this version. This "explorer's lantern" would then have an inventory inside it, which you could place wood in. This wood would act as a fuel to allow a large viewing radius, but the wood will be burned up quick while the lantern is on. So, it would be best to conserve the fuel. There would be a HUD element next to your character while you were holding the lantern, displaying the current fuel, similar to the element used for displaying ballista charge. You would be disallowed from placing this cave lantern on walls, and will automatically turn itself off if dropped or placed in your inventory. It would have only one color, "white" light. In effect, it would only work while being held. This is to prevent people from using it to light up a base, which would not be its purpose. Because of the expense in making it, it would have extra health.


    I do hope Aphelion will allow me to add this to the roleplay server, if you guys want it, that is.
     
  2. pmattep99

    pmattep99 Drill Rusher
    1. Aphelion's Roleplay

    Messages:
    34
    I don't think that a colored light is usefull in the game, but Team Colored lanterns with a normal light could be usefull ;)
    Increasing the radius with wood, placing with a click and circuit system could be usefull and cool too.
     
  3. king-george

    king-george Haxor Staff Alumni Tester

    Messages:
    284
    This would be laggy, as the server has already a lot of features. It would also be annoying because all lanterns would have this button on it(when you press E).
     
  4. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    If a modder manages to make that slow, he really sucks, m8.
     
  5. -Q

    -Q Donator

    Messages:
    153
    It is as Asu said.

    Lag is a valid concern. But, the script only ticks when it is placed onto a wall, and that is only 4 ticks per second per lantern, which is miniscule. Most scripts tick constantly at 30 ticks per second. I made sure to pay attention to efficiency because of the currently existing lag issues.

    Also, the amount of code itself does not cause either cpu or memory based lag, because the 'code' itself is not copied for every object. All that matters is how often it ticks.

    The reason why lantern spam is laggy is because of rendering all those light sources.

    More importantly, there are two methods to make every lantern having a button less annoying, one simple and one hard:
    • First method: Have it so the button only generates when the lantern is being held.
    • Second method: Do away with the button, and have a menu pop up when you press F, which would then allow you to toggle on/off and switch colors.
    Although, it isn't that annoying. The generic interaction button only appears when you are quite close to the lantern (within 16 pixels, that is)
     
    Last edited: Mar 28, 2015
  6. zhuum

    zhuum Builder Stabber
    1. Aphelion's Roleplay

    Messages:
    8
    Coloured lights seems quite nice idea, but as George has said. For now adding new blobs to the game/server may or will cause lag. If we were to add anything new we may need to reduce already few excisting things. The miniscule ticks would not much matter as when people would start to spam them around everywhere it will add up and glog up the server traffic (this is actually still one of the issues for now, bugging out the server).

    If anything else you plan on making make sure to pop them on suggestions thread. It is there for an reason ;)
     
  7. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    What have lanterns done to you? Lanterns are our future and supported us for so many years. Torchlights, gas lanterns, and now garden lanterns. There's even more. That's a single example. Lanterns followed the path of humanity for so many years that people can't imagine how important they are. Lanterns saved many people. Remember playing KAG classic? Would you get in a zombie dungeon without a lantern? And now, on release, did you see how many rats were spotted using lanterns? This is why we MUST defend lanterns rights. They're free to be black, white, or brown. Racism must be eradicated. We can never be satisfied as long lanterns are victims of the unspeakable horrors of griefers. We can never be satisfied as long our lights, heavy with the fatigue of lighting up rooms, cannot get lodging into specific holes in the roofes of the shops. I have a dream today.
     
    Last edited: Mar 30, 2015
  8. PinXviiN

    PinXviiN Haxor

    Messages:
    494
    I'm just going to say, but it absolutely doesn't change the FPS if this will be added. I mean, we are currently using lanterns too, right? Making houses and dropping the on the ground. So why does this make the server laggy? We won't start spamming them now, will we? And we have quite active admins, so when someone does start spamming, we can ban them, right?
     
  9. zhuum

    zhuum Builder Stabber
    1. Aphelion's Roleplay

    Messages:
    8
    If it is the same old lantern we can buy from workshop, but just with ability to chnage colour then yes it seems to be fine. But if it's going to be completely new blob then it might cause lag. As Aphe said in suggestions thread once, we are reaching the limit of modding content-wise. So for that it may be just given that some other features may be reduced.

    As for Asu, :P i have nothing against coloured lights. They are nice and cool idea. I know kag classic and loved them lights there.
     
  10. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    No, and anyways I don't know how could Aphe be worried about that while he's using a lot of blobs for a single thing. :p You also don't need to make that a different blob.
     
  11. zhuum

    zhuum Builder Stabber
    1. Aphelion's Roleplay

    Messages:
    8
     
Thread Status:
Not open for further replies.