Jump to content

Open Door every X cycles and automation issues


Recommended Posts

Does anyone have issues with automation arrangements that seem to reset themselves randomly?

I created a fully automatic mushroom farm, with a mechanism that opens the door every 8 cycles for 600 seconds and activates the shipping machines, to let the dupes farm the shrooms. The automation loop itself is ridiculously complex and relies on memory toggles that activate the next toggle the following day and then resetting the one behind them. It's a nightmare, but I am 100% sure it SHOULD work in theory - it works perfectly sometimes, just to reset itself at seemingly random times during the day at other times.

1. is there a maximum timeframe before automation resets automatically (couple of cycles)? Is anyone experiencing similar issues?

2. Does anyone know a way simpler mechanism to achieve the same thing? :) I'm so proud of it, but it's pretty nooblike

3. I love this game so much. SO MUCH

 

 

 

shroom1.jpg

shroom 3.jpg

Link to comment
Share on other sites

I was the same with you two. I wanted to see if you could create a clock to use with replacing critters. At first I tried doing it with the new memory gates like OP, but somehow only using them and no other logic gates. Can't be done. If you could you would save on so much space. But yess the easiest one is 3 buffer gates for one cycle. 

What I suggest they make is a counter logic gate that counts how many times something gets activated. it will keep counting when it detects a standby signal first and then an active signal again etc etc. It would have a control that you can modify that resets itself after exceeding a certain number ( eg. x >10 ). It outputs an active signal when it reaches the maximum number and then goes on standby after passing it.  So like for my example it reaches 10 and outputs an active signal for that duration until it detects something being activated again which it then resets (x is greater than 10) and outputs standby signal until it reaches its limit again.

This is similar to factorios automation. Klie just copy everything factorio, they have an awesome automation system.

Link to comment
Share on other sites

No "real" use for a counting automation, but easy to  set up a counter with memory blocks and use some buffer/daytime sensor for a daily pulse and trigger the reset on the overflow bit. So even counter for above 100 cycles don´t use huge amounts of space ;)

Link to comment
Share on other sites

 

14 minutes ago, Lilalaunekuh said:

No "real" use for a counting automation, but easy to  set up a counter with memory blocks and use some buffer/daytime sensor for a daily pulse and trigger the reset on the overflow bit. So even counter for above 100 cycles don´t use huge amounts of space ;)

So this can detect when it reaches the 100th cycle? How much space would this really use up?

Link to comment
Share on other sites

A digital counter to 100 takes 7 bits. Each bit is made of a positive edge triggered flip flop - 2 SR latches, an and gate and a not. I.e. counting to 128 takes 24 logic elements, counting to to 1024 only takes 12 more.

Link to comment
Share on other sites

Thanks for the simple solution, lilalaunekuh, i did it like this :) (da hab ich wohl den Wald vor lauter Bäumen nicht gesehen)

The pulse-solution sounds really interesting, but I cant wrap my head around the description, too complex for my brain. Does anyone have a screenshot? Would love to re-build it

Link to comment
Share on other sites

i wouldn't go to the effort of building a 7 bit digital counter, ONI doesn't tend to handle large state circuits terribly well. Even small state circuits tend to misbehave.

Also for performance reasons it's always better to just choose a simpler concept if you find yourself building a whole screenful of things for a single system. Might seem like a cool idea, but your game will go really slow and start to glitch out if you start building really huge complex systems.

Link to comment
Share on other sites

Use a 3bit counter. When all 3 bits are ON, door is turned on (use two AND gates to combine outputs).

You can use my 4bit counter as a template and just don't use (or build) the last bit. Input switch is substituted for a clock switch obviously. 

5ae32bdd99731_2017-11-07(5).thumb.png.06b9eb7ad35e80f888f4f4e2ebd28e28.png

9 hours ago, avc15 said:

A digital counter to 100 takes 7 bits. Each bit is made of a positive edge triggered flip flop - 2 SR latches, an and gate and a not. I.e. counting to 128 takes 24 logic elements, counting to to 1024 only takes 12 more.

Way more complex than need be. See above. Edge detector is an AND and a NOT, flip flop is a single XOR. Next bit is just negative of current bit.

Link to comment
Share on other sites

11 minutes ago, Saturnus said:

 

Way more complex than need be. See post above. Edge detector is an AND and a NOT, latch is a single XOR. Next bit is just negative of current bit.

yes, thanks for the simple version. There's always a way you can simplify classic circuits, I didn't necessarily want to just go on and on and I didn't know the simplified version. I noticed you reduced it to 4 gates per bit, good one.

 

(btw: two latches per bit vs one latch per bit is a topic of massive research in the real world - asynchronous vs synchronous circuits - I was reluctant to discuss one latch per bit because I didn't know if it would work in ONI! But clearly you have tested it)

 

Link to comment
Share on other sites

13 minutes ago, avc15 said:

yes, thanks for the simple version. There's always a way you can simplify classic circuits, I didn't necessarily want to just go on and on and I didn't know the simplified version. I noticed you reduced it to 4 gates per bit, good one.

You also had 4 gates per bit though but since the compact one uses two NOT gates it's 2 spaces smaller per bit.
That's not the interesting part though. Because there's an edge detector on each successive bit it can accurately count pulses down to 0.1s accurately even though it takes it a while to fully settle to the last bit.
Not terribly important in a system that only have one event per cycle but in other counting cases it would be extremely important that the counter is bit stable.

Link to comment
Share on other sites

1 minute ago, Saturnus said:


Not terribly important in a system the only have one event per cycle but in other counting cases it would be extremely important that the counter is bit stable.

yup, that's the crux :) I didn't know this would work in  ONI. I'm bookmarking your solution, pretty elegant as always!

I'll translate for the others - with one latch per bit, you have to let the entire circuit re-compute every time an input pulse happens. It becomes extremely important that all the signals go in a very precise order. You can run into a problem called "meta-stability" where the thing enters a state that  should be impossible or just never stops changing.

It takes some clever thinking to make it work. You can eliminate the problem by "synchronizing" between bits, usually by adding a 2nd latch on each bit that's negative edge triggered. But you'll wind up with something a lot more complicated. 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...