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

Off-screen detection

Archive: 4 posts


Hello,

My level was meant to be played by 1 o 2 players, but I'm trying to make it playable by 3 or 4 players. For that purpose, I've made a multiplayer sackbot checkpoints system, and I'm trying to kill off-screen sackbots (like a normal sackboy). I've tried to detect off-screen scakbots, but I can't find a solution (distance based detection is not possible as the angle and zoom change through the level).

Do you know if this is possible?

I have skipped information to have a simple question, but feel free to ask details if you want. But the basic idea is to have an off-screen detection.

Thank you !
2011-10-06 15:47:00

Author:
Slurm
Posts: 262


This is most certainly possible and I would venture to say you can do it with measuring distance. And you can change the threshold when zooming if you'd wish to.

A tag sensor plus a corresponding tag "distance" will per default output both a digital signal (there or not there) and an analog value (percentual distance of tag to sensor within detection radius). It is this analog signal we need. First you set the sensor's radius to the minimum you'd want a bit to be in in order to exist at max zoomed out level. Stick this sensor on the bot and the tag "distance" on the target (player(s)). Invert the sensor so it will output 100% when outside the radius and 0% when on top of the target.

Now stick a battery on the player leading to another tag, tag "norm". Back on the bot stick a tag sensor for "norm" with a very large radius and set to signal strength. Wire the output of that sensor into the positive input of a signal combiner. Wire sensor "distance" to the negative input. Wire the combiner to a signal splitter. We'll be be using only the positive output of the splitter; now, when the distance of the bot to a player is less than the norm signal, a remainder signal will result from the combiner. When the distance is greater than the norm, the result will be zero.

Now, wire the positive output of the splitter to a positional sequencer that has a 100% width battery on its canvas. Wire the battery to a NOT gate because you want a signal when the bot is outside of the norm distance (splitter result zero). The NOT gate can wire to a destroyer.

You can now change the norm signal at you leisure in order to lower the norm distance at which bots need to be in or else get destroyed. You'll be wanting to replace that battery by some other logic that gets triggered by a player being near a zooming camera. But I'll leave that up to you.
2011-10-06 17:48:00

Author:
Antikris
Posts: 1340


Thanks for your anwser!

I already had this idea (well, a close idea), and this could work but with a lot of constraints (This will be difficult to implement as the detection zone is a constantly changing quadrilateral, and not a perfect rectangle with only a few zoom changes). I was trying to find an elegant solution that does not involve configuring the offscreen zone based on player position. I guess i'll restrict the level to 2 players max.

Anyway thanks again for your answer
2011-10-07 10:46:00

Author:
Slurm
Posts: 262


I can't go into much detail, but I would use tags(magnetic keys) like Antikris.2011-10-08 01:49:00

Author:
Cronos Dage
Posts: 396


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.