[Mech] Lightz - Redstone-less Light Circuits for Indoor Lighting

Discussion in 'WIP and Development Status' started by Brain, May 24, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Brain

    Planned Features:
    • Circuits containing light blocks which can be separated into fixtures and buttons to toggle the circuit.
    • Uses WorldEdit selections and thus also supports the WorldEdit client-side HUD for selection visualization. Nice!
    • Circuits will have definable source blocks that need to be powered in order to make the lights go on. If not all source blocks are powered there is a chance that lights might temporarily flicker. The more unpowered source blocks the more likely the flickering gets. If no source blocks are powered the lights go off and stay off.
      Probably dropping this one for now because flickering means frequent world updates which can bog down the server severely.
    • Each circuit can define a breaker switch. If tripped the circuit will go dark and stay dark.
    • Togglable blocks: put a button on a block that is a supported lightblock and toggle it with each button press. No need to define any circuits.
    • Circuits can exhibit different behaviors:
      • "toggle": default and currently only implemented behavior: Light blocks can be toggled off and one with one of the circuit's switches. Fixtures switch in sequence. Ordering is derived from fixture name, natural order, ascending.
      • "always_on": this circuit will be always on. Unless you cut the power/trip the breakers.
      • "delayed_off": pressing a button will always turn on the circuit if it has power. After a configurable time it will go off again. Pressing the button again and again will reset the delayed_off timer.
      • "scheduled": circuit being switched on and off at certain times of day (server time)
      • "strobe": while activated will continously switch through all defined fixtures, lighting up each one individually.
    • Maybe, just maybe power supplies. Those would be furnaces. Place a sign in front of a furnace with the first line "[Power Supply]". The sign will attach to the furnace (like in Lockette). Place a switch next to the furnace and it will attach also. This will activate or deactivate the furnace. Fill it with fuel (bukket of lava, coal, wood, whatever), switch it on and it will produce power. If it runs out of fuel, no more power. If I make this I'm most likely putting it into a separate plugin.
    • Multi-world support
    • Permissions 3 support
    • Circuits have a list of owners. These are players who are allowed to modify the circuit.
    • Integration with jascotty2's Help plugin.
    • Circuit toggle spam may put excessive load on the server. Introduced a 500ms mandatory delay between handling button presses.
    • Block replace operations are now synchronized through BukkitScheduler. No more crashing Server thread.
    • Make lightblocks configurable in config.yml. Currently there is only one lightblock pair defined: mossycobble/lightstone.
      If the configuration file is missing, the plugin will use defaults and write a new configuration file.
    • Speed item (default: redstone dust): Right-click a fixture entity (lightblock, breaker, switch) equals "/lightz select <circuitID>". Left-clicking something equals "/lightz add" of a single block selection (the clicked block) into a new fixture.
    • Provide functionality to rename circuits (circuitID) and fixtures inside circuits.
    • Provide functionality to identify circuit parts (lights, breakers, switches). Right-click circuit part with an info tool (TBD). This will flash the lights three times with a one second delay and also replace the blocks on which breakers and switches are placed with glowstone in one second intervals.
    • Provide functionality to move individual circuit elements (switches, breakers, lights), preferably using an interaction tool (TBD).
    • Circuit listing:
      • /lightz list - show all circuits belonging to the player
      • /lightz list range <n> - show all circuits belonging to the player within a range of n blocks (Manhattan metric)
      • /lightz list all - show all circuits
      • /lightz list all range <n> - show all circuits within a range of n blocks (Manhattan metric)
      • /lightz list selected - shows all circuits in the world which are currently selected
      • Also sort the result list in natural order
    Known Issues:
    • When replacing torches with redstone torches make sure to keep the directional information!
    • When coloured wool is replaced it is always white!
    • Circuits are currently only stored in memory, thus they are lost after a reload or server restart. Currently working on storage... FIXED!
      Circuits are now stored in YAML files.
    • Current circuit states and power states are not saved. This information is lost on reload/restart. Implement separate state file that is saved periodically (60 seconds).
    • The anti-placement block listener which should only prevent redstone from being placed on top of light blocks also prevents anything else from being placed at or on light blocks (signs and other blocks)
    • Once you have a few dozen circuits defined loading/saving them is really slow. Need 4 Speed here!
    • Lights only work in parts of the map that are currently in memory. You can't toggle circuits at the other end of the world when nobody is there to keep the chunk loaded. It is possible to force loading of distant chunks, however this might be exploited to make the server crash (load too many chunks).
      Maybe there is a way to hook into chunk loading, determine if light blocks of a circuits are there and set them accordingly to the circuit state. Not sure if this is possible, requires more research. - Yes there is, currently working on it! - Solved!
    Known Limitations:
    • Currently none!
    Green: This is already implemented and works.
    Blue: Currently working on this.
    Orange: Currently just an idea. Haven't even researched if this is possible.

    Requirements:
    • CraftBukkit RB 860
    • WorldEdit 4.6
    YouTube Video: Toggle Circuit

    Delayed-off Circuit:


    Scheduled Circuit:


    Togglable Light Blocks:


    Circuit Breaker:


    Strobe Circuit and Select/Add Tool:


    Any and all feedback is welcome.
     
    gobbo likes this.
  2. Offline

    smickles

    Wow, I just watched your video. That is pretty cool.
     
  3. Offline

    Brain

    Finished circuit behaviors "always on" and "delayed off". Made a video of a delayed-off circuit and showed re-triggering, see first post.
     
  4. Offline

    Owned645

    Is it released? I'm not seeing a download link.
     
  5. Offline

    Brain

    Still work in progress, sorry.
     
  6. Offline

    ValBGaming

    Looks great, I'll look forward to trying it out on my server once it's released. :D
     
  7. Offline

    Brain

    Thank you for the encouragement. I have finished circuit behavior "scheduled" and implemented directly togglable light blocks. I have added two new videos, "Scheduled Circuit" and "Togglable Light Blocks" accordingly.
     
  8. Offline

    Owned645

    Just like ValBGaming, I really can't wait to try this on my server when its out.
     
  9. Offline

    Brain

    Added a video showing a circuit breaker in action.

    By the way, you can run several circuits over one breaker and you can operate multiple circuits with one button, too.

    I'm still busy ironing out small but annoying little bugs and adding sanity checks for the YAML save format.
     
  10. Offline

    blaize9

    I love it, its a great plugin to have.
     
  11. Offline

    Owned645

    Hah sanity checks. Its nice to see call of cathulu humor outside of my circle.
     
  12. Offline

    thescreem

    REALLY nice plugin, I can tell how complicated it must've been to code this. Nice job! :D

    Off-topic: What texture pack are you using? Painterly? If so, can I have your custom textures for it? I really it :p
     
  13. Offline

    Owned645

    Please release this sometime soon. I'm on this almost every time I edit my server to check when I can add it. Its really such a useful plugin. Please release [:
     
  14. Offline

    Brain

    Sorry, I'm not getting much development done on my bukkit plugins right now. I'm fervently working 10+ hours a day on an already overdue project on my job. I hope this done in two weeks.
     
  15. Offline

    louischolds

    Hurry, i cant wait!!!
     
  16. Offline

    angel0fmars

    That's some really awesome stuff! Can you adjust the brightness as well? If you can, maybe we can use a redstone repeater that acts as a switch for brightness. For instance on the first position it's dim and on the fourth position it's bright.

    Can't wait! I'm downloading immediately once you release the download link :D
     
  17. Offline

    AFrostyMug

    Could you release a sub-par version that includes only the toggleable light fixtures? If not, is there another mod out there that has toggable lights I can use in the meantime?
     
  18. Offline

    Jacek

    Hey,

    I am currently working on a plugin that needs to change the light level of blocks, more info on that here http://forums.bukkit.org/threads/control-block-lighting-levels.27695/

    I am facing a few problems with it, some client side bugs that seem to be unavoidable (not too worried about that) and some server crashing (quite worried about these). Would it be possible for you to explain how you added the light ? And got rid of the problem of the lighting being updated when a block is placed close to it ?

    If you don't want to explain, just the code would do fine. I'm pretty new to Java but I think I could work it out.

    Thanks.
     
  19. Offline

    Brain

    The light blocks are retextured glowstone/mossy cobblestone. No magic, sorry.
     
  20. Offline

    Jacek

    Ah, fair enough then.

    Thanks anyway.
     
  21. Offline

    louischolds

    Dude, seriously iv'e been waiting for AGES for this plugin!!
     
  22. Offline

    Brain

    Then you'll have to wait a bit longer, sorry.
     
    fysics likes this.
  23. Offline

    louischolds

    Ok :D
     
  24. Offline

    Brain

    Continuing work on the plugin now. Loading and saving circuits seems to work fine now. I'm not sure if this will work with any Bukkit version for Minecraft 1.7 though. I'm staying with 1.6.6 and Bukkit 860 at the moment because this combination seems to run sufficiently stable for me.
    Looking forward to Minecraft 1.8, hopefully the sign/container/furnace blanking bug will be fixed then.
     
  25. Offline

    zipsi

    can't wait to see this released! could already think of countless places where to use it, sometimes there just isn't room for placing big redstone wires (when using something like craftbook, falsebook)
     
  26. Offline

    Brain

    Ah, I just discovered a problem with circuit behavior that requires threads (delayed-off, strobe). It seems there are more than one thread per circuit which shouldn't be possible. Maybe a /reload problem or related to world updates on chunk load, working on this.
     
  27. Offline

    john5634

    When is this going to be released its been a couple of months and it looks petty much done can you send me a beta file perhaps Id be glad to provide feedback as a beta tester.
     
  28. Offline

    Dq231

    So when do you expect this to be out?
     
  29. Offline

    Ninjokin

    Wow! Looks amazing! ETA on the release/beta? Would love to beta test this!
     
  30. Offline

    Brain

    It's already undergoing beta tests, unfortunately it's not stable enough yet to make publicly available.
     
Thread Status:
Not open for further replies.

Share This Page