[MECH] RedstoneChips 0.97 - Integrated circuits plugin [1.5.1-R0.2]

Discussion in 'Archived: Plugin Releases' started by eisental, Jan 19, 2011.

  1. Offline

    eisental

    RedstoneChips 0.97 / BasicCircuits 0.97 / SensorLibrary 0.34
    (Last update on April 30th, 2013, cb 1.5.1-R0.2)


    [​IMG]

    Features:
    • Build chips with any number of input and output pins, from compact 2 block chips up to whatever you can imagine.
    • Choose from over 50 different chip types and several 3rd party chip libraries.
    • Most chip types can work with a wide or infinte range of i/o configurations. Sign arguments allow you to customize chip behavior.
    • Chips can communicate through redstone, or directly by touching each other. Some chip types can also communicate over wireless channels.
    • Chips can be built in almost any imaginable structure allowing very compact circuits.
    • Debug and maintain large projects using various tools and commands.
    [​IMG]

    [cake] Help me spend more time working on RedstoneChips. Please donate

    Circuit libraries made by other people:
    Changelog (open)

    RedstoneChips 0.97 (Apr 30th, 2013)
    • Fixed the saving bug on cb 1.5.1.
    • Added an option to disable update checking.
    BasicCircuits 0.96 (Apr 30th, 2013)
    • pixel: Added a maximum distance value preference to prevent lags and server crashes. The max can be changed using/rcprefs pixel.maxDistance x and defaults to 7.
    • sram: Fixed a problem with anonymous memory.
    SensorLibrary 0.34 (Dec 1st, 2012)
    • daytime: Fixed daytime offset bug.



    Full changelogs and source code @ github.com:
    RedstoneChips [gunpowder] BasicCircuits [gunpowder] SensorLibrary
     
    DoomLord, Shamebot, Vecht and 6 others like this.
  2. Offline

    AterIgnis

  3. Offline

    Mordenkainen

  4. Offline

    AterIgnis

  5. Offline

    Mordenkainen

    Can you post a picture of a setup that requires the forced update of state for surrounding blocks?

    Also, correct me if I am wrong, but your code forces the state of the output bits to be the current lever state when the circuit initializes, correct?

    I would think it should be the other way around, since this way may change the internal state of the chip in a bad way. For example I could "insert" a bit into a shift register by disabling RC, changing an output lever, and re-enabling RC, or even resetting the chip. I think the saved output state of the chip should get written to the levers on init, or the outputs should be forced off (or to the internal state if avail.) on new inits.

    Also, this commit: https://github.com/AterIgnis/RedstoneChips/commit/ea887d31338696e72a32bec100dbfcf15cfbab50

    Doesn't completely fix the problem. The issue goes a lot deeper (You may get ConcurrentModificationExceptions). I have some changes I have not committed yet that largely resolves issues with shared blocks. The commit you took is kinda broken. (My sharing commit is on a different branch because it's not ready to be taken yet. It still doesn't work right. I would take it out, and wait for the commit to get merged into eisentals or my "master" branch, which will mean it's working)

    Morden
     
  6. Offline

    AterIgnis

    That's the case i fix by forced update: rsChipsFail.png

    And as for your next question:
    1) in shiftregister register data is contained in additional variable, which is not stateless and saved in save file, so you can not change that by changing output - they are only copied registry->output but not back.
    2) it is two-sided coin, you can disable RC and move lever and maybe get some changes in the circuit - but you do it on purpose most of times, and from other side - you can force levers to zero and some great and complex circuit system may have some state-changes in it because some of circuits would zero their outputs or if you just leave all as it was before my fix - you get some circuits which do not react on first input.

    I made myself a underground research facility and it have halflife-like room, some corridors, gravity lifts, toggleable lights and most complex - reactor. The reactor thing is two flashy-noisy systems which do flashes and noise when anyone gets near, and their on/off state is ANDed with levers to toggle global light, gravity-lifts and automatic doors, you switch reactors down or lever lights down - transmitter sends light-off signal and lights go off, but without fix on server restart if you toggle lights or reactors off - it does send light-off but lights do think they already off and are on until you resend them light-on and light-off. This one problem is fixed by sending lights-state on receiver-initialization, right. So if you think my fix is making more bads than goods - I can kill it of course. But now I do not see any causes which do really matter.
     
  7. Offline

    Mordenkainen

    Ok, Thanks!

    The shiftregister was just an example off the top of my head. I would have to look at the chips to see if there are any that changing the output bits would mess with. I just know there is a note in the source never to manipulate those bits directly.

    If it fixes the problem for you, great.

    More importantly, I think you need to pull my shared block commit out of your code. It's not ready for use yet and is full of bugs, potentially bad ones.

    Morden.
     
  8. Offline

    AterIgnis

    I have rolled my code back already, thanks. If you find any chips which do use outputs bits for something, tell me. Maybe it would have point to remake my fix to something else or remove it, or maybe it would be easier to fix those chips instead. :)

    Edit:
    Ohh, looked myself at basiccircuits, and got a list myself already, but I do not know is it really any bad to system or not. For example FlipFlop gets his internal outputBits saved to file and loaded on server start so it would not be affected by my fix; and Tal's shiftregister loads it's register and outputBits data from same point in savefile, I do not see a point in settings outputBits to something in any way except sendBitSend(register), because other cases do allow desynchronization between real state of output levers and internal state.
    My thought is that maybe it is a good point to replace my fix by removing it and removing in Circuit.java in function sendBitSet a row 'if (original.get(i)!=b)', that would enable some redundant equations, but ingame lever state is checked before real visible update so it would not make any excess world updates, but it still would allow changes to go to lever even if game thinks it's internal state is not differ from real outputs state.
    And BTW do remember my fix can make any difference only when you make changes while RC is disabled and all circuits are saved to file (and they all would go reinitialisation step first) or if you initialize new circuit with non zeroed lever states.

    Please post your own thoughts and looks on that so we could make some common decision on what to do with it. May be I am wrong in something or such.

    Edit:
    Damn me, got a mistake in my thoughts, we do not check lever real state on update, but it is very easy to implement.

    Allright, applied my last idea to check for real lever state and not check internal state while posting output to the world.

    BTW you can watch part of my base which is mostly based on redstone-chips.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 18, 2016
  9. Offline

    Mordenkainen

    COOL!

    In any case, let me think on a solution. I'm not really sure what the best fix is yet.

    Unfortunately eisental has not been on lately, it would be best to see what he thinks of it. It's his plugin after all!

    My inital thinking is that during circuit init, the code does a runinputlogic(). After this point the outputbits should contain the values the outputs should be set to, so a good solution may be to force the levers to match the output bits at that point.

    Only issue I see with this approach is that I do not think the lever can be changed if the chunk is unloaded, so there may need to be some action taken on a chunk load, or we may need to load the levers chunks on init, set them to what they should be, then unload the chunk..

    Morden
     
  10. Offline

    hiro24

    I don't wanna beat a dead horse here, but there seems to be an issue w/ this plugin on my server. Here's the deal: chests and signs are getting cleared mysteriously when the chunks get unloaded or server resets. See the following links:

    http://forums.bukkit.org/threads/signs-being-erased-in-random-chunks.24681/
    http://leaky.bukkit.org/issues/1052

    There's a LOT of finger pointing going on about is this / isn't this a bukkit issue, is a plugin causing it, etc... but here's what I've seen:

    1) I have the issue described above
    2) I disabled redstonechips
    3) I don't have the issue anymore

    Can someone please look into this, as it's wreaking havoc on my server, and we REALLY want to use redstonechips. For now it's a deal killer though.
     
  11. Offline

    Mordenkainen

    From the Leaky entry, it appears confirmed (by Jeb) that this is an issue with minecraft server, not bukkit or any plugins. The thread on the subject also has many people posting plugin lists that do not contain RC. Finally, there are reports of this in the minecraft forums for plain vanilla servers.

    Also, unless you use SpeedCircuits, there is nothing in RC that interacts with Chests or their content.

    It is possible that RC is exacerbating the problem by changing sign text on circuit init, but no one seems to be sure what exactly is causing the failure.

    Unless we know what action is causing the signs to go blank, there really is no way to know what we could change to prevent it.

    EDIT - Looking at the problem reports, it appears the signs go blank on a chunk unload. There are times when RC loads a chunk to do some maintenance work, then unloads it, which may be why the issue is more noticeable with RC enabled. Preventing RC from loading/unloading chunks would re-introduce some issues that eisental worked hard to fix, so I'm not sure that is a real solution. It also wouldn't fix the issue, just make it less likely to happen.
     
  12. Offline

    XSturb

    I have a problem where all the curcuits somehow gets deactivated and I have to go and activate all of them one by one. The red text is still there so it looks activated but its not. Does anyone know why this is happening?

    Im running craftbukkit 1.7.2 with Redstonecurcuits 0.9
     
  13. Offline

    AterIgnis

    does it provide any error logs? maybe it has some problems loading circuits from save-file or it may be something else...
     
  14. Offline

    XSturb

    It doesn't give me any errors at all. It just seems like it doesn't load from the save file or something. I have checked the save file and all the circuits are there
     
  15. Offline

    AterIgnis

    and is it saying in log anything about load?
    Like:
     
  16. Offline

    XSturb

    After I restarted the server it says this:

    Code:
    2011-07-16 19:05:05 [INFO] RedstoneChips: Reading circuits file...
    
    2011-07-16 19:05:05 [INFO] RedstoneChips: Activating circuits...
    
    2011-07-16 19:05:05 [INFO] RedstoneChips: Done. Loaded 0 chips.
    And the after the restart the circuit file redstonechips.circuits are empty :-S

    EDIT: Also I got this error message later after restart:

    2011-07-16 19:21:44 [SEVERE] Could not pass event REDSTONE_CHANGE to RedstoneChips
     
  17. Offline

    AterIgnis

    It seems it really could not load them from file: it haven't threw an error so it seems the file is empty (doubtful) or it gets empty list of circuits from it. Last case may be caused by YAML data-saving methods, it is hard to say for sure what's causing this without any additional debug outputs. Try to use my latest build of RedstoneChips it is 0.93t3 with some my fixes, you can take it there. If there will not be any difference - I would add some additional debug outputs for you and we will get that problem surrounded.
     
  18. Offline

    XSturb

    I have found the problem. Its a conflict with the plugin ItemDetector. After removing the item detector plugin everything seems to work fine :) All the plugins is loaded and activated :)
     
  19. Offline

    AterIgnis

    That's good to hear. :) still you can try more advanced version of RC. :)
     
  20. Offline

    Mordenkainen

    Might I suggest that instead of several different versions of RC, we use github to work together?

    I hate it when a nice open source app gets splintered into a half dozen different forks instead of one unified app with everyones additions.

    Morden.
     
  21. Offline

    AterIgnis

    It would be great but we need to have one Repo as our common in that case, in fact it is better to use Tal's, but he himself must allow it in that case.
    As I understand now we have original RC with my branch of some small fixes and your branch of multiple circuits per block, all splitted in three repos, right?
     
  22. Offline

    QQCucumber

    If you guys are going to fork RC, I really suggest you put in proper multiworld handling. Per-world RC files, and the plugin shouldn't freak out and shit itself if it can't find a world.
     
  23. I'm not sure whether to laugh because I know that's what it does or laugh because of your wording.
     
  24. Offline

    AterIgnis

    it seems you have different versions in that case. :)
    Original 0.91t3 version is saving all circuits in all worlds to ONE file. I am already taking attempts to make them different ones.

    QQCucumber: done your request, try it and report if you get any issues. (Download)
    My implementation does load "redstonechips.circuit" file if it exists, renames it for backup and uses new file loading algorithms later, but because i am not god or anything like that and can make mistakes - please do backup your circuits yourself before trying. It must not be needed but better safe than sorry.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 18, 2016
  25. Offline

    vivanewvegas

    Ehmm... i don't know if someone already asked this question but please help me! I downloaded the plugin and the basic circuit library. But i don't know how to use the basic circuit library. Where do i place it and do i have to edit any files? Is there a tutorial? Please help!
     
  26. Offline

    Mordenkainen

    Same place as all the other plugins, and no files to edit.
     
  27. Offline

    vivanewvegas

    I know that part but i can't use the basic circuit library. When i start up the server the plugin says it has loaded 0 chips. The plugin itself works, i only need to know how to load the basic circuit library. An if i get what you're saying the .jar flie of the basic circuit library should also be placed in the plugins folder. But do i have to edit the CIRCUITS file ?
     
  28. Offline

    AterIgnis

    You put your RedstoneChips.jar and BasicCircuits.jar in plugins folder and THAT's ALL
    and you get in your log
    just use it then.
    And
    means you haven't created any circuit in-game, have you?
    Tutorial on creating circuits in-game.
     
  29. Offline

    7eggert

    I didn't know about RC unloading chunks, but it happens to me exactly in my home chunk (where I tend to be while I my server is stopped/restarted, so it will get loaded).
    Can you make a test version with just chunk unloading disabled? Maybe I (or sb else) can test it on a secondary server ...

    Off cause this will not fix the real cause, but if it helps to hide the bug, it may tell us something about it's nature.

    It is a minecraft issue with setting levers. Unless you have a redstone wire between the lever and the piston (or any other device), you won't get a reliable reaction. Notice how the tutorial will use redstone wire on each output while you could just place the chips one block closer to the lever if it worked as expected.

    This should be explicitely stated in the first posting, since everybody seems to have a hard time finding this out.
    My ΒΆΒΆ

    I'm currently using a register to indicate the presence of mobs in a trap. Triggering a pressure plate will toggle a clock line and the register will read 0 and output 0, so the redstone torch will not get unlit ( == it will be lit). Toggling the output lever will power the redstone and unlit the torch until the pressure plate is touched again.

    I dream of creating a better chip to to the job, but there may be other setups depending on chips to set their output unconditionally and not modifying their internal state by manipulating output switches. If you create new chips or add new parameters, you may make it possible to overwrite the current output register by manually switching levers, this will not interfere with the current behavior of existing chips.

    You don't need one central repository. Git is designed for each developer to have his own local repository and if he's done with his part, he can ask you to merge his changes into your repository. Or he can create a patch and send it to you.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 18, 2016
  30. Offline

    AterIgnis

    The fact with levers was - I needed to have pistons and circuits as compact as it can be, block with lever on top or below of pistons is alright but having any wire kills all the contraption.
    And if I understand correctly - you need just RS NOR latch to set it by plate and clear by lever or button, isn't it?
    And as for Repo: we have our own but trying to contribute for Tal's one for him to implement our fixes in official version. That was the question we discussed with Mordenkainen and I already made everything as it must be.
     
  31. Offline

    7eggert

    a) What you can do is put the output blocks on alternating sides of the chip, the levers facing away from the chip and put one redstone wire on the outputs. On top of the chip you can put the blocks to be powered, either the pistons themselves or a block which will indirectly power the pistons. If you can deal with the output being inverted, you can also put redstone torches on top of these blocks and below the pistons, yo you'd have an extra laer to hide the redstone.

    HTH

    b) Maybe I'll try the NOR latches as soon as the signs-are-ceared bug is fixed. Thanks anyway.
     

Share This Page