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

Detect which tag is closest in it's radius?

Archive: 7 posts


So I'm trying to figure out how to make a sensor detect the closest tag in it's radius, as in there will be multiple tags within it's detection range but I want it to get the closest.

I'm trying to make a kind of AI system for sackbots in water, so when they're underwater they will swim to the surface (done and works) and then look for the closest way out onto land and go to it. I know there's a few ways I could do this, but right now the thing that I'm trying to figure out is to get the sackbot to find the CLOSEST way out.

Any ideas?
2016-11-20 01:12:00

Author:
temple1997
Posts: 36


Sorry, I have no idea how to do this, but I'm sure that our logic experts soon will give you the hints that you need! I wish you luck for your project! Happy Thanksgiving and many greetings, Jürgen^^2016-11-20 06:19:00

Author:
CuriousSack
Posts: 3981


I don't know if I'll check back (what with it being Thanksgiving and finals and Final Fantasy XV coming up), but here's my solution based on how I interpreted your question.
Emit two squares when at the top of the water (one going left, one going right) divided horizontally (with a top and a bottom each with impact sensors) that stops when the bottom hits something. If the top is NOT hitting something (this is checking if it hits a wall instead of an exit) activate a tag that is labelled thisWay or something. This triggers the sackbot to follow a tag placed onthe top right corner of the square to exit (via a selector with 3 options (1 for nothing, 1 for follow right, 1 for follow left)). When the impact condition is met, make sure to delete the other square fully to avoid problems (have the square with the thisWay tag in a chip look for thisWay everywhere but the chip and set it to a destroyer).

If you want a more complicated system (finding an exit underwater) Look up how GPS works (Graph processing system). It essentially is treating intersections as vertices and paths as edges. Either that, or manually map it out (if it's small enough, I recommend this (especially for LBP))

Now that I think about it, there might also be a signal strength setting that gives a percentage based off of distance. If that's the case use that with left and right sensors and just use a greater than logic piece to determine what to do.
2016-11-24 09:47:00

Author:
koltonaugust
Posts: 1382


I made such Logic for a friends Football Game Long ago in LBP2 to find the nearest bot next to the ball, can look on Weekend if i can find it or i can remember how it worked2016-11-25 12:53:00

Author:
Hanfi1311
Posts: 776


Maybe I am remembering badly, but couldn't you set a follower to strength to achieve what you need?2016-11-25 13:08:00

Author:
jwwphotos
Posts: 11383


I'm 3 weeks late to this thread, my apologies -
But this is so simple to do I'm surprised nobody else said it -


A Broadcast Microchip (BCMC) goes on the Sackbot, and spawns on the nearest exit Tag. The BCMC only needs to contain a single Tag of its own - Lets call it 'UseThisExit'. Then the Sackbot moves towards that Tag.

I leave LBPC for a few months and this is the quality of help responses? Augh. I have to do everything.
2016-12-17 19:53:00

Author:
Ostler5000
Posts: 1017


Huh, I didn't know broadcast chips had that setting. I don't use them that often because I prefer controllinator for advanced logic due to some weird finicky things with broadcast chips2016-12-18 10:07:00

Author:
koltonaugust
Posts: 1382


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.