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

Multi-hit system

Archive: 5 posts


Hi!
English is not my first language, so I hope you can understand me.
I'm making a level with some turrets shooting bullets at a controlled sackbot. The bullet itself have a labeled tag, and the sackbot have an impact sensor that detects when the bullet impacts, and thus he loses life.

The problem is that the impact sensor can't detect how many tags are hitting it at the same time, so even if the sackbot gets hit by more than a bullet at the same time, he will just detects one impact, so he will lose the same amount of life than if a single bullet impacts him. Even worse, if a bullet impacts him right after another, the impact sensor will remain active and will not restart the one-shot counter, so if the sackbot is under heavy fire, he will become immune to nearly all the enemy bullets.

Does anyone have an idea on how to make a system that detects multi-hits?

Thanks!
2014-08-05 20:15:00

Author:
Mac-fox
Posts: 30


I have encountered this problem myself when making a similar logic system. An easy fix would be to tweak the bullet-sensor to deactivate as soon as it hits the sackbot. This way, the sensor wont remain active when the next bullet arrives. You should also add a counter set to one that resets itself, this counter should replace the spot between the impact sensor and the death-counter on the sackbot.2014-08-05 20:38:00

Author:
blacksackman
Posts: 234


Thanks for you answer!

I added some logic to the bullet, so it destroys itself when hitting the sackbot. The impact sensor stays active by just one tick, enough time to avoid interfering with the next bullet of the same turret (however, I had to reduce the rate of fire of the turret).
Now, the problem is that when two turrets shoot at the same time, sometimes they impact the sackbot at the same time too, or with one tick of difference, so the impact sensor just detects one impact. I synchronized the turrets to shoot alternately, but I had to reduce (again) the ROF of both turrets, and the problem isn't solved because depending of the sackbot's position, it can be hit by both bullets at the same time...

I think one of my wishes for LBP3 is a counter tweak for the impact sensor, just as the tag sensor haves .
2014-08-06 00:16:00

Author:
Mac-fox
Posts: 30


No problem!

The main issue with this type of logic using the impact sensor, often circulates multi-hits. The easiest way to solve this is to add more then one impact sensor on the sackbot. Each added sensor should require more tags to activate then the previous one. For example, if two bullets hits at the same time, the impact sensor needing two signals to activate will do so. All these impacts sensors should then be connected to a AND-Gate that leads directly to the death counter of the sackbot. But you may wanna add different counters as two bullets does more damage then one, or make it count twice using even more logic.

There's always a problem having this type of logic when you're dealing with shooting mechanisms. Speed objects right after another don't work well together with the impact sensor. I'll test around in my moon to find the best solution, until then try the things I said above.
2014-08-06 08:27:00

Author:
blacksackman
Posts: 234


I tested some methods and I finally found a solution! I'm not sure if it's the best, but I think it works, at least for what I need.

I added more logic to the bullet:

http://i59.tinypic.com/xlkp4h.jpg

The green impact sensor (label: "Sack") on the bullet detects when it collides with the sackbot and it's plugged to a counter set to one that resets itself, so the tag (label: "bullet") that damages the sackbot is active just if it collides with it, and just one tick. The selector induces latency so the bullet is destroyed one tick after the impact, letting enough time to the tag ("bullet") to be detected. The blue impact sensor is just to destroy the bullet if it impacts the floor.

Now, the detection system in the sackbot:

http://i61.tinypic.com/9gvskx.jpg

The green tag ("Sack") in the sackbot activates the damaging system in the bullet. The green tag sensor ("bullet") is set to counter and needs 100 "bullet" tags, its radius needs to be great enough to detect when a "bullet" tag activates; if there is just one player, the radius can be set to infinite, because there will be no interference.

Now, what happens when a bullet collides with the sackbot?

First, the bullet detects the collision, activates the "bullet" tag by one tick and then it's destroyed.
At the same time, the "bullet" tag sensor detects one "bullet" tag and outputs an a.nalogue signal of 1/100 i.e. 1%. The signal goes to the damage input of the health system.
Then, a single bullet will cause a damage of 1% in one tick.

If two bullets collide at the same time, there will be two "bullet" tags active at the same time, and thus the "bullet" tag sensor will detect 2/100 (2%) so two bullet hits will cause 2% of damage in the same tick. Three bullets will cause 3%, 17 bullets 17%, and so on. If you want each bullet cause more damage, you need an AND gate that multiplies the signal of the tag sensor by an higher than 100% signal. For example, if you multiply the output of the tag sensor by 500%, then each bullet will cause 5% of damage.

Theorically, this system should detect up to 100 bullets colliding with the target at the same time! If you want more than one target, you should add some logic on the bullet to detect which target gets hit, to avoid interference.

I'll test this system in more conditions to see if its reliable. I'll be grateful if you want to test it and tell me if it works fine for you.

And, of course, thanks for you feedback! (And sorry for my Google-translated english)
2014-08-06 17:29:00

Author:
Mac-fox
Posts: 30


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.