Development Info:
Date: May 30, 2020
Timeframe: 1 month
Position: Designer, Programmer
Platform: PC
Tools: Source 2, Illustrator, Lua
Team size: Solo
______________________________________
Description:
Worked with custom tools and hacks before Valve released Source 2 support for Half-Life: Alyx. Created custom level, sequences, puzzles and scripts. Ported Half-Life 2 Weapons and Sounds to Source 2. Contributed to the modding community by coding the first -novr jump feature. The map has since received updates to support VR and more quality of life changes.
Approach:
When Alyx released I knew that there would eventually be level design tools available, but like many others I didn't want to wait. I began looking around in the source files and trying to brute force solutions. Eventually the community was able to find a hack that was able to load some of Alyx's files into Source 2. I wrote my own custom scripts, and batch files in order to speed up my workflow as I figured out what was possible to build in Source 2.
The initial map design went through a few iterations during the development. Eventually when I realized the sheer size of the map was going to put a hamper on build times, I decided to pivot in a different direction while still keeping the same story beats and pacing in the original design.
Problem Solving and Scripting:
Like much of game dev, there were a lot of problems that came up. One that I prioritized over the level design was getting a normalized jump in -novr mode. As Alyx was built for VR, the dev controls didn't have a normal FPS jump built into -novr. In fact it didn't have a jump as that would make most players nauseous in VR. So the work around was to script a custom command using Vscript and Lua that would apply a force to the player in the upwards direction. Thereby simulating a jump. 
The problem was that only values above a certain threshold could be used, or the game would set the velocity to zero. That threshold value was roughly double what a normal jump would be, so instead of jumping like in any other FPS, the player would fly up really high. The work around I found was to use Vscripts Think function to get around the jump check. By thinking (waiting) for .02 seconds and then calling SetVelocity() and passing in a new velocity, the game lets you leave the ground in that .02 seconds and then you are free to normalize your jump value.
Conclusion:
Overall, I learned a lot about Source 2 and Lua during this project. It was really satisfying detailing the levels and getting the scripted events to work just right with all the particles, sound effects, and animations.
You can download and play the mod on the Half-Life: Alyx Workshop!
Back to Top