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

How to make movers move at right angles.

Archive: 13 posts


Hi all, my first tutorial here. I will explain here how to use a controllinator to move an Advanced Mover at 90 degree angles only. It's a long post, but only because I go into detail about how it works. If you just want to implement it and put it down, read through the numbered steps below. This will work with the D-Pad, Sticks, or with a minor modification (see end) any of the other buttons.

UPDATED IMPORTANT INFORMATION
Tetsujin made an observation below (https://lbpcentral.lbp-hub.com/index.php?t=49125-How-to-make-movers-move-at-right-angles.&p=785303&viewfull=1#post785303) that this method will only output binary signals, so any analogue signal is lost in the process. Bear this in mind in the tutorial because although I correctly explain the way combiners/splitters handle analogue signals, that is irrelevant with this use because the Selector will only output a binary signal.

The goal: To have a controllinator which allows you to move an object around either L/R or U/D - never both at the same time.

The problem: The obvious answer to this would be to use an XOR gate, or a Selector to make sure only one of the signals got through. However both of these pose problems: The XOR gate is out of the question as it is unpredictable with analogue signals, and if it had a diagonal input (right + down for example) it wouldn't let EITHER of the signals though. A Selector on its own would not work because the Selector can only output positive values, and we need the full -100% to +100% spectrum. However, with some splitters and combiners thrown in, the Selector will do just fine for our needs, as I will explain below.

The solution: We need to split the signals up into their positive and negative components to make sure our negative signals aren't lost, and make sure we only put signal at a time into the advanced mover. We do this using Splitters to split the signal , and a Selector to make sure we only ever have ONE signal that goes to the Adv. Mover. This sounds complicated but the resulting logic is actually extremely simple. Read on to find out how this works.

Required components:

2 Splitters: one for U/D, one for L/R.
2 Combiners: one for U/D, one for L/R.
1 Selector with 5 ports.
1 Battery with power (not 0%).
1 Advanced Mover.



Feed your two UD LR outputs into the two splitters. This will give you a total of 4 outputs.
Connect these 4 outputs from the splitters into the BOTTOM 4 ports of the Selector. The order they go in here does not matter greatly, unless you need some directions to take priority over others if the player's stick is at an angle. Remember, the LOWEST port has priority.
Place your Battery somewhere and connect that to the FIRST port of the Selector - this will mean the Selector will default to this port if no others are active. This is important because otherwise your mover will keep moving in its last direction even if you are not giving it any power.
Connect the bottom 4 outputs of the Selector into 2 Combiners - the negative outputs from the earlier splitters should feed through the Selector and out into the negative Inputs for the Combiners. We are effectively splitting the analogue signal up into UD (pos/neg) and LR (pos/neg) for the Selector to use, then binding them back together for the Advanced Mover. Be careful here and make sure your L/R signals both get fed into the same combiner - you don't want to combine a LEFT and UP signal together! (Or do you?)
Attach the outputs of the combiners into the Advanced Mover UD LR ports.
That should be it! On my object I gave the object a gyroscope so it always faced upward.


Here's how the final thing should look (gyroscope is optional):

http://i.imgur.com/F5SZ8.jpg

So what's happening here? Well first let me say I could not have done this without rtm223's astoundingly useful Analogue Signal tutorials (http://www.lbpcentral.com/forums/entry.php?2069-Analogue-Logic-1-Fundamentals). Actually that's a fib; I may have been able to do it but I wouldn't have understood -why- it worked. Now I do know why, and I'll talk you through it.

Step 1: Splitting the signal.
Okay, so we start with a signal that is somewhere between -100% and 100%. This immediately presents a problem, as there are not many logic components which will keep the sign (the negative sign) when a signal is passed through them, so unless we only want our mover to move right and up, and never left or down, we need to find a way around this problem. Hence, we split the signal so we are now managing two signals - one for positive values, and one for negative values.

From rtm223's blog: "The splitter is pretty simple – if the input is negative it outputs the magnitude of the signal through the negative output, if the signal is positive then it outputs the magnitude through the positive output. In both cases the signal output is a positive value."

So say we put a signal of -33% into our splitter - we will get +33% out of the NEGATIVE port. If we put in +33% into the splitter, we would again get +33% out of it - but out of the POSITIVE port.

Step 2: The Selector
The Selector is making sure that we are only ever dealing with ONE signal at a time. The options are:

'Null' - No Signal - i.e. the Battery.
Left/Right POSITIVE
Left/Right NEGATIVE
Up/Down POSITIVE
Up/Down NEGATIVE

There's something very neat and satisfying about dealing with one signal at a time - especially when playing with the microchip up and seeing the different wire paths light up and get passed through - or blocked - whilst using the controllinator

Step 3: The Combiners.

Ah, now this is where it gets interesting. On the surface it makes perfect sense that this would work - we are after all passing the negative values into the negative inputs and the positives likewise, and getting one output in the range -100 to +100 from it - why wouldn't that work? The interesting thing here is HOW it works.

Again, from rtm223's excellent guide: "The Combiner works out as a simple subtraction device and output is equal to the difference between the two inputs."

Okay, a bit confusing in our situation. It's also important to note here that the sign of an input value is disregarded. Hence our earlier -33% signal would be read as +33% by the combiner. So how do we get our negative values from the output? Well, so long as only one signal is put into the Combiner at a time, any value in the negative port will result in a negative output of the same magnitude, while any value put into the positive port will result in a positive one.

Here's how: Pretend the Positive Input of the combiner is called A, and the Negative Input is called B. The resulting Output value is always (A - B) (! But remember the values of A and B are always read as positive !). Now, because of the way we are controlling this setup, we can -never- have both positive AND negative values at the same, for two reasons. 1) because it is impossible to hold down the stick left AND right, but more importantly 2) we are using a Selector for our values, which only ever has 1 output at a time.

So consider we have our value of -33%. This will always be read by the Combiner as +33%, and a 'no power' value is read as 0%, so our options are either:

(Remember 'A' is always the positive input port, and B is always the negative input port)
A = 33, B = 0: 33 - 0 = 33

or,

A = 0, B = 33: 0 - 33 = -33

...and that's how that works. Have fun with your angular moving creations!

Making this work with other buttons
One final thing to mention is how to make this work when using any buttons other than the LR UP D-Pad or Stick outputs. Say you want to use X Square O and Triangle to control your object. Thankfully this is extremely simple, and we just need to remove the Splitters from the microchip and plug these buttons straight into the Selector. After all, we already have 4 outputs if we are using 4 buttons! We still need to 'tie' them together with the Combiner afterward of course. Again, the order they are put into the Selector will determine their priority - this could be more important in this set-up because unlike before, you can press both UP and DOWN at the same time, e.g. if they are set to triangle and X. Whichever of the two is lower on the Selector will take priority.

Here's how it should look:

http://i.imgur.com/hVaC3.jpg

See if you can spot the mistake I made in that setup
2011-02-12 22:53:00

Author:
merkaba48
Posts: 79


Nice writeup. I wouldn't have thought to use the selector that way. Interesting.2011-02-13 09:23:00

Author:
tdarb
Posts: 689


See if you can spot the mistake I made in that setup

Oo! Oo!
Looks like triangle and cross are wired up to left and right movement and square and circle are connected to up and down movement.
2011-02-19 01:53:00

Author:
DigiOps
Posts: 111


I just tried this setup on a joystick rotator and it works nicely! Thanks for the info! 2011-02-22 19:01:00

Author:
Boscoe
Posts: 51


kerrrect! You win ..... 5 full stops! Congratulations!!2011-02-22 21:19:00

Author:
merkaba48
Posts: 79


Okay, a bit confusing in our situation. It's also important to note here that the sign of an input value is disregarded. Hence our earlier -33% signal would be read as +33% by the combiner. So how do we get our negative values from the output? Well, so long as only one signal is put into the Combiner at a time, any value in the negative port will result in a negative output of the same magnitude, while any value put into the positive port will result in a positive one.


The selector actually doesn't pay attention to that +33%. It doesn't work with the analog portion of its input. It operates only on the digital portion of the circuit.

So if you hooked your circuit up to an analog stick, for instance - the selector wouldn't activate until you pushed the analog stick beyond 75% in one direction (the analog sticks always output the analog position of the stick - but only put out a logical TRUE once the analog goes beyond 75% - then they stay TRUE until it drops below 25%. The sign of the digital part of the signal matches the analog part.)

The output from the selector, whichever item is selected, is +1/+1.0 - digital "one" and an analog "one". So this works fine for a D-pad, but for an analog stick you'd lose the magnitude of the analog signal and retain only the direction - and it'd be subject to the rules that govern the analog stick's logical output.
2011-02-22 21:36:00

Author:
tetsujin
Posts: 187


The combiner actually doesn't pay attention to that +33%. It doesn't work with the analog portion of its input. It operates only on the digital portion of the circuit.

Either that's a typo and you meant selector not combiner, or you might want to clarify. Splitters/combiners work just fine with analog input. However what I think you are saying is that the selector prevents the analog portion of the input from making it to the combiner, since the selector only pays attention to (And passes through) the digital part?
2011-02-22 22:09:00

Author:
Tygers
Posts: 114


Cool! I have to try this. 2011-02-22 23:38:00

Author:
jalr2d2
Posts: 256


...that's a typo and you meant selector not combiner...

Yes, sorry, I meant selector. :| The selector operates on the digital logic portion of the signal and outputs +1/+1.0 on one of its outputs. That signal, not the +1/+0.33 is the one that makes it to the direction combiner.
2011-02-23 20:36:00

Author:
tetsujin
Posts: 187


The selector actually doesn't pay attention to that +33%. It doesn't work with the analog portion of its input. It operates only on the digital portion of the circuit.

So if you hooked your circuit up to an analog stick, for instance - the selector wouldn't activate until you pushed the analog stick beyond 75% in one direction (the analog sticks always output the analog position of the stick - but only put out a logical TRUE once the analog goes beyond 75% - then they stay TRUE until it drops below 25%. The sign of the digital part of the signal matches the analog part.)

The output from the selector, whichever item is selected, is +1/+1.0 - digital "one" and an analog "one". So this works fine for a D-pad, but for an analog stick you'd lose the magnitude of the analog signal and retain only the direction - and it'd be subject to the rules that govern the analog stick's logical output.

Ah, very good observation. I hadn't considered this in my post because the usage in my level only calls for binary uses of the sticks. I'll put a note in the original post.
2011-03-05 14:56:00

Author:
merkaba48
Posts: 79


kerrrect! You win ..... 5 full stops! Congratulations!!

Aww man...
2011-03-06 03:39:00

Author:
DigiOps
Posts: 111


here is a way to do what you want that keeps analog signals going through to the mover, i'm not very good at explaining so hopefully you understand the pic (also for those unaware, an easy way to post pics from create mode is simple take a picture with the in-game camera, find the pic and press square for "more" then select upload, you can then find it on lbp.me in pictures on your profile)
http://i8.lbp.me/img/ft/6081b87d39dd124226062dfca304f0b33ccede1b.jpg
2011-03-06 13:39:00

Author:
evret
Posts: 612


I just tried that out, but again it suffers from the NOT gates not being activated until the signal reaches 75%. However, I fixed this with sequencers using a 'positional' input. Picture first:

http://ic.lbp.me/img/ft/a2c172bd12ce64922ed3f8dd14d38215a1078498.jpg

Each sequencer has a battery which fills the whole space; this makes any non-zero signal give an output. That signal is then sent to the other direction's NOT gate. The sequencers must also be placed in the microchips to stop them both from activating at the same time.

Good work on your idea, I wouldn't have thought of it
2011-03-06 16:32:00

Author:
merkaba48
Posts: 79


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.