cblack Posted December 26, 2018 Share Posted December 26, 2018 I'm trying to convert a pulse (turning an automation circuit "on") into a toggle, so that every time a pulse is received (rising edge), it toggles a memory cell's output. It should function regardless of how long the pulse is sent, but every pulse should toggle it. The end of a pulse, i.e. a falling edge, should do nothing. To better explain, here's a circuit I've already built, that does exactly what I want: When the switch (top left) is turned on, the light (far right) changes from on to off, or off to on. However, this uses a lot of circuitry, and I feel like there has to be a much simpler & smaller way to do this. Anyone know how? Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/ Share on other sites More sharing options...
ONIfreak Posted December 26, 2018 Share Posted December 26, 2018 I don't think there is such thing in a game yet but i wonder what you try to achieve by this toggle. Do you mind sharing why you need it? Just curious:) Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1136765 Share on other sites More sharing options...
smithdl Posted December 27, 2018 Share Posted December 27, 2018 My understanding of a memory toggle is what your looking for. You set the reset to your switch and and the set to a constant on input. Then your reset switch toggles on and off, regardless of what on or off is. So in this example, the atmo sensor on the right is set to always on. The reset input toggles the light, regardless on whether the "on" for the atmo is "off" for the light. I have re read your post and I think I better understand what your talking about. You want an input to toggle and that toggle to maintain even after the input dies. So basically, only input on affects the final output, not input off? Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1136773 Share on other sites More sharing options...
fishoutofwater Posted December 27, 2018 Share Posted December 27, 2018 10 hours ago, cblack said: When the switch (top left) is turned on, the light (far right) changes from on to off, or off to on. However, this uses a lot of circuitry, and I feel like there has to be a much simpler & smaller way to do this. Anyone know how? my brain tells me it is just a switch for on and off so why use automation, but I am pretty sure my brain is wrong. so I am curious too about this automation. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1136800 Share on other sites More sharing options...
cblack Posted December 27, 2018 Author Share Posted December 27, 2018 4 hours ago, ONIfreak said: I don't think there is such thing in a game yet but i wonder what you try to achieve by this toggle. Do you mind sharing why you need it? Just curious:) Yeah, there's no single automation block that does this, but it can be achieved with a lot of individual blocks like I did in the original post, just hoping to do it with a lot less blocks that I originally used. The main reason I want it is for an airlock--and I'm not talking about the "airlocks" in the game that are really just doors. I'm referring to a complete airlock system, which really consists of three "zones" if you will. Think of two areas filled with different gasses (or even a vacuum on one side), let's say oxygen in area 'A' and polluted oxygen in area 'B'. These would be separated by an intermediate zone 'C' that may contain either gas, but only one at a time, and your duplicant enters this zone when they want to travel between zones 'A' and 'B'. Upon entering zone 'C', it's pumped down to a vacuum, and the gasses inside are filtered to their respective zone, until zone 'C' is a vacuum. Then the door to the zone opposite the zone the duplicant entered is opened. This is the tricky part, as the airlock has to automate all of this just by a duplicant stepping on a switch. You can read more about real airlocks on Wikipedia. 4 hours ago, smithdl said: My understanding of a memory toggle is what your looking for. ... I have re read your post and I think I better understand what your talking about. You want an input to toggle and that toggle to maintain even after the input dies. So basically, only input on affects the final output, not input off? A single memory toggle by itself will not do what I want. But, your latter understanding is correct, whenever the input single turns on, that toggles the output signal to be the opposite of what it was. A table might explain things better: Does that make more sense? If not, try constructing the original circuit I made in game, and play around with toggling the switch to see how the light turns on and off based on both your inputs as well as the current status of the light. For more information on edge triggering, there's wikipedia on the subject. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1136815 Share on other sites More sharing options...
avc15 Posted December 27, 2018 Share Posted December 27, 2018 You need a positive edge triggered flip flop, which you can accomplish in ONI with very few gates thanks to propagation delays being extremely predictable. It will count any pulse that lasts more than 1 frame/tick (0.2 game seconds??) - or is it two ticks? I can't remember. I can't claim this design as mine, it's courtesy of @Saturnus. In real world applications this takes something like 9 nand gates arranged into two latches and some input filtering. One place he discussed this design (it's a binary counter circuit) is here in this archived post edit: for the record, your build is a classical flip flop. The build in my gif there needs a buffer (a capacitor) to make it work in the real world, so actually ends up being larger and more expensive to build, and slower than a flip flop. Also XORs aren't typically used in integrated circuits for other reasons, so, you probably wouldn't see this design somewhere else. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1136964 Share on other sites More sharing options...
cblack Posted December 27, 2018 Author Share Posted December 27, 2018 Oh, thanks, that's exactly what I wanted! Much more compact than what I had, and should make airlocks a lot more practical now. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1136966 Share on other sites More sharing options...
fishoutofwater Posted December 28, 2018 Share Posted December 28, 2018 please post the final build sir Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1137104 Share on other sites More sharing options...
cblack Posted December 28, 2018 Author Share Posted December 28, 2018 As requested, though this isn't "final" as there are still some kinks to work out, which I'll detail after the image dump: Note that although you can't see it in the image, the three floor switches are all wired together (that circuit is active if the duplicant is on any switch). Right now it's in the middle of pumping the whole geyser room down to a vacuum while the geyser is idle. Once it's a vacuum, the other pump is used to bypass the filter as the room should only contain natural gas. (Edit: This can be done with just gas shutoffs instead of two separate pumps, it just depends on your preference.) The airlock itself is in the upper right. Unfortunately, there are some problems with the current design. Namely, because the airlock breaks duplicant routing, you have to manually order them in to the airlock. When they get there, they have nothing to do, and before the entry door can close, they often run out. This happens even if you order them on to the right-most floor button; yes, they're that quick! So at some point I'm going to improve this to make the duplicants run up/down a longer ladder or left/right on a longer corridor, so the door has time to close before they can run back out. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1137302 Share on other sites More sharing options...
JeP2k3 Posted December 28, 2018 Share Posted December 28, 2018 I second that ! Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1137313 Share on other sites More sharing options...
Gurgel Posted December 28, 2018 Share Posted December 28, 2018 That thing is called a "T-Flip-Flop". Since logic in ONI is not realistic timing-wise, you can implement it simpler than in reality. In reality you need 2 flip-flop stages and gates in between. This forms a so-called "JK Master-Slave FF", as the second stage is slaved to the first one. You then feed the outputs crossed-over to the inputs. Note that there are a lot of wrong claims how to do a T-FF on the web, obviously from people that never implemented them on gate-level. In particular, it cannot be done in reality (for a static design) with just one stage, those designs just oscillate. Here is the proper real-world design done in ONI. It works, but is a bit sluggish. You can nicely see the two RS-FFs (with emulated negated output, since Klei forgot them), the two double-AND input enable stages and the crossed feedback from outputs to inputs. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1137331 Share on other sites More sharing options...
fishoutofwater Posted December 29, 2018 Share Posted December 29, 2018 4 hours ago, cblack said: Namely, because the airlock breaks duplicant routing, you have to manually order them in to the airlock. When they get there, they have nothing to do, and before the entry door can close, they often run out. This happens even if you order them on to the right-most floor button; yes, they're that quick! So at some point I'm going to improve this to make the duplicants run up/down a longer ladder or left/right on a longer corridor, so the door has time to close before they can run back out. what if build it like a trap. I'm waiting for the updates. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1137381 Share on other sites More sharing options...
cblack Posted December 29, 2018 Author Share Posted December 29, 2018 Yeah, I think slowing them down is a lot better than increasing the size of the airlock, mainly because the larger the airlock is, the more gasses need to be pumped out, and the slower it is to reach a perfect vacuum. A double door like you suggest might work, so I'll give it a try. Edit: Oh, wait, I see what you mean, in that you can use the access restrictions to trap the duplicant. All I need for that is a simple pneumatic door, and that shouldn't slow them down much either. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1137415 Share on other sites More sharing options...
fishoutofwater Posted December 29, 2018 Share Posted December 29, 2018 I'm sorry I think my suggestion is wrong, if it is like a trap, dupes action will be reset when they trap inside vacuum room, maybe you should use duplicant checkpoint. Link to comment https://forums.kleientertainment.com/forums/topic/101100-simplest-way-to-convert-an-automation-pulse-to-a-toggle/#findComment-1137462 Share on other sites More sharing options...
Recommended Posts
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.