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

Detecting changes over analogue signals (detect increase / decrease)

Archive: 12 posts


After the rather insightful thread on storing analogue signals (https://lbpcentral.lbp-hub.com/index.php?t=59597-Analogue-value-storer-remapper), thanks to Aya042, I learned about D-latches. I then decided to share not only the improved D-latch design, but also an application of it where we can detect increases, decreases over analogue signals and by how much, and also know exactly when an analogue signal is not changing anymore. I believe it has a lot uses when applied correctly.


http://www.youtube.com/watch?v=carMluSV-EM

It can be used a basic motion sensor, will let you know whether an object is getting closer, or getting further, or staying at the same distance, it may be used to detect when a timer with feedback loop stabilizes to its new value (haven't tested the latter one, but should work). It should also have many other uses that I'm sure you creative guys will find out!

You also don't need it to run with frame accuracy. You can detect per-frame like here, but when you use timers to control the selector instead of it switching itself, you can detect changes over arbitrary intervals. When you are done detecting, you may want to turn off the detector chip.

I'll later consolidate all my video tutorials into a single thread, btw!

Addendum:
As an addendum, this tutorial uses Aya042's improved D-latch design, used for storing the analogue values in alternating fashion. Here's the image provided by Aya042. It is modified from the D-latch from Tetsujin by me, and then Aya042 gave it its final layout:
http://i5.lbp.me/img/ft/e0527fe888eab8ff9010121c9855a6ae2ad4eb18.png

You can see an explanation to the origins of the D-latch here. (https://lbpcentral.lbp-hub.com/index.php?t=52358-Analog-Memory-Cell&p=801484&viewfull=1#post801484)


I'll explain the technique just in case:
*Have two D-latches ready. They will store the analogue input in alternating fashion.
*The D-latches will receive input from your analogue source. Connect your analouge source to both D-latches.
*Activate storage of analouge values to d-latches using an alternating selector. This selector changes its ouput every frame, so that one d-latch stores the current value, the other remembers the value from last frame
*Subtract the output of d-latches using direction combiners. One combiner will have the positive input from the top one, the other combiner will receive the positive from the bottom one.
*Using our self-cycling selector, we select and apply these analogue values to a single output, at the right frame, using XOR's. (The XOR trick for applying specific analogue output to a single wire). This way, we can see if the analogue value has increased, decreased from, or is the same as the last frame.
2011-07-10 10:40:00

Author:
hesido
Posts: 166


I would have thought of substraction, but using D-latch is great!
(got, he should write his text before making the video...)
2011-07-12 18:10:00

Author:
Unknown User


This is always great stuff, but as things move into d-latch and all of this super cool analogue experiments, I'm feeling a little more left out. Not because I can't follow it but I find it hard to grasp the concept without any backstory or LBP world uses.

This isn't a complaint I would just love to open a thread that said Hypercompu-analogue-based iterations and the first thing I read is this can be used to make sackbots face away from the screen and allows for faster damage calculations. Then I can go 'OK MIND: LETS DO THIS!'
2011-07-13 08:47:00

Author:
Mr_Fusion
Posts: 1799


I agree that I should add real world uses to these stuff. I was planning to add a mini game that the user is forced to find a secret location to this, but I had limited time and I was over-excited to share this. I thought this would change people's lives, lol.

For example, this can be used to make a hot-and-cold game. If the user is nearing the secret object, a bot could say hotter, if the user is going away from the object, a bot could say colder. For follower systems, it could be an accurate measurement of whether the follower stops moving, so the next follower can be activated.
2011-07-13 10:20:00

Author:
hesido
Posts: 166


thanx for this, i had a very similar chip with 3 outputs- getting higher, getting lower, and staying the same. however your method is a bit more responsive than mine


This is always great stuff, but as things move into d-latch and all of this super cool analogue experiments, I'm feeling a little more left out. Not because I can't follow it but I find it hard to grasp the concept without any backstory or LBP world uses.

This isn't a complaint I would just love to open a thread that said Hypercompu-analogue-based iterations and the first thing I read is this can be used to make sackbots face away from the screen and allows for faster damage calculations. Then I can go 'OK MIND: LETS DO THIS!'
my spiderman (custom grapple) uses this to know when the rope/web needs to get tight when you are walking on the ground. if you are walkin on the ground with a rope attached above you, you will start swinging/be lifted off the ground as soon as you start moving away from the ropes anchor point
2011-07-13 12:36:00

Author:
evret
Posts: 612


lol, this is why I sought this thread out. I had a feeling it was part of the positional mover thing!

I was also looking at this thread https://lbpcentral.lbp-hub.com/index.php?t=53559-How-to-divide-analogue-signals and just made myself a tea, gave a quick pep talk to my brain and am settling in to wrap my head around all of this.

I think that it has some pretty good potential to help track of some things I am working on at the moment.

And with your spider-man, I can't remember what the web was made out of, but what is the potential of faking it with a wire set to visible coming off of a white logic board? Like that red cursor I showed you in my stage? Or does it need to 'exist'?
2011-07-13 12:49:00

Author:
Mr_Fusion
Posts: 1799


this doesnt have anything to do with the positional mover itself, it is just one part of a few conditions that must be met b4 the positional mover becomes active for my custom grapple.
also thats not a bad idea with the wire for the web, i'm currently using a 0% strength elastic but the wire should look a lot better as it's purely for visual purposes
2011-07-13 14:19:00

Author:
evret
Posts: 612


I'm not sure what I'm going to use this for, but detecting analogue change is awesome. Possible uses are:
- In a health system, where if enough damage were dealt within a certain time, the unit would be stunned or something.
- An economy system, where each turn, you get a report on changes in cash, supplies, etc
- Measure acceleration when used with speed sensor (could be used to calculate G-force, which could be used for w.e., maybe unconsciousness for jet fighter games)
- Thinking of more

Great tool.
2011-07-13 15:38:00

Author:
SSTAGG1
Posts: 1136


SSTAGG1 is right, but this is LBP! You're thinking too much for me. I'm gone building my supertopsecret level for the LBPC contest 2.2011-07-13 19:53:00

Author:
Unknown User


SSTAGG1 is right, but this is LBP! You're thinking too much for me. I'm gone building my supertopsecret level for the LBPC contest 2.
Lol, maybe I should stop commenting on stuff then. I'm planning on using the damage stun and possibly the economy thing in my entry.
2011-07-13 21:11:00

Author:
SSTAGG1
Posts: 1136


Thanks alot for the tutorial. 2011-07-23 18:15:00

Author:
TheGoldenFlash
Posts: 209


I'm not sure what I'm going to use this for

yea, i'm not sure either but now that i think about it, you could use this for money logic
2011-07-24 02:15:00

Author:
zzmorg82
Posts: 948


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.