Jiggmin's Village

Full Version: Making PR2 Turing complete
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
With the introduction of Teleport Blocks, the potential for PR2 to incorporate complex designs has increased astronomically. One of the first things that came to mind for me was the possibility of making Turing-complete programs in PR2 (explanation of Turing completeness here: https://www.youtube.com/watch?v=RPQD7-AOjMI).

The requirements for Turing completeness are as follows:
  • Arbitrary memory that allows for reading and writing of data
  • Conditional branching
Right out the gate, PR2 allows for almost arbitrary memory, due to how large the level editor and block limit are. However, reading and writing data are a lot clumsier. First of all, Push Blocks are the only block that can be used to control the state of the game. Other destructible blocks can be used to measure state, but once destroyed, their original state cannot be recovered. Therefore, the positions of Push Blocks must be moved back and forth to simulate bits (zeroes and ones.)

The trickiest thing about this problem is that it's very hard to read state without modifying it. In layman's terms, most of the time a level makes you branch into different paths based on a Push Block, you push the block in the process. This makes it impossible to repeatedly read the state of the Push Block, as simply reading it changes the state.

Here's an image of a module I've been working on:


[Image: 2233e4a5989fea139e4615df9e06a7c9.png]

Usage Instructions:

Touch BLUE to write to the bit (it will alternate between its two states.) Touch PURPLE to read the bit. Depending on which state the bit is in, you will be returned to the control room (bottom) through either GREEN or RED.

Explanation:

Touching BLUE brings you to the upper left room. If the PB here is in the left position, the player will hit it, then hit the leftmost up arrow, hit ORANGE, and go to the top right room. Here, the player will be forced to move the PB to the up position before hitting BROWN and returning to the control room.

If when the player hits BLUE, the PB is in the right position, the player will hit the rightmost up arrow, hit YELLOW, teleport to the right of PB and push it to the left, then hit PINK. They will then ride along the arrows in the top right room and be forced to push the PB down before hitting GRAY and returning to the control room.

When the player hits PURPLE, they teleport to the top right room and ride along the arrows. If the PB is in the up position, they fall and hit RED. If the PB is in the down position, they go sideways and hit GREEN.

Next steps from here:

While this system seems relatively robust, it's not flawless. For instance, when the player teleports to ORANGE in top right, they're meant to hit the PB and set it to the up position. However, it's possible for the player to hold down and avoid hitting it, returning to the control room without flipping the bit as intended. Similarly, when the player teleports to PINK in top right, they can move right fast enough avoid setting the PB to the down position. (Reusable stat blocks would be amazing here - you could set a player's stats to 0/0/0 and basically force them to play the level like a Don't Move until an operation finishes, at which point you restore their stats to normal.)

Second, this is a LOT of overhead for managing just a single bit. Complex state machines will require a ridiculous amount of overhead to function.

Finally, this example has not been expanded upon with logic gates. I think logical completeness is probably possible, since it would be easy to construct a NOR gate (if the bit is TRUE for either of the gates, send them somewhere causing the branch to diverge) and NOR is logically complete, but the idea of making anything complicated with this seems like an absolute nightmare (I can't see myself making a level based on this stuff without some kind of macro.)

Anyway, I think it might be interesting to have some discussions about what we can do with PR2 now that we have Turing completeness. I've experimented with different rules (see the "follow the leader" game Horse) but the possibilities that are opened up by Turing completeness are far greater. People have built complex machines in the past (Suuper made a calculator once) but the requirement for the player not to move meant these levels weren't viable for anything resembling an actual game, since it relied on the honor system.

What are your thoughts?
sir, this is a block game



but an interesting read
(9th June 2021, 11:53 PM)Tro Wrote: [ -> ]sir, this is a block game



but an interesting read

haha redstone go brrr
This is very cool
I shall try to make a NOR gate
I have a NOR gate however you have to do it as a don't move
[attachment=919]

EDIT: I actually put a block under the output #99FF00 tele
EDIT 2: Ok PR2 is weird and asymmetrical, I've removed the 3rd water block on the top-left passage of the NOR gate to get it working
you can see the level at ID 6507304
Alternate solution to prevent player from breaking the system - use Eggs to stun the player. This will work best if Eggs get a custom option which allows the level maker to choose which weapons they're allowed to use. @bls1999 this could be a very useful feature!

https://gyazo.com/1bb017f53e54cfa7a11d12654f7fbc92
(10th June 2021, 1:48 PM)Kwing Wrote: [ -> ]Alternate solution to prevent player from breaking the system - use Eggs to stun the player. This will work best if Eggs get a custom option which allows the level maker to choose which weapons they're allowed to use. @bls1999 this could be a very useful feature!

https://gyazo.com/1bb017f53e54cfa7a11d12654f7fbc92

Yeah I was thinking of doing this
I set the items to only sword but the eggs could still use the guns so had to give up on that

limiting egg items would be very useful indeed

also locking their direction too
so you can guarantee the egg will see you fast rather than waiting for it to do the turning around
(9th June 2021, 11:53 PM)Tro Wrote: [ -> ]sir, this is a block game



but an interesting read

when is the astronomer teleport puzzle map going to be released?
...We serve races here, sir.

cool stuff tho
Welcome to the club.

we've kinda got it easy on this though, since we have lua and yall have to make the memory and stuff with blocks
seems like an interesting idea to me.