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

Single Digit and Percentage Scoring!

Archive: 19 posts


Hey Guys -

Breakthrough today. I realized that it IS possible to set up a score giver to give odd scores (in other words, not in multiples of 10). Scroll down below the bubble to just see the solution.


Dive into my brain to see my thought process! (long post)
From playing around, I noticed that there is a "scaled every second" feature on the score giver. So I threw down a score giver set to 10 points and gradually jumped closer in the area of effect. The score giver was granting me various scores between 1 and 10 based on the distance I was from the score giver. I'm sure most of you have seen this effect in some way, even if it was just from playing around.

That being said, I tried to figure out a way to "scale" the score giver manually. That's when I remembered comphermc's health bar tutorial where he placed a battery on a microchip and then activates the whole microchip to turn on the battery. So I hooked a button to a pulse switch, wired it to a 50% battery on a microchip, and wired the battery to the score giver.

I hit the button and... Nothing. Since the battery only activated for a split second, the score giver did not have enough time to cycle "every second" as the setting implies. So I added a reverse input 1 second timer in between the pulse switch and the battery so that the microchip would stay on for 1 second.

I hit the button and... 5 points! All I had to do was adjust the power of the battery to get different scores, i.e., 30% = 3 points, 70% = 7 points, etc.

Success! Or so I thought for a few presses. Then I noticed an inconsistency.

So here was the problem:

The 1 second timer does NOT precisely correspond with 1 second on the score giver. You get the right score, but at a different time after each press of the button. After 10 or so presses, the score giver will skip one beat and not give out a score. I tried playing with the timing on the 1 second timer - up to 1.1 - but that had the opposite effect. Every ten or so presses, the score giver would activate twice.

I think this is because the timer counts the fraction of a second when it actually reaches 1 second as a part of that total 1 second... Does that make sense?

So how can I fix this? Then the stars aligned and I had figured it all figured out. The button (or the input otherwise) had to activate an emitter that would handle the scoring. So an emitter (emit 1) would push out a microchip on an invisible hologram which contained a battery set to a percentage of a score connected to a score giver set to "scaled every second." Then a 1 second timer on the microchip connected to a destroyer tweaked to disappear.


JUST TELL ME HOW TO DO IT:

So, it's an emitter set to emit 1, which pushes out a hologram with a microchip. The microchip will have a battery set to the percentage of your choosing connected to a score giver set to scaled every second - making almost ANY score between 0 and 10,000 now possible. For example, 125 would be a 50% battery connected to a score giver for 250 points. Then you just hook a timer set to 1 second to a destroyer tweaked to disappear. One additional small tweak - it actually works best (and appears to the player to be an actual score giver) if you capture the object right before it gives a score. Even in pause mode, if the score giver is connected to a battery, it will tick off a score every second. So pause the game, reset the timer, and right as the score is disappearing, hit capture. This way, right as it is emitted, it will give the score to the player. You'll also need to reduce your timer to .5 (or less if you prefer) just to make sure it doesn't score twice.

I realize this is somewhat cosmetic to your level, but I have seen some questions in the help forum about how to score in single digits.

Have fun with all your new scores! It will blow people's minds when they score 99, 115, 27, or any other scores you throw in there. How fun! hahahaha

(Once the network is back up, I will add pics)
2011-04-29 22:12:00

Author:
shane_danger
Posts: 283


Cool find. Will be good for rpg makers. Also it worked fine by putting the score giver and battery on a chip and connecting an inverted timer set on start countdown with a time of 1 sec. Just have something trigger the reset and it works perfect. Also from -10,000 to 10,000 can be used with it so even better for rpg makers...Too bad the score sensor doesnt work the same way.2011-04-30 00:28:00

Author:
L1GhTmArE
Posts: 519


huh, that's interesting. I tried it quite a few times with the 1 sec timer and it did not work. I'll have to play with it later.2011-04-30 00:53:00

Author:
shane_danger
Posts: 283


I have a scoregiver that hands out it's score in sub 0.1 seconds. I did manage to get an even faster one, but it wouldn't want to adjust itself to given ana.log signal (mine has to adjust itself to a varying signal strength). Took about an hour or tries to get it.

Also, I have a question. I think that in Betas our scoregivers had the tweak "scaled one-shot" available. Is that only my delusion, or was it real? If it was, BRING IT BACK NAO
2011-04-30 12:42:00

Author:
Unknown User


This works brilliantly! I've made the collectable gems for my Spyro series (Very early stages btw). 1, 2, 5, 10 and 25 point ones. There is a slight delay but the emitting works. Thanks for this tutorial!2011-04-30 19:17:00

Author:
Jedi_1993
Posts: 1518


I have a scoregiver that hands out it's score in sub 0.1 seconds.

That sounds familiar.

@OP: see this post (https://lbpcentral.lbp-hub.com/index.php?t=53260-How-to-transfer-data-from-one-level-to-a-sub-level&p=814133&viewfull=1#post814133) for a bit more info on the mechanics of Score Giver timings.



I did manage to get an even faster one, but it wouldn't want to adjust itself to given ana.log signal (mine has to adjust itself to a varying signal strength). Took about an hour or tries to get it.

I theorized there'd be a limit on the minimum time offset based on the observation that emitted Tag Sensors never update their state on the same frame they are emitted. The same was true of Mag Switches in LBP1, which was the reason I could never get a two-input zero-latency logic gate (https://lbpcentral.lbp-hub.com/index.php?t=23400-Zero-Latency-Set-Reset-and-Toggle-Switch) to work in all cases.



Also, I have a question. I think that in Betas our scoregivers had the tweak "scaled one-shot" available. Is that only my delusion, or was it real? If it was, BRING IT BACK NAO

I don't believe it was ever there, particularly as one-shot inputs always use the digital component of the signal, which is inherently unscalable.
2011-04-30 19:38:00

Author:
Aya042
Posts: 2870


That sounds familiar.

@OP: see this post (https://lbpcentral.lbp-hub.com/index.php?t=53260-How-to-transfer-data-from-one-level-to-a-sub-level&p=814133&viewfull=1#post814133) for a bit more info on the mechanics of Score Giver timings.


@Aya - wow, so I was right about that. So I would need another pulse switch right after (or maybe right before) the 1 second timer to eliminate the problem. Interesting.

I also noticed this when trying to make a timer. A 0.1 sec timer set to reset itself will not line up with a 1 second timer after 10 hits.
2011-04-30 20:10:00

Author:
shane_danger
Posts: 283


I also noticed this when trying to make a timer. A 0.1 sec timer set to reset itself will not line up with a 1 second timer after 10 hits.

Yep. Timers aren't particularly accurate. See this page (http://wiki.lbpcentral.com/Talk:Timer) for the timings.

Note that the reset itself takes an additional frame, so a self-resetting 0.1s timer runs at 7.5Hz rather than the more obvious 10Hz.
2011-04-30 20:16:00

Author:
Aya042
Posts: 2870


huh, that's interesting. I tried it quite a few times with the 1 sec timer and it did not work. I'll have to play with it later.

so you want to know why when you set it to one sec it didn't always work? because it only ever counts a the exact time the first time it counts every other time is off by a hair either under or over. so when on the 10th or so time when you hit the button it didn't give a score it was because it didn't have enough time. and when you got double at 1.1 it was because if was active for longer than that and spat out two. timers are fickle creatures.
2011-05-01 08:54:00

Author:
Unknown User


emmiting ? why, just place the battery on a sequencer ! You can even make the sequencer 1 unit wide and set it to position. Then hook a counter to it, set the counter to reset itself, and make it max 1-shot. Now you made a one-shot tweaked score giver ! This will be usefull in my pac-man game, thx !2011-05-11 01:49:00

Author:
Unknown User


emmiting ? why, just place the battery on a sequencer ! You can even make the sequencer 1 unit wide and set it to position. Then hook a counter to it, set the counter to reset itself, and make it max 1-shot. Now you made a one-shot tweaked score giver ! This will be usefull in my pac-man game, thx !

Pac-man game... Theres a Mm picked pac-man.. unless its a new and improved super pac-man!
2011-05-11 03:57:00

Author:
Dortr
Posts: 548


emmiting ? why, just place the battery on a sequencer ! You can even make the sequencer 1 unit wide and set it to position. Then hook a counter to it, set the counter to reset itself, and make it max 1-shot. Now you made a one-shot tweaked score giver ! This will be usefull in my pac-man game, thx !

You could do that, but you'll still need to have the timing right so that it appears to go off right as the player touches it. You could also run into the problem Aya mentioned since the counter uses up a frame. Eventually you'll get out of sync (in theory). Depends on how many times you need to hit the score giver.

But good idea either way. It's cool how you can get the same results using different functions.
2011-05-11 14:03:00

Author:
shane_danger
Posts: 283


For info, my pac-man game is not a pac-man copy, it will be different. Plus, I make level because I like to puzzle myself with logic challenges. My path system is neat (the pacman is made of hologram).

You might haven't noticed if, but if you click square on a sequencer, it places a line there, where is will start if you unpause. Place this line just at the starting edge of a scoregiver, the scoregiver stays off. But place it on the ending edge, it is on ! By hooking a set-reset switch (counter with max 1) to the sequencer set to POSITION, a 0 signal will be at the starting edge, off, and a 1 signal will be at the ending edge, off. Doing this, you can give a power function to anything, including batteries. Activating the counter which activates the sequencer which activates the battery which activates the scoregiver... okay, there might be a small delay of what, 10 frames or less ? I don't think the player will even see a delay, it is just an idea.

Knowing this, always leave an empty space at the end of a sequencer if you don't reset it, cause the last thing on it will stay on if you don't.

EDIT : It doesn't work.
2011-05-12 00:31:00

Author:
Unknown User


Cool find. Will be good for rpg makers. Also it worked fine by putting the score giver and battery on a chip and connecting an inverted timer set on start countdown with a time of 1 sec. Just have something trigger the reset and it works perfect. Also from -10,000 to 10,000 can be used with it so even better for rpg makers...Too bad the score sensor doesnt work the same way.

One thing I didn't think of before. If you have a level with faster action, you can't have the score giver hooked to the timer or a sequencer. I think it would have to be emitted. The reason being is that if two events trigger the same score within the one second, the game couldn't decipher that it needs to complete the process twice - unless you work out a buffer system. Not too complex, but an important caveat. I personally think emitting is the easiest way, but some might prefer the buffer to avoid using an emitter.

The other cool thing with the emitter is that you can stick it right to a sackbot, triggered by a tag. This would ensure that the score would pop up over the players head.

I may edit the original post with this info unless someone thinks of a way that the timer or sequencer method can handle simultaneous events.
2011-06-15 15:51:00

Author:
shane_danger
Posts: 283


I may edit the original post with this info unless someone thinks of a way that the timer or sequencer method can handle simultaneous events

As you said, not too hard to make. We have been toying around with this together, remember? Signal combiner to a 10-shot counter; feed pulses into the + port. 10-stripe positional sequencer hooked behind the counter with a battery spanning the entire sequencer canvas except the zero position; this will signal any following logic that the counter is greater than 0 and thus it should be emptied. Combine a pulsing signal (looped NOT gate) and the sequencer battery to an AND gate. The AND gate's output goes to the - port of the signal combiner and whatever action you actually are buffering for - in this case your score emitter.

EDIT: take it a step further, if you need to detect a simultaneous pulse on two separate sources, you do the following: lead them both through an OR gate. Also hook them up to an inverted XOR gate. Both the OR and inverted XOR go to an AND gate, which will ping TRUE when signal A and B are simultaneous; now you can set up a 2-shot counter and pulser similar to the buffer logic above that will fire off two consecutive pulses as a replacement for the two simultaneous pulses. These pulses lead to an OR gate of which the other input comes from the first OR gate in this paragraph.

There is still a caveat in this: if a dual pulse is immediately followed by a single pulse, then that may result in one of the buffer pulses arriving with the single pulse at the last OR gate at the same time, resulting in one pulse lost. You could fix this (now comes the theory) by replacing that last OR by another inverted XOR/OR/AND combo feeding back into dual pulse logic. I just haven't tried this yet. It may just be that the dual pulses are sufficiently slowed down that they fire offset to the single pulse and never collide in practice; a statement that I dare to believe since my shooter's score counter has been working great so far.
2011-06-16 16:57:00

Author:
Antikris
Posts: 1340


As you said, not too hard to make. We have been toying around with this together, remember? Signal combiner to a 10-shot counter; feed pulses into the + port. 10-stripe positional sequencer hooked behind the counter with a battery spanning the entire sequencer canvas except the zero position; this will signal any following logic that the counter is greater than 0 and thus it should be emptied. Combine a pulsing signal (looped NOT gate) and the sequencer battery to an AND gate. The AND gate's output goes to the - port of the signal combiner and whatever action you actually are buffering for - in this case your score emitter.

Haha thanks.. I was going to explain how to do it in the OP with the edit. I'll just refer to your post.
2011-06-17 03:44:00

Author:
shane_danger
Posts: 283


I did some more heavy duty testing on my score counter and especially during moments that I am hitting two enemies at once a discrepancy occurs. I used a 1-tag sensor for ordinary score events and a 2-tag sensor for the occurrence of double events and these two signals often collided. In one way that is expected (a 1-tag fires when a 2-tag fires), but there are exceptions.

Eventually, I settled with everywhere where there is a chance of simultaneous pulses (and thus a chance of signal loss), I set up an array of buffers as described earlier; one for each channel. A fast cycling selector runs through every unit in the array and if a buffer is filled, it stops cycling and starts unloading the buffer into the central output. Emptied, it goes on to the next filled buffer. This way, even though the scoring does not keep up the pace of the action, all points being made do get awarded and none is lost.

Except for when you hit three targets at once, but the line has to be drawn somewhere.

Here is that buffer array (the red line is a pulser signal):

http://i9.lbp.me/img/ft/599e2929c89c2c27f17985147dd7c42fb7361f40.jpg

A 2-channel array however illustrates the idea more simplified, though:

http://ie.lbp.me/img/ft/51e3e781bf5b84f8988e664e47eed57554b7f34d.jpg

Now that I look at it, I can probably do without that one buffer right before the final output leaves the chip. It already receives input as fast as the pulser can process it and it is all sequential, so there is no reason to buffer that single signal.
2011-06-17 07:15:00

Author:
Antikris
Posts: 1340


Except for when you hit three targets at once, but the line has to be drawn somewhere.


I don't think you'll have to worry about that very often. Especially since, if I'm reading your logic right, the three targets would all have to be the same type of target as well. I would think even in a fast action shooter that would be rare. Unless you have a big bomb that destroys everything on the screen. And if it is the type that radiates out, you'd still have a tough time hitting 3 targets at the exact same moment (on the same pulse).

EDIT: Also I think you should post a tutorial on the buffer system that you designed. It's so simple, but has such a variety of uses.
2011-06-17 18:23:00

Author:
shane_danger
Posts: 283


I don't think you'll have to worry about that very often. Especially since, if I'm reading your logic right, the three targets would all have to be the same type of target as well. I would think even in a fast action shooter that would be rare. Unless you have a big bomb that destroys everything on the screen. And if it is the type that radiates out, you'd still have a tough time hitting 3 targets at the exact same moment (on the same pulse).

It is more common than I thought it would be, especially with weapon upgrades, but the dual buffering solves 95% of the problems. The discrepancy is there, but not obvious and serious enough to affect gameplay.

It can't be the same target giving off 3 simultaneous pulses, since the impact sensor only creates one pulse (and I make it pulse as quick as I can for a new impact to follow, but it obviously will never be simultaneous, neither would it have to be). It is when you fire two or more bullets that hit multiple targets at the same time; when enemies are all over the place, that doesn't happen often, but when they are tightly sitting next to each other and you fire a spread salvo... yeah.


EDIT: Also I think you should post a tutorial on the buffer system that you designed. It's so simple, but has such a variety of uses.

I think I will, yeah. Thanks for suggesting.

Edit: I'll stop now derailing this tutorial off-topic.
2011-06-21 09:43:00

Author:
Antikris
Posts: 1340


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.