The next major task on my quest to build the Particular Reality locomotion system is allowing movement to a target platform by going through a portal. Not sure about the visual details yet, but it's not important at this stage.
Before starting to play with render textures, stencil buffer etc, I decided to take care of some preliminary things that don't need any research.
As shown by the video of yesterday, the regularity of the hexagon grid made a bit hard to notice that one changes platform, unless you're in sight of the grid edge (or of the origin point, marked by the small red sphere). To address this issue, let's use three different shades grey, so that there are no two adjacent platforms of the same color. While we're at it, let's change the default Unity skybox to start getting out of the "Unity cube tutorial" look.
Yesterday I assigned button A to directly teleport to the "target" platform. Let's change that so that the button (which is also mapped by default to the right hand pinch gesture) opens a portal to the destination platform.
Walking into the portal will then actually move the player to the destination platform.
So, even if we don't have portal rendering yet, let's take care of the gameplay logic first. Splitting complex task in more manageable chunks is a staple of software development and system design.
As placeholder for the portal, I decided to spawn another, bigger hexagon, rotated to split a platform in half, covering three triangles. Following up on the "target selection" logic of yesterday, based on the projection of the head on the current platform (the blue sphere), I can then easily check when one "crosses the portal", entering one of the three triangles on the other side.. When that happens, I teleport to the target platform and close the portal.
I also added a quick and dirty procedural animation of the portal scale, to have it pop up quickly but not instantly.
For the locomotion I have in mind, portals are "one-way", allowing to easily move towards a direction repeating these actions:
open a portal standing on the "first half" of a platform
take a step forward, moving to the "second half" (teleporting to the destination)
take a step back, going back into the into the "first half" (but of the new platform)
Of course, it's also easy to change direction between teleports. There's no motion sickness, and the player stays always in the same physical hexagon of his room.
At some point, I might buy an hexagonal carpet and do a mixed reality video where the carpet is exactly mapped to the in-game platforms. And if I end up doing a Kickstarter for the game, a customized hexagonal mat would be a great perk.
I took a quick video capture of the result, and I was very happy about the feeling I got moving between platforms. With the actual portal rendering, and a better target selection (I will probably take into account gaze and hand position, and not only head position), I think it's going to be great.
In these first three days I've been doing a lot of "exploratory programming", putting stuff on the screen without thinking about code architecture and cleanliness. To complete the day, before delving into the portal rendering tomorrow, I did a bit of refactoring.
That's how I usually like to work: quickly try out things, get something working, and after that (or if I feel things are getting a bit too dirty/unmanageable), stop and clean up.