This VR survival game started as a challenge to myself to see how far I could get in developing for VR in Unity using the SteamVR framework as a base. I began with following basic tutorials to get the player gameobject and basic VR interactions like picking things up and using a laser pointer for menus setup. From then on I started using it as a testing ground for different small game features that would come to mind. As I continued to work on it though, the project began to take shape and direction, and is now being built with the goal of it becoming a Skyrim meets Valheim style game in VR.
One of the key features I was able to get implemented and play around with was structure building, as seen in the videos above. I began by creating a set of simple wooden building pieces using Blender, and built a system for learning new crafting recipes for structure and item building as the player picks up new items. The recipe discovery system uses a global class that contains all of different recipes the player can discover on it, and the player gameobject tracks a list of all the materials the player has discovered. Each time a new item is added to the player’s list, a check is run to see if the player has discovered all the necessary components to unlock a new recipe in their building/crafting menus. I built this with the goal of easy scalability in mind, structuring it such that new items and recipes could be added with minimal coding, mainly as new art assets were made. As such, the system was built using Unity’s Scriptable Object system in mind, where new recipe objects are created and hooked up to the recipe atlas and sorted based on what their primary ingredient is (i.e. wood or stone).
Once recipe and item discovery was done, I began setting up the structure pieces to be used for actual building. This involved adding in snap points to the different gameobject prefabs, setting up how the pieces would fit together based on what they were (i.e. walls, doors, foundations, etc.), and setting up how the structure placement markers interacted with the player pointer and world objects. There is definitely some refinement that can be added to the system, particularly in how pieces snap together, but the end result was a basic crafting and building system for me to expand upon as development continues.
There is still much to do and much that I want to add in; I’ve been working on it on/off when time permits, but I hope one day I’ll be able to flesh it out with even more interactive systems added in and optimizations for what’s currently there.