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

Player Ownership & Score Board

Archive: 13 posts


I'm creating a basketball type game, with a digital number hologram-based scoreboard in the background to display the number of baskets each player has made.

I've built a hologram-based digital counter, and it works pretty well. What I can't figure out is how to set up my logic so that different things happen based on which of the players made the basket. If player 1 throws the ball, makes a basket, it needs to affect a different microchip/logic than if player 2 made the basket.

I'm trying to explain this as best I can and it still feels a little complicated. I hope I made this clear enough!

Any help is appreciated!!
2012-06-09 20:02:00

Author:
Unknown User


Makkura, you will need 2 grab sensors on the ball, each set for a different player (player color might work best here). The outputs of each sensor must be tied to a noninverting driver. The outputs of the drivers would be tied to different counters set to increment from 0 to 1 when the ball is grabbed by a player. The output of each counter would need to be tied to the reset of the other players counter and an AND Gate input for each player. The ball will also need a keyswitch set to the same color as a keyswitch tag you would need on the hoop. The output of the keyswitch would need to be tied to the other input of each AND Gate. A score would only happen when the player grabbed the ball, outputting a high from the counterto the AND Gate, and when the ball goes through the hoop, the keyswitch would output the other high needed to output a high from the AND Gate. You can tie the AND Gate outputs to whatever type of scoring system you have developed.

Hope that helped and was clear enough. If not clear, leave a post on my profile page and I'll draw it for you.
2012-06-10 06:26:00

Author:
RickRock_777
Posts: 1567


Makkura, you will need 2 grab sensors on the ball, each set for a different player (player color might work best here). The outputs of each sensor must be tied to a noninverting driver. The outputs of the drivers would be tied to different counters set to increment from 0 to 1 when the ball is grabbed by a player. The output of each counter would need to be tied to the reset of the other players counter and an AND Gate input for each player. The ball will also need a keyswitch set to the same color as a keyswitch tag you would need on the hoop. The output of the keyswitch would need to be tied to the other input of each AND Gate. A score would only happen when the player grabbed the ball, outputting a high from the counterto the AND Gate, and when the ball goes through the hoop, the keyswitch would output the other high needed to output a high from the AND Gate. You can tie the AND Gate outputs to whatever type of scoring system you have developed.

Hope that helped and was clear enough. If not clear, leave a post on my profile page and I'll draw it for you.

while you can get player info from grab sensors, there is no way to make it only activate when a certain player grabs it.
the best way would be to use player controlled bots with unique tags, but this brings with it a new set of problems.
i dont have the time to explain it with pics etc at the moment so here are a few links that may help
http://www.youtube.com/watch?v=X4zq0QOXzbw&hd=1 <--- remote sackbots
https://lbpcentral.lbp-hub.com/index.php?t=68949-scoring-with-sackbots
https://lbpcentral.lbp-hub.com/index.php?t=68357-How-to-tame-the-wildest-beast-of-LBP2-Logic-(aka-Signal-Object-ownership)
2012-06-10 07:40:00

Author:
evret
Posts: 612


Sorry Makurra, it was late when I wrote that last night. Just occurred to me you may not be able to place 2 grab sensors on the same piece of material. But you can place 2 keyswitch tags on the ball. Set them to different colors and have a matching keyswitch on either hoop at either end of the court. You won't need the AND Gate, so the logic is actually simpler. Tie the keyswitch outputs to their respective counter inputs, and tie the counter outputs to their respective player score logic circuits and to the reset of each counter.2012-06-10 14:33:00

Author:
RickRock_777
Posts: 1567


Sorry Makurra, it was late when I wrote that last night. Just occurred to me you may not be able to place 2 grab sensors on the same piece of material. But you can place 2 keyswitch tags on the ball. Set them to different colors and have a matching keyswitch on either hoop at either end of the court. You won't need the AND Gate, so the logic is actually simpler. Tie the keyswitch outputs to their respective counter inputs, and tie the counter outputs to their respective player score logic circuits and to the reset of each counter.
this doesn't differentiate between players, so the setup wouldn't know who threw the ball.
you have to use bots with unique tags to get the info needed for a custom scoreboard.
if you look at the original post he says
"If player 1 throws the ball, makes a basket, it needs to affect a different microchip/logic than if player 2 made the basket."
2012-06-10 17:09:00

Author:
evret
Posts: 612


You could try this (not tested):

One grab sensor [1] on the ball.
The output of the grab sensor [1] connects to the FIRST input of a 2 input OR gate [2] on the ball.
The output of the 2 input OR gate [2] connects to the FIRST input of a 2 input AND gate [3] on the ball.
A tag sensor [4] on the ball connects to the SECOND input of the 2 input AND gate [3].
A tag [5] on the hoop triggers the tag sensor [4].
The output of the 2 input AND gate [3] connects to a scoregiver [6] on the ball. *
The output of the 2 input AND gate [3] also connects to a NOT gate [7].
The output of the NOT gate [7] connects to the SECOND input of another 2 input AND gate [8].
The output of the 2 input OR gate [2] also connects to the FIRST input of the 2 input AND gate [8].
The output of the 2 input AND gate [8] connects to the SECOND input of the 2 input OR gate [2].

The order of inputs to OR gates and AND gates is significant when working with signal ownership.

* Or you could replace the scoregiver with logic to drive your own digital counters.
2012-06-11 08:41:00

Author:
TheBeardyMan
Posts: 26


as stated before player data cant be used for a custom scoreboard. BOTS WITH UNIQUE TAGS ARE NEEDED FOR THIS2012-06-11 08:56:00

Author:
evret
Posts: 612


A refinement of my suggestion: if you're using a custom scoreboard, that leaves the real score free for score encoding some of the state that needs to deal with player ownership. So use the ball and hoop logic that I suggested in my first post, and set the score awarded for getting the ball through the hoop to 100 points.

Then have 4 auto-enter controllinators to capture the players as they enter the level. On each controllinator:

The active output connects to the second input of a 2 input OR gate [1].
The output of the 2 input OR gate loops back to its first input.
The output of the 2 input OR gate also connects to a 1 shot score giver [2].
The output of the 2 input OR gate also connects to the first input of a 3 input AND gate [3].
The output of the 2 input OR gate is also a source of a player owned signal to zero the score that we've been using to encode player ownership and convert the state of the custom scoreboard into a real score at the end of the game.
A score sensor [4] connects to the second input of the 3 input AND gate [3].
An inverted output score sensor [5] connects to the third input of the 3 input AND gate [3].
The output of the 3 input AND gate [3] connects to a score giver [6] that deducts 100 points.
The output of the 3 input AND gate also connects to the logic for one player slot of the custom scoreboard; it will output one pulse whenever the player who occupied the controllinator scores a basket.

The 1 shot score giver [2], the score sensor [4], and the inverted output score sensor [5] are where the controllinators differ:

Controllinator 1: Score giver [2] awards 20 points, score sensor [4] detects 110 points, inverted output score sensor [5] detects 130 points.
Controllinator 2: Score giver [2] awards 40 points, score sensor [4] detects 130 points, inverted output score sensor [5] detects 150 points.
Controllinator 3: Score giver [2] awards 60 points, score sensor [4] detects 150 points, inverted output score sensor [5] detects 170 points.
Controllinator 4: Score giver [2] awards 80 points, score sensor [4] detects 170 points, inverted output score sensor [5] detects 190 points.

Use player sensors and the controllinator active outputs to detect when all players have entered controllinators, and permanently eject them when that happens.
2012-06-11 21:23:00

Author:
TheBeardyMan
Posts: 26


the problem with that method is player scores are still displayed in the top left corner and seeing the constant changes that dont stay relative to the custom scoreboard would be rather unsightly, using bots would still be better. i dont see why u seem so against the idea, with so little logic required for each there in no drawback (unless they have to go in water), logic would b more straight forward, in-game score could either go up/down relative to custom score or remain unchanged untill game is over.2012-06-12 08:41:00

Author:
evret
Posts: 612


My suggestion will work. Each player has a hoop. When the ball goes through a hoop, there will be a score associated with that hoop, regardless of who made the shot. Let the players pick which hoop they want, just like they do in real life. Why make it more complicated than it needs to be...there will be less issues to debug, and you will have more time to create or resolve other issues.

Evret...I'm not saying your method would not work. I'm saying the OP will have the choice of methods to implement.
2012-06-12 23:12:00

Author:
RickRock_777
Posts: 1567


My suggestion will work. Each player has a hoop. When the ball goes through a hoop, there will be a score associated with that hoop, regardless of who made the shot. Let the players pick which hoop they want, just like they do in real life. Why make it more complicated than it needs to be...there will be less issues to debug, and you will have more time to create or resolve other issues.

Evret...I'm not saying your method would not work. I'm saying the OP will have the choice of methods to implement.

however the OP specifically stated he wants per player scoring on his custom scoreboard, not per hoop
2012-06-13 08:57:00

Author:
evret
Posts: 612


The players can select the hoop they want, and is therefore "per player" scoring, which meets the OP's requirements.

Good luck with your level makkura. Sounds like a fun project.
2012-06-14 01:27:00

Author:
RickRock_777
Posts: 1567


The players can select the hoop they want, and is therefore "per player" scoring, which meets the OP's requirements.

Good luck with your level makkura. Sounds like a fun project.
so u propose he limit the number of players to the number of hoops?
2012-06-14 02:26:00

Author:
evret
Posts: 612


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.