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

Counting from a group?

Archive: 4 posts


I could really use some thoughts on this.

Trying to put this as simply as I can... Imagine you can destroy a block and it sets off a chain reaction that destroys other nearby blocks. It happens so fast, it may as well be instantaneous, with the blocks being destroyed as a group. I need to be able to count how many were destroyed in that single event, to apply that number to other things.

The signals from the destruction of boxes happens too fast for most things to recognize. Counters, Selectors, Tag sensors, they can't read the signals fast enough to recognize the individual events.
I've tried a few methods, each with a drawback. The best I found was to have each block after the first emit an invisible hologram with a count tag on it (with the chain reaction wiping the field of tags before it goes off), and setting up sensors that read how many are active and wiring to a selector. Biggest problem with that is having to make a new sensor for every possible amount. Gotta set up a sensor for 2 tags active, 3, 4, 5, on and on. The result is a huge amount of sensors with a final limit.

That setup seems sloppy, and I feel like there's a better way to dynamically count from a group that I am not thinking of. Thoughts? Any tutorial you could point me towards, etc? Thanks in advance.
2012-09-24 21:55:00

Author:
Unknown User


If I understand...
Let's call the exploding block "X". Adjascent blocks are "A"
In a grid of nine blocks...

AAA
AXA
AAA

... that's 9 blocks destroyed. Correct?

If you will only be destroying between 1-9 blocks, then you just need an overarching system off to the side of the level, with 9 tag sensors linked to that selector that cover the entire level. The 9 tag sensors go into 9 selector ports, each sensing a specific number of tags (1 tag, 2 tags, 3 tags .... 9 tags, respectively). Each output of the selector can be linked to whatever result you want, whether that's a score system, certain events, etc. Then just wire the selector to reset right away, before another X block is destroyed.

I fear that I'm just describing what you've already got, minus the emitted holograms. Apologies if that's the case. However, emitting seems unnecessary: you can have the logic directly on blocks in microchips that achieve the same result, it seems, by triggering tags and having their results play out a few milliseconds before the blocks are all destroyed.

Someone more knowledgable should be along with a tutorial link to feedback loop logic, if you haven't already implemented that. It does wonders for speed of detection, down to something like 1/30th of a second.

Hope this is helpful!
2012-09-25 05:01:00

Author:
Unknown User


this thread should help you out
https://lbpcentral.lbp-hub.com/index.php?t=59607-How-to-buffer-events-(and-use-it-with-a-counter)

edit: the last page of the thread contains a better system to the one on the first page. also it is a per frame system so u only need enough sensors to cover the maximum that could b destroyed within the same frame
2012-09-25 08:37:00

Author:
evret
Posts: 612


Arbiekko, thank you for the reply. I am sorry if I wasn't clear. I am not exactly skilled with all of this stuff... never looked at online tutorials or guides, just learned from in-game tips and experimentation. Sorta cobbled things together, so they're often not so elegant or efficient. I'm sure there are better ways.

In the case of the holograms, I used them because the blocks themselves are emitted objects that come out in random numbers and positions. Imagine a grid where blocks of different kinds drop randomly in columns. If 2 of the same kind are touching and one gets destroyed, it destroys the next - creating a chain reaction that snakes through the stacks taking out all like kinds that are immediately adjacent.
I need them to destroy as soon as possible to keep things moving. So because they are destroyed so soon one after another, individual tag signals don't get read. But they also don't 'die' fast enough that all would register at the same time if they lit up a signal just before being destroyed. The first in the chain would be well gone by the time the last one pops. I needed a way to preserve that 'death' count after the box was destroyed, so all could be acted upon at once. So, since the tag directly on the box would be destroyed before all would be counted, best I could think of was emitting a short lived tag instead, so all destroyed could be seen at once.

I tried letting the signal pass through the blocks first so that all in the chain were lit up before destroying them at once, but I didn't like the delay or effect, so it was better to let them go one by one, each destroying the next.
Hope that makes some sense.

Evret, thank you for the link. I read it all. A bit over my head atm, going to take a few read throughs and some experiments to get it down I think. By comparison, though, almost seems like less work to just set up a sensor with X tags active for every possible amount atm. XD
2012-09-25 23:13:00

Author:
Unknown User


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.