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

A Way to Remember the Order in Which "Things" are Activated?

Archive: 10 posts


Hey,

Thought I might have another go at creating a level, and need a bit of advice.

So lets say you're creating a block puzzler (I'm not, but it's a good example). You have 2 boxes to move - A and B. You move:

- Box A left
- Box A up
- Box B down
- Box A right

Is there a way for LBP to remember the order of the moves, and following on from that, redo the moves if you made a mistake?
2014-01-07 09:30:00

Author:
Ali_Star
Posts: 4085


Taking the block puzzle example, you could store each move using 3 counters set to count to 1. The first counter can either be on or off, mapping to block A or B. The next two counters can be on or off in 4 possible combinations, mapping to the four cardinal directions.

If you pop the 3 counters in a microchip you basically have a little memory block. By hooking a load of these up to a selector you can create a history of moves, i.e. for each move you write to the microchip and increment the selector by 1.

If you were, say, remaking your checkers level, you could store each move as a pair of coordinates using 12 counters. It works out nicely, since 26 =64. Deriving the rules of the game in reverse might be kinda complicated, though.
2014-01-07 12:08:00

Author:
Ayneh
Posts: 2454


I'm thinking another way could be - rather than remember where a block has moved, remember where it has moved from (is that what you were suggesting with the checkers thing?).

I'm also thinking that there could be a limit on the number of moves you can redo, might make the logic a bit easier? Of course I would also include a puzzle reset button, which is easy enough to do.
2014-01-07 12:49:00

Author:
Ali_Star
Posts: 4085


I'm thinking another way could be - rather than remember where a block has moved, remember where it has moved from (is that what you were suggesting with the checkers thing?).
You got it.


I'm also thinking that there could be a limit on the number of moves you can redo, might make the logic a bit easier? Of course I would also include a puzzle reset button, which is easy enough to do.
Selectors can have 100 ports max, so that might be a natural place to stop. It would be an ungodly amount of wiring, though.

If you combine the natural looping behaviour of a selector with the reset port of a counter you can overwrite old data with new automatically, by resetting everything in a memory block just before writing to it. That means the last 100 moves are always there for the player to undo, even in a 10,000 move game.

To be more clear the circuit I'm writing about is much the same as the one on the left:

http://i.imgur.com/TE9nzmh.jpg
2014-01-07 14:48:00

Author:
Ayneh
Posts: 2454


Thanks.

So would this allow for the fact that (using the block puzzle example) a grid square can be landed on more than once in a sequence of moves?
2014-01-07 15:17:00

Author:
Ali_Star
Posts: 4085


Yeah, if you moved a block back and forth between two grid squares for instance I can't think how it'd cause a problem.

If you needed a bulletproof way to recover turns with complex interactions between blocks (like they push each other, or they blow up) you could just dump the entire game state to counters every turn. Counters are dirt cheap on thermo, so you could probably afford to do that if you had to.
2014-01-07 16:47:00

Author:
Ayneh
Posts: 2454


I hope this doesn't get too complicated. I have a habit of biting off more than I can chew, logic-wise. Did the same with my last level. I made it through in the end, did pretty much everything I initially set out to do, and more! But it took me over a year to complete! 2014-01-08 15:56:00

Author:
Ali_Star
Posts: 4085


To be more clear the circuit I'm writing about is much the same as the one on the left:

http://i.imgur.com/TE9nzmh.jpg
This is impressive, but I don"t really understand how it works. As you seem to know it well, could you provide us a link or a short tutorial for a 2 or 3 steps of do/undo with selectors?
Don't be afraid to explain as if I were a 12 years old, english is not my native language.
2014-01-11 15:50:00

Author:
Djibees
Posts: 189


I don"t really understand how it works.
Here's a mechanical version of the circuit, made from cardboard:

http://i.imgur.com/gVrPjvv.jpg

As the cardboard passes the impact sensors they read the data, encoded as holes, off the card:

http://i.imgur.com/3SnOTbC.jpg

You can read forwards or backwards along the card by moving it appropriately. If a set of holes were punched for every player action, that action could be undone by rewinding the card.

The electronic version operates in much the same way, only it uses counters instead of holes. The selector traverses each set of counters for reading/writing by incrementing or decrementing its cycle port, replacing the mechanical forwards/backwards motion of the card.
2014-01-12 00:17:00

Author:
Ayneh
Posts: 2454


For timing you can use percentage of division and restoration

All you do is divide down a signal at a constant rate, and to undo signals you just reverse the division amount with multiplication (1/2 division rate, 2x multiplication rate) and to undo just re-cycle backwards when input re-reaches 100%

So it doesnt require a timer, and can be sped up if needed to, and it keeps track of timing well

This also simplifies the process of undo, and redo
2014-01-12 02:49:00

Author:
amiel445566
Posts: 664


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.