Neon Atelier November Progress- Electrode gameplay
Entering the middle of the semester, we have encountered enormous amount of workload for other courses. As we juggling with other coursework and project, the development pace of Neon Atelier has been down-tuned so that we can maintain a sustainable output. From this month on, the implementation updates of our project will compiled on a monthly basis, without spreading the records too thin.
Since the last update, we have began on the implementing the electrode welding interaction for the neon tube, which involves setting up VR interactions and setting up 3D modeling.
The expectation of the electrode welding gameplay is that the player grabbing the electrode, then place it onto the tube, and then weld the end of the electrode and the main tube together. By sealing both ends of the tube with electrodes, the tube is then prepared for vacuuming and gas injection, which is a step key for the neon light to work properly.
In the beginning, we ideated that part of gameplay required literally challenging our player to hold the electrode steadily as an requirement for welding. However, with further consideration, we discovered that this feature spans into a long list of features, such as a. the instructions and feedbacks for the player hold the electrode steadily, b. the mechanism to judge the readiness of the angle, c. error handling and recovery in case the player mistreated the process, d. ensuring the sense of realism for the error handling, and potentially more. These implementation of such details could very well drag into at least a full month of work, which is disproportionate to our other feature, we decide to opt for simpler interaction.
The alterative to the above long chain of action, is to introduce snapping to the interaction. The player simply place the electrode into proximity to the tube's end, and the game automatically lock the final inches in place, making it ready for torching. The approach ideally eliminated the need for position tracking and error handling, while also simplify the gameplay for the player (assuming that precise locomotion is challenging for some).
Fortunate of us, Unity XR Toolkit's XRSocketInteractor precisely targets this use case. It detects the collision with other XRGrabInteractable (our electrodes object), and place the detected object into the socket position. Our implementation is to place XRSocketInteractor object at both end of the bended tube; their InteractionLayerMask are limited only to the electrode objects layer; the AttachTransform are specified to offset the electrodes object on snapping, which otherwise mistakenly use the object center; their HoverEntered of the socket is hooked to our TubeInteractionManager object to signal for gameplay progress when attached with electrode.
As the electrode snap onto the tube end, the torch collider on that end of the neon tube is then enabled. The player can then grab to Y-shape torch and seal this electrode in place. This feature is implemented by the reuse the collider logic of our previous TorchableSection script, by extending it with alternative NextStepType of WeldedStartElectrode or WeldedEndElectrode, which hooks to correpsonding logic in the TubeInteractionManager.
With the above implementation providing the barebone gameplay of the electrode welding, we moved onto implementing its visual details. Two kinds of electrode 3D models were built, one being a simple electrode and one being the injection electrode with an extra gas tube for vacuum and neon gas injection. These electrode model then had their UV unwrapped in align with the UV space axis. And then the the bended main tube model and the electrode models are duplicated and merge to together, as preparation for our later neon shader implementation.