A post appeared on the Gateways forums recently with a video showing,… a bug, or a kind of a bug. Here it is:
It raises some interesting questions and took me back to handling the time travel stuff so I thought I’d write a blog post about it.
If you’ve played Gateways and got as far as the time travel guns then hopefully it’s obvious what’s going on here. If you’ve not then you probably don’t have a clue what’s going on so I should explain a bit how the time travel gateways work. The first gateway that’s placed (on the wall to the left) is the ‘return’ gateway. When the second gateways is placed (on the floor) it connects up to this first one at the time it was placed. Travelling through the second gateway takes you back in time. The first gateways is placed at 0:04 and the second one at 0:10 so travelling through takes you back in time by about 6 seconds.
The switch in this level has been wired up to close the door rather than open it. This means that before travelling back in time Ed can walk back and forth through the door. By travelling back in time and standing on the switch the door closes and it appears that Ed is walking back and forth through a closed door. You can see how it can happen but it looks like a bug. The question is, how would you fix something like that? The previous echo of Ed has already been recorded, should that be changed?
The initial time travel game I wrote back in 1999, TimeSlip, first made me think about this issue. In order to implement time travel you have to record the previous actions of the player so they can appear as past echoes when they travel back in time. My first instinct was to implement this by recording the player’s key presses and playing them back to make the past echoes recreate the previous actions. Here’s an example of what can happen when that’s the case:
There’s a single door here and the switch on the left will open it when stood on. In TimeSlip you travelled back in time automatically so there are no gateways to travel through.
The player walks into the door and hold down the right key. The door is in the way so stops the player moving.
The player walks back and stands on the switch which opens the door.
The timeslip happens and the player travels back to encounter his past self. He becomes the snail numbered 2 and the first echo is number 1. This echo walks to the door but is now able to walk through it putting him in a different place to what actually happened first time round.
The past echo (1) now walks back but only walks as far as he did the first time when he was blocked by the door. This means he doesn’t end on the switch. The current snail steps off the switch, making the door close.
We travel back in time again so past echo 1 reappears. The snail that used to be numbered 1 becomes 2 and the one that used to be 2 becomes 3. This time round the first past echo reverts back to what happened originally because the door is closed. It walks up to the door and is blocked by it.
Now the first past echo walks back and stands on the switch, exactly what happened the first time round. When we travel back in time again the switch will be pressed and the door will be open so the first echo will go through the door again, just like the second time round the loop. We end up in a weird state of alternating between two different versions of events on each timeslip.
While this initially seems quite fun the end result is something that’s incredibly confusing for the player, and time travel is confusing enough as it is! Past echoes end up jumping around randomly and eventually land on spikes or cause paradoxes between other past echoes. All this can happen off screen so the player often has no idea why they just lost the level. The whole system doesn’t work.
What actually happens in any game involving time travel I’ve made is that the actual positions of the player are recorded rather than the key presses. This ensures that they always take exactly the same action so the player can rely on their past echoes doing what they did the previous time.
It still leaves the problems like the one shown in the video, so how are we supposed to get round that? It basically boils down to the classic Grandfather paradox,where a time traveller goes back in time to kill their grandfather. If they kill their grandfather they will never be born and never travel back in time to kill their grandfather. If they don’t kill their grandfather then they will born so they’ll travel back in time and kill their grandfather. It’s a paradox.
One method that’s used in TV and movies to get round this paradox is the idea that travelling back in time takes the protagonist to an alternate version of reality. If they kill their grandfather in the alternate reality then that’s fine, they won’t go on to be born in this version of reality and they can change the past as they see fit. This sucks from a gameplay point of view though, you need your past echoes to perform the same actions as before and the past to remain the same.
Of course I used interacting with yourself in TimeSlip, Shuggy and Gateways as the cause of a paradox which generally meant you had to restart the level. I could have done the same thing for the type of situation shown in the video. I could have recorded the key presses and the positions. If, during the course of replaying the key presses the echo ended up in a different place to the recorded position that would cause a paradox. In Gateways that would mean the screen would go all wobbly and the time travel effect would end as soon as the player started to move through the door. I decided I didn’t like the idea of this method as it’s too easy to cause a paradox in this way and it can often happen off screen leaving the player wondering what went wrong.
The answer I decided to go with follows the Novikov self-consistency principle which states that a time traveller simply can’t make changes that would lead to a paradox. There would be no way for them to prevent their own time travel event. If they were trying to shoot their own grandfather then the gun would jam, if they tried to run them over they would have a car crash before reaching them. This is implemented in Gateways (or it should have been :/) by preventing the switch from working that would close the door. The door would remain open until Ed was finished dancing around underneath it; at which point it would mysteriously start working again.
Here’s a couple of examples of where it does actually work in the game:
Here the switch has been wired up to make the platform move. By standing on the platform before travelling back in time we have to make sure that the platform is in that position for Ed to stand on it. Hence the switch fails when it’s stood on after travelling back in time. As soon as the player’s past echo stands off the platform the switch becomes active and the platform moves again.
In this example a laser is being redirected to activate a switch that opens a door. We then try and prevent this from happening by deflecting the laser away. The mirror mysteriously fails to reflect the laser because that would prevent the door from opening. Note, at the times when the laser isn’t hitting the switch the mirror functions again and the laser can be redirected.
Implementing this stuff did prove rather tricky and I suspect I never implemented the case with the door because there weren’t any doors like that in the original game. I suspect most people that played the game didn’t even realise these cases could arise and were handled so in many ways I’m glad someone has raised this! With the release of the editor people will probably find more weird cases like this,… can you think of some?
Oh, and my next game won’t involve time travel. Too much of a headache!