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

Save system for score and checkpoints (1 player only)

Archive: 25 posts


After seeing (and receiving) quite a few questions about this i thought i'd post a tutorial rather than reply to each.
fistly i need to point out this is for one player only, i havn't tested this in an MP environment however i'm sure scores wont be handed back to all players correctly. While you can sense player scores separately, there is no way to detect if they are the same players returning etc.

I'll start with saving the score only. score sensors send an analogue signal based on the percentage of the sensor limit the players score has reached. For example if the score sensor is set to 500, and the player score reaches 250, the sensor will output an analogue signal of 50%. Whats both interesting and useful in this situation is the fact sensors will also exceed the normal 100% cap of analogue signals in lbp. For example if the sensor is set to 500 and the player score is 1000 the sensor will output an analogue signal of 200%. Also at the extreme of this a score sensor set to 1 and the player score is 4,000,000 the sensor will output a signal of 400,000,000%. also if you feed that signal back into a score giver set to 1 it will give 4,000,000 points. (well it would try to, but the score cap would have already been reached, but you get the idea)
how is this useful?
It becomes useful on the score giver side of things, as a score giver set to "scale every second" requires a digital on signal to give scores.
While there are other ways to add a digital signal to an analogue signal without affecting the analogue signal, having both the sensor and giver set to 1 point is the most thermo friendly way to do it, and it will still allow us to save any score between 1 and 4,000,000.

The following setup is for score only, where a player leaves and returns to the same level with the same score.
The pic is pretty straight forward, i'll just fill in what you cant see.
The memorizer must have a label, player sensor is set to infinite, score sensor is set to 1 point, score giver is set to 1 point and "scale every second", both counters are set to 1.
it is also important to remember the AND gate is set to multiply, and that the signal used to trigger it should always carry a 100% analog signal with the digital.
When the memorizer is triggered it saves the current score, when the player enters the level the saved score is given back to the player.

http://i0.api.vita.lbp.me/img/ft/7e0ce994500944c81843017ce2c6b18d49969b3f.jpg

now thats all well and good, but what about player progress?
sackboy uses checkpoints to respawn, so this is a good place to also save score and progress, meaning when a player leaves the level (by either closing down the game or returning to pod), when they return to the level we can have them spawn from the last checkpoint they passed, with the same score they had when they passed it.

I've put together a rather basic system that does just that.
we start off with the same system as b4, but without the score sensor or anything wired to the trigger.
this can be placed anywhere as long as player sensor is set to infinite.

http://i5.api.vita.lbp.me/img/ft/80550718a4931de31c771fb27780a530fd18cb93.jpg

this next image shows the logic setup for the checkpoint, when the player reaches it, the memorizer is triggered storing both the score and a digital signal indicating that checkpoint was reached, the wire to the checkpoint is also activated (and will be if the player leaves and re-enters the level).
Note: all score givers and sensors are still set to a score of 1, AND gate is set to multiply, and all memorizers should have the same label.
The XOR prevents the player from returning after collecting bubbles further and saving the updated score.
It is also important to also wire the output that goes to the checkpoint to a method of blocking a player from going backwards, for example wire it to logic that closes a door just b4 the checkpoint etc. this prevents players from re-loading the level and re-collecting bubbles they have already collected.
The entry checkpoint can be left as normal, the next should have this. the chip can go on the checkpoint itself, i just often do logic on sticker panel squares so i just glued it on.
the player sensor should be set large enough so players cant get past without activating it.

http://ia.api.vita.lbp.me/img/ft/dcab12b5e8cb652c287c0fe16b0c047ef60eb28d.jpg

you can then copy/paste that checkpoint throughout your level, only thing you need to change with each new one is add a port to the memorizer, and move the checkpoint logic to that new port.
the following pics show what the next 2 should look like, you should see the pattern

http://i5.api.vita.lbp.me/img/ft/a657286560f4a296fee2335f2c72feee9dac2f55.jpg

http://i6.api.vita.lbp.me/img/ft/f9617348a4578f14f55cdcd8f4622ac91617e14f.jpg

Finally you will need to clear the memorizer when the player reaches the scoreboard, simply wiring a player sensor to the reset input of the memorizer will do the trick, this will prevent players replaying the final part of your level everytime they go to play it (unless they manually delete the memory)
have this just b4 your scoreboard. Player sensor should be set large enough that players cant get past without activating it.

http://ie.api.vita.lbp.me/img/ft/c9e277d7744d5c4394b697553a947fa686083d85.jpg

finally i'll show a way to continue a score between different levels in a series,
you can have a level select hub level to help with this, but i'm gonna focus on a more direct way.

ok, so the first level should contain the following chip just as the player reaches the scoreboard, all this one does is save the current score if it is higher that any score the player may have received in that level b4. and also preserves any score they may have achieved in any later levels (for people replaying earlier levels in the series after playing later ones).
again the player sensor should be set large enough so that players cant get past without activating it, and the score sensor is set to 1 point.
In the following pic all memorizer outputs are looped back to the same numbered input except the first (as it's the first level of an imaginary 8 level series), which first goes through an OR with the score sensor.
the wires are gonna get messy, so bare with me.

http://id.api.vita.lbp.me/img/ft/6bd937bf49867317ba520d85ee0f0d9ce2e8867d.jpg

the next level has the same chip near the end but the second port of the memorizer should loop through the OR instead of the first.
we also add the score giving logic we used for the "level progress" method, using the output from the level b4 the current level to give the score.
you should also wire the previous levels output to selector as shown, then use that output to block players from starting the level if it is inactive. for example if a player has not scored on the level b4 u could close any way forward and display a msg that tells players to first play previous levels in the series. (a level select hub level could easily be added using this system)

http://ib.api.vita.lbp.me/img/ft/b3bb057f2e75752538e213e4ba50d138d1544b7b.jpg

for every following level just move down the memoriser with both the port looped through the OR and the output used for the score giver and selector.

the following would be in level 6 of 8

http://i5.api.vita.lbp.me/img/ft/945a45ae5da4f89fbf96aa9f8c8e8d2d47369ac5.jpg


both the "level progress" and "series progress" setups will work together, you just have to make a change to make sure players dont receive a score from both when they enter a level.
just keep in mind every level should have it's own level progress memorizer label , but there should be only one series progress memorizer label for the whole series

the following pic shows the change you need to make to the "series progress" system. the memoriser at the top should have that levels "level progress" label, and will block the "series progress" system giving the player the previous levels score if the player has "level progress" already saved for that level. (remembering "level progress" is reset when the player finishes the level)

http://i7.api.vita.lbp.me/img/ft/8579489c6ad0fd88d7699af7a20479727c624e7e.jpg


i'm hoping i've explained this well enough, but i'll answer an question people may have and fix any mistakes i may have made.
2012-10-10 15:34:00

Author:
evret
Posts: 612


Thanks Evret this helps a ton! 2012-10-10 17:47:00

Author:
grey_jeep
Posts: 2


A super awesome and detailed tutorial for some of the most asked questions in LBPV from the master Evret, first creator of a great FPS system in LBPKarting, consecuentely (I'm pretty sure I just misspelled that word) a logic guru. That sounded really dramatical.2012-10-10 21:30:00

Author:
yugnar
Posts: 1478


This is absolutely amazing! Thank you so much. I feel like I actually understand the memorisor now! The player sensor can be set to infinite though without any change right? Is there a difference in the thermo (there shouldn't be since it should be easier to check)?2012-10-11 02:56:00

Author:
koltonaugust
Posts: 1382


This is absolutely amazing! Thank you so much. I feel like I actually understand the memorisor now! The player sensor can be set to infinite though without any change right? Is there a difference in the thermo (there shouldn't be since it should be easier to check)?

i've been on borderlands 2 since lbpv came out so I havnt spent much time with the other tools so i wasn't aware the player sensor could be set to infinite. I touched the number and the highest it would let me make it was 5000, I didn't realize the slider that appears when you touch the icon to the right of the number lets you set it to infinite. so thanx and i'll update the main post as while set to infinite the game shouldnt be trying to determine an analogue value for closeness.
2012-10-11 06:23:00

Author:
evret
Posts: 612


Great tutorial! Thanks, evret!2012-10-11 11:12:00

Author:
Domik12
Posts: 838


This isn't working for me at all... and I don't get why. You said yourself that if the score sensor is set to say 100 & you get 200 points it will output 200%. Well I tried this.. The score sensor is set to 1 and you add 10 points which makes the score sensor output 10,000,000. It also gets saved in the memorizer as 10,000,000 and if you activate the score giver (not scaled by second) it gives 10,000,000 (4,000,000) and if you activate a "scaled every second" score giver it gives 1 point per second! 422664226742268

I had 2 other test level with the same exact setup you have. (player sensor into a 1-shot into a resetting 1-shot AND memorized score but it still didn't work properly.

I tried another method of having the score sensor with a target of 1,000,000 that does output the proper amount into the note and even through the memorizer but doesn't recognize as "on" to transfer the score with the button & the AND gate..

I should also probably mention that my series has a main HUB, instead of the sequential score transferring system you have shown. I assume this would only need 1 named memorizer with only 1 port righ? Provided that the saved score is given at the beginning of every one of the levels & saved at the end (or any time it changes) of all the levels too. My series is based on this.. so I can't really progress with it until I can get the memorizer to keep a steady score throughout all the levels.
2012-10-11 21:36:00

Author:
Dortr
Posts: 548


This isn't working for me at all... and I don't get why. You said yourself that if the score sensor is set to say 100 & you get 200 points it will output 200%. Well I tried this.. The score sensor is set to 1 and you add 10 points which makes the score sensor output 10,000,000. It also gets saved in the memorizer as 10,000,000 and if you activate the score giver (not scaled by second) it gives 10,000,000 (4,000,000) and if you activate a "scaled every second" score giver it gives 1 point per second! 422664226742268

I had 2 other test level with the same exact setup you have. (player sensor into a 1-shot into a resetting 1-shot AND memorized score but it still didn't work properly.

I tried another method of having the score sensor with a target of 1,000,000 that does output the proper amount into the note and even through the memorizer but doesn't recognize as "on" to transfer the score with the button & the AND gate..

I should also probably mention that my series has a main HUB, instead of the sequential score transferring system you have shown. I assume this would only need 1 named memorizer with only 1 port righ? Provided that the saved score is given at the beginning of every one of the levels & saved at the end (or any time it changes) of all the levels too. My series is based on this.. so I can't really progress with it until I can get the memorizer to keep a steady score throughout all the levels.

the easiest way to do it is to set both the score sensor and score giver to 1. It does everything correctly. Make sure your score giver is set to scaled per second and your AND switch is set to multiply not take the lowest number. For your levels though I thought that score automatically transfers via level link? I would just make the other levels sub-levels of the first one unless they are really long. If you do keep it just make sure you subtract the score in the level before you add what you had in the previous.

I don't think you say that in the tutorial though Evret, that if you want to allow signals >100% you have to have the AND switch to multiply.
2012-10-12 03:52:00

Author:
koltonaugust
Posts: 1382


the easiest way to do it is to set both the score sensor and score giver to 1. It does everything correctly. Make sure your score giver is set to scaled per second and your AND switch is set to multiply not take the lowest number. For your levels though I thought that score automatically transfers via level link? I would just make the other levels sub-levels of the first one unless they are really long. If you do keep it just make sure you subtract the score in the level before you add what you had in the previous.

I don't think you say that in the tutorial though Evret, that if you want to allow signals >100% you have to have the AND switch to multiply.

good catch, i changed some 3 port XORs to multiplying AND gates in the tutorial and forgot to mention they are different. only thing you need to make sure is that the other input should always carry a 100% signal with the digital ON. i'll fix the main post.

@Dortr - are you planning on using the in-game score to store/display and do the math for currency?
if you plan on using a note to display imo you'd be better off dumping the in-game score portion (senors/givers etc) of it and going with analogue loops. that way you wont have the score on screen as well.
2012-10-12 04:34:00

Author:
evret
Posts: 612


Yes, but not have a note for display. I figured score would be the easiest way to have a currency & to minimize the HUD I'd like to have it as the score since it is already displayed. This also can let me know how much people are replaying the levels. The highest scores would be those who have played the most and the only time you lose score(money) is when you die or purchase items. I'l be sure to save the score after those events occur.

I tested it now and it works perfectly. Thanks again!

Also wanted to note for anyone who does want to display score with a note to not use that same 1 point score sensor to display it but use a 1,000,000 target score sensor. It's bizarre to me that the 1,000,000 point score sensor obviously calculates the current score value but doesn't activate as 'on' to do anything with that signal..
2012-10-12 20:13:00

Author:
Dortr
Posts: 548


Awesome, Great tutorial! But im wondering if i can do the same with a sackbot. I would like the level to remember the sackbots position because the sackbot has abilities the player does not. I would be very grateful if you would answer my question. THANKS AGAIN!2012-11-05 20:01:00

Author:
Unknown User


Awesome, Great tutorial! But im wondering if i can do the same with a sackbot. I would like the level to remember the sackbots position because the sackbot has abilities the player does not. I would be very grateful if you would answer my question. THANKS AGAIN!

I don't see why not. Just tweak it so that instead of just activating a checkpoint make it go into an "and" gate that when no sackbot is on the stage and the checkpoint is on, emit it.
2012-11-05 23:01:00

Author:
koltonaugust
Posts: 1382


This is AWESOME!!! Hey, how would I use this for a 2 player game?2013-01-12 00:09:00

Author:
Bitter Sweet
Posts: 95


as comphermc has pointed out in his video tutorial thread, you dont need to wire ports back into their own inputs to retain their stored signals when saving another input, so all the ports i have wire directly into themselves above can just be left blank (no inputs or outputs)2013-02-23 22:09:00

Author:
evret
Posts: 612


I'm confused. I thought I understood this earlier but now it doesn't seem to be working for me. I have a signal of .1% that I'm using to represent a value of 1,000 little BIG bucks in my blackjack game. It's displayed on a stickey set to output at 1,000,000.

When I try to tell the score giver to give points, it doesn't work. Is this becuase it's a very tiny number?
2013-02-28 23:33:00

Author:
Bitter Sweet
Posts: 95


the score giver set to 1 is only for giving back the score to player when they load the level again, you can use score givers as normal during the level.2013-03-02 00:27:00

Author:
evret
Posts: 612


So can you have a memorizer start with a starting value? When I activate it in create mode and send a signal through while triggering it, then later go to play mode it resets to zero. Not sure if it'm my setup or the memorizer's default function.
?
2013-03-02 02:35:00

Author:
Bitter Sweet
Posts: 95


So can you have a memorizer start with a starting value? When I activate it in create mode and send a signal through while triggering it, then later go to play mode it resets to zero. Not sure if it'm my setup or the memorizer's default function.
?

Memorizer values are reset when you rewind in create mode. If you do not rewind, the values you "pre-set" in the editor will carry over into play mode.
2013-03-02 14:18:00

Author:
comphermc
Posts: 5338


So I have a blank level with a battery set to 100% going into the memorizer input and then out to a sticky note.

I then have a pulsed counter set to trigger the memorizer. In create mode I pull the trigger and the sticky note then displays 100%.

Without pausing, rewinding, or anything else I open my menu and go to play mode with saving changes. And when I get there my sticky note is displaying 0. Why is this happening all you gurus out there?
2013-03-02 23:16:00

Author:
Bitter Sweet
Posts: 95


Why is this happening all you gurus out there?

Well, I guess that's because that is how it was set up to work. Apparently, values saved in create mode don't carry over to play mode. Triggering memorizers in create mode is messy business anyways, since it creates a rewind point. I generally make temporary buttons to set values in play mode.
2013-03-03 01:52:00

Author:
comphermc
Posts: 5338


hello, im trying to implementing this into my level, ( the score saving system ) but im a bit confused, what exactly is the memorizer being triggered by?2013-03-03 03:07:00

Author:
Unknown User


depends when you want the score to be saved, and which part of the system you are using. if you are using the the checkpoint and score save system- the memorizer and checkpoint is triggered by a player sensor when the player first reaches each checkpoint.

however if you are just using the score saving part at the very top of the tutorial then you can wire anything to it, for example you could have a touch "save" button, or a "return to pod" button that triggers the memorizer then triggers a level ender.
2013-03-03 04:29:00

Author:
evret
Posts: 612


awesome! haha that was pretty easy problem, but thanks for the help, i got it to work2013-03-05 05:38:00

Author:
Unknown User


I've been making a skateboarding level called "Ultimate Skater" that uses points that you earn throughout the level and it uses the memorizer. I was trying to make the level add up points each time you earned them even though you may be in a different level each time. I haven't tested it out yet but I'm worried that my system is going to majorly fail. Please let me know if you guys have any suggestion on what to do.2013-06-04 01:29:00

Author:
vinniegnsb
Posts: 22


yay, thanks for the tutorial! I'm certainly going to try this out ASAP. by the way, can you keep your score trough multiple levels with this logic? I'm working on a shooter where you have to buy stuff in a few different levels, and you will need the money you earned in previous stages.
I won't need it right at this moment, but I would like to know if my plans have a chance to become reality before starting to build them...
Thanks already!
2013-06-07 00:52:00

Author:
wolfbrother117
Posts: 150


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.