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

Using min() function of AND gate then trigger on output magnitude=(y)?

Archive: 5 posts


There may be a simple solution to this but at the moment I?m not seeing a good one just yet.

I have a number of sensor tags that get placed by the player and a sackbot that has actions triggered based on how far away it is from these tags. One of these functions is that the sackbot is destroyed if it gets farther than 85 units from any one of these tags.

This is easy enough to do and now that the poor sackbot is on a short leash I need to provide a visual indicator to the player as to when the sackbot is reaching the boundary of this safe zone. Since the tags are placed by the player as they move through the level I initially set the logic to display the different visual indications based on the distance from the previous tag. Works just fine.

But the player is free to run back through all the previous tags so the detection cannot be based solely on the previous tag but all of them. I need to sense all of these coded tags and trigger a true output when the smallest distance from tag sensor and the x unique tags becomes greater than y.

If I set a tag sensor for each tag with a large enough radius to ensure that the tag is always seen and feed the ouput of each sensor into an AND then the output of the AND is the value of the smallest input value. Great. But now I need something to measure that output and become true, or high or activate the output when the magnitude exceeds the threshold and this is the part I don't know just yet.

Ideas?

------

As I think about this I may be able to work around this problem by changing my tag structure. Currently each tag has a different label as each one also trigger unique actions based on its order of placement. But if I had a tag with on every node that was identical than a single tag sensor set for that tag may output only the distance to the closest tag even when multiple tags are present.

If this is the case then I can go this route. But if a tag sensor outputs the value of the distance to the farthest tag when multiple are present, which I think it does, then I?m out of luck going this way.

Any ideas?
2011-01-24 18:11:00

Author:
Trindall
Posts: 297


When it comes to reading analog values, my favorite tool is a sequencer set to positional. Positional works by placing the sequencer bar (the part that actually triggers whatever is on the sequencer) at the same percentage as the analog signal being input. So if you've got a sequencer 4 bars long and you're receiving a 75% signal, the light bar thing will be right on the edge between the third and fourth bar (it triggers whatever is directly to the right).

You can place batteries at various positions on the sequencer to trigger lights, holographic material, sounds, or any other sort of feedback to let the player know that the sackbot is nearing the danger zone.

I thought that a tag sensor set to "closeness" would react to the closest tag. Is that not the case?
2011-01-24 19:37:00

Author:
Sehven
Posts: 2188


When it comes to reading analog values, my favorite tool is a sequencer set to positional. Positional works by placing the sequencer bar (the part that actually triggers whatever is on the sequencer) at the same percentage as the analog signal being input. So if you've got a sequencer 4 bars long and you're receiving a 75% signal, the light bar thing will be right on the edge between the third and fourth bar (it triggers whatever is directly to the right).

You can place batteries at various positions on the sequencer to trigger lights, holographic material, sounds, or any other sort of feedback to let the player know that the sackbot is nearing the danger zone.

I thought that a tag sensor set to "closeness" would react to the closest tag. Is that not the case?
That sounds like a great use for the sequencer but I?m not sure if it will get me a strong degree of precision if I put it in my original implementation. Originally I had a different tag on each node for use in other actions.

If I set five tag sensors with a radius large enough to cover the maximum allowable distance between five nodes and the limit, put the outputs all into an AND gate then I?d expect the trigger thresholds I?d care about would be at 10%, 15% and 20%. I can set up a sequencer tiled in 5% increments and set up the batteries/components at those spots to get what I need.

However I did know that the ?Closeness? option would set the tag sensor to react to the closest tag. If this is so, and it sounds that way, then a better solution will be to put an identical tag on all nodes with a small exclusion zone so that it will not see itself and with the radius large enough to cover all nodes. (Or more realistically large enough to cover any 2.5 nodes.) Set the tag to ?Closeness? and then trigger my alerts when the distance to the closest node exceeds 40 and 60 units.

I?ll try out both of these tonight when I?m back on the PS3. Thanks for the suggestions.
2011-01-24 21:50:00

Author:
Trindall
Posts: 297


Tags sensors always pick up the nth closest tag - where n is the number required.

So if you set it to require 3 and closeness, it will return a value proportional to the 3rd closest tag.
If you set it to require 3 and signal strength, it will return the signal strength of the nth closest tag.

Which is pretty useful to know


You should be able to get just about any level of precision you want on a sequencer - I'm pretty sure I've had one with a couple of hundred stripes in the beta and the values of analogue signals are far more accurate than the 1% that batteries allow you to represent.
2011-01-24 21:58:00

Author:
rtm223
Posts: 6497


Tags sensors always pick up the nth closest tag - where n is the number required.

So if you set it to require 3 and closeness, it will return a value proportional to the 3rd closest tag.
If you set it to require 3 and signal strength, it will return the signal strength of the nth closest tag.

Which is pretty useful to know


You should be able to get just about any level of precision you want on a sequencer - I'm pretty sure I've had one with a couple of hundred stripes in the beta and the values of analogue signals are far more accurate than the 1% that batteries allow you to represent.

The sequencer looks like just the tool for precision. It looks like a lot of fun to play with. Thanks for confirming the function of the 'Closeness' option. I was assuming it worked the same as the player sensor and the 'Number of Players Required' option which works to the same nth closest player.

Based on this I will not be able to use a single tag sensor to output the percentage of distance to the closest tag as it will only give me the percentage of the distance to the farthest tag.

--It looks like I will have five tag sensors against five different tags.

--Output of each tag sensor goes into an AND gate, which outputs the proportional output of the smallest input. (Which will be the value of the closest tag to the sensing node.)

--The output of AND goes into a sequencer set to positional.

--I set batteries from the 10% - 15% region and in the 15% - 20% region to trigger my two visual indications.

Thanks again for the help.
2011-01-24 22:21:00

Author:
Trindall
Posts: 297


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.