Home    LittleBigPlanet 2 - 3 - Vita - Karting    LittleBigPlanet 2    [LBP2] Tutorials
#1

How to Make a Permanent Switch

Archive: 28 posts


In honor of the new LBP2 tutorials section, I'll start with a simple one.

A permanent switch is a logic tool which, once activated, is always activated. In LBP1, the simplest way to achieve this was to use dissolve, as once the object is gone, it's gone forever. How one would use this dissolve varies, but the idea remains the same.

In LBP2, logic does not need to be physical, so using dissolve is no longer necessary. Instead, there are a number of ways to achieve the same ends using the new tools.

Use an OR gate. Wire your input to one of the OR gate's input nodes. Wire the output of the OR gate to the second input node. Once activated once, the output will provide an input to the OR gate, making it permanent!

Use a selector. This is my personal favorite, as you can simultaneously turn something off while turning something else on. You need to change the number of inputs on the selector to 2. By default, the selector will output to the first output node. All you need to do to make a perm is run an input to the second input node of the selector. This will change its state to permanently output from the second output node. (Fun fact - you can also reset this one with another signal. This is left as an exercise to the reader).

Use a counter. Require that the counter need to be activated only once, and it's a permanent switch. This one can also be reset by using the reset input.

Use a timer. This one will have a slight delay, but it works just the same. Set the timer to Start Count Up, and once it is activated, it remains on permanently. Set the time down to .1 seconds to minimize the delay. This one can again be reset.

Well, there you have it. Happy creating, everyone. Pictures coming soon... maybe.

(P.S. Don't tell my students, who are taking a test, what all this typing was about... )
2011-01-18 14:14:00

Author:
comphermc
Posts: 5338


Lol so now we know how to use a permanent switch we can do anything you hear me anything,* walks forward and leans in front of everyone's face* ANYTHING!!!!

Well not anything but you know hopefully this tutorial will get rid of all the early "how to make a perma threads" that we may of gotten.

So let me ask you comph when are you going to teach us how to make a time machine?
2011-01-18 14:46:00

Author:
robotiod
Posts: 2662


So let me ask you comph when are you going to teach us how to make a time machine?

I'll let you know when I'm done playing LittleBigPlanet 4.

Edit: I'll let you know after rtm223 does it first. Then I can stealz it.
2011-01-18 15:03:00

Author:
comphermc
Posts: 5338


OMG ur teh logis king!!! Can we bbe frens?2011-01-18 15:25:00

Author:
rtm223
Posts: 6497


No.


You smell and are smelly.
2011-01-18 15:31:00

Author:
comphermc
Posts: 5338


Haha, thanks compher for the usefull tutorial to those who didn't get the chance to be in the beta.

We won't tell your students, don't worry
2011-01-18 15:35:00

Author:
Chump
Posts: 1712


Lets hope one of your students isn't on LBPC!2011-01-18 15:38:00

Author:
ladylyn1
Posts: 836


Use a selector. This is my personal favorite, as you can simultaneously turn something off while turning something else on. All you need to do change the number of inputs on the selector to 2. By default, the selector will output to the first output node. All you need to do to make a perm is run an input to the second input node of the selector. This will change its state to permanently output from the second output node. (Fun fact - you can also reset this one with another signal. This is left as an exercise to the reader).

The two-port selector is one of the most useful gizmos in the game, it makes for a perfect set-reset with optional toggle using the Cycle input.



Use a counter. Require that the counter need to be activated only once, and it's a permanent switch. This one can also be reset by using the reset input.

Thermo-heads might also like to know that this is the lowest-thermo solution, although it's pretty marginal.
2011-01-18 15:46:00

Author:
Aya042
Posts: 2870


And so it begins...the good folks at LBPCentral keeping me sane.2011-01-18 15:53:00

Author:
Biv
Posts: 734


This reminds me of a conversation in a hotel bar..... Thanks for sharing it with the world comph. I can't tell you how many times in the beta people asked me this and thanks to you I knew what to tell them! 2011-01-18 15:56:00

Author:
Morgana25
Posts: 5983


It's true! Thanks Comph. When I first got to the Beta I was like NOOOOO! Logic from SCRATCH... Ground Zero again! THIS was my first question upon regaining sanity.


(Of course this is all conjecture and some would argue the point... my sanity, that is...)
2011-01-18 17:03:00

Author:
Gravel
Posts: 1308


How nostalgic. Thanks for the tips!


(P.S. Don't tell my students, who are taking a test, what all this typing was about... )

Are you a teacher?

http://i.neoseeker.com/mgv/272671-Blackfalcon/671/5/animal0064hb2_display.gif
2011-01-18 19:50:00

Author:
Blackfalcon
Posts: 409


All these logic-heads around, and no one mentions that the feedback OR gate will reset when it's on a microchip that is being turned off. 2011-01-18 20:23:00

Author:
Rogar
Posts: 2284


All these logic-heads around, and no one mentions that the feedback OR gate will reset when it's on a microchip that is being turned off.

True, but even in isolation it's still more thermo-expensive than the counter solution, so there's really no need to use it.
2011-01-18 20:25:00

Author:
Aya042
Posts: 2870


But if you have a ton of them on a microchip and you want to be able to reset them all in one go, OR gates save you a lot of wiring.

Anyway, I was going for completeness, not applicability.
2011-01-18 20:36:00

Author:
Rogar
Posts: 2284


Are you a teacher?

I will be once my training is complete.
2011-01-18 23:43:00

Author:
comphermc
Posts: 5338


But if you have a ton of them on a microchip and you want to be able to reset them all in one go, OR gates save you a lot of wiring.

Anyway, I was going for completeness, not applicability.

Not to mention that switching of a microchip means that simulation is not required for all components inside... So whilst thermo may be increased, if you hold the reset signal, you're gonna gain better performance in real terms - designing complex systems around switching whole circuits on and off is a good habit to get into.
2011-01-19 00:17:00

Author:
rtm223
Posts: 6497


Theoretically speaking, yes. Have you got test results to back that up?2011-01-19 11:39:00

Author:
Rogar
Posts: 2284


I have a note from someone in QA @ MM who advises to switch off microchips when not in use for "performance" reasons....

Which "proves" nothing I'd put money on this incredibly simple piece of optimisation being in there, and if not it's probably get patched in later.

Of course, with dynamic thermo, it would actually make sense for logic to not count towards thermo contributions until switched on either... Hmmmm.
2011-01-19 11:49:00

Author:
rtm223
Posts: 6497


I have a note from someone in QA @ MM who advises to switch off microchips when not in use for "performance" reasons...

Which is fine if you're prepared to put up with a frame of latency when you re-enable them.

Unless, of course, that got fixed since the beta, or you use the regular input workaround. I shall re-test all this stuff on Friday, and maybe put together a quick tutorial on avoiding latency.
2011-01-19 17:33:00

Author:
Aya042
Posts: 2870


Hey, stop hijackin' mah thread, you big bullies!

2011-01-19 18:19:00

Author:
comphermc
Posts: 5338


hmm , interesting 2011-01-19 20:40:00

Author:
TOXIC_KILLA_
Posts: 147


But if you have a ton of them on a microchip and you want to be able to reset them all in one go, OR gates save you a lot of wiring.

Anyway, I was going for completeness, not applicability.


That is true but most of the time you don't need that many 1 shots. Also if you end up with a lot of them that all need to be reset at the same time you can ushaly combine them into one.
2011-01-20 04:12:00

Author:
slidedrum
Posts: 189


What if you made a battery connected to an AND and then the "trigger" connected to the AND... Won't that make a permanent switch too?2011-01-20 14:01:00

Author:
tatsujay
Posts: 1


What if you made a battery connected to an AND and then the "trigger" connected to the AND... Won't that make a permanent switch too?

The AND needs two constant inputs so the trigger say a button would need to be constantly pressed to give an output. It would do exactly the same as a button at that point.
2011-01-20 14:24:00

Author:
robotiod
Posts: 2662


Is there a latency when turning on a microchip? Has anyone tested this? And if there is, is it one tick (0.033 sec) in length or a full cycle of 0.066 sec.? I have chips that depend on the clock cycle being in sync and I need to make sure I'm not introducing latency anywhere. Thx2011-02-03 18:27:00

Author:
Shanghaidilly
Posts: 153


Is there a latency when turning on a microchip?

Yes. It's one frame (1/30th of a second). See also this post (https://lbpcentral.lbp-hub.com/index.php?t=44113-Logic-Probe-and-Signal-Combiner&p=737808&viewfull=1#post737808) for a workaround.
2011-02-03 18:46:00

Author:
Aya042
Posts: 2870


Yes. It's one frame (1/30th of a second). See also this post (https://lbpcentral.lbp-hub.com/index.php?t=44113-Logic-Probe-and-Signal-Combiner&p=737808&viewfull=1#post737808) for a workaround.

Which might explain why my circuits still seem to work. For example, in my memory circuit, all internal circuits which are activated have at least one active input (such as a simple relay). Are there any simulation sequence tutorials?

Update: Looks like it might be longer than one frame. I cascaded 30 microchips which contained nothing but a battery together (output into the activation switch), and it took 2 seconds for them to light a light bulb. That would be 2 frames (1/15th of a second) of latency. Looks like things have changed since beta because I'm seeing a lot of discrepancies.

I also tested the selector, and it actually has no latency at all. However, each time it changes after that incurs one frame of latency. So if you have the output of the port go to the input of another port on the selector, it will taken an additional frame to hit the second port. This is quite useful and is as I had hoped.

Things I plan on testing:

clock permanent switch
relays (since they have an input the assumption is that there is no latency)
filled clock in an activated circuit (to test whether the battery is what is introducing the additional frame).
2011-02-03 18:56:00

Author:
Shanghaidilly
Posts: 153


LBPCentral Archive Statistics
Posts: 1077139    Threads: 69970    Members: 9661    Archive-Date: 2019-01-19

Datenschutz
Aus dem Archiv wurden alle persönlichen Daten wie Name, Anschrift, Email etc. - aber auch sämtliche Inhalte wie z.B. persönliche Nachrichten - entfernt.
Die Nutzung dieser Webseite erfolgt ohne Speicherung personenbezogener Daten. Es werden keinerlei Cookies, Logs, 3rd-Party-Plugins etc. verwendet.