After completing about four or five of Unity’s project-based tutorials in 2016, I wanted to try making my own very simple 3rd-person branching narrative game. I had a couple of goals for this project:
- Learn to use Probuilder (which at the time was still a paid addon and not part of Unity)
- Create a simple UI
- Integrate Yarnspinner and learn to use it for the basic Twine-style branching narrative of the game.
That was it, that was the MVP. I did my best to scope down but even then it turned out that that was a lot to bite off for my first tutorial-free solo flight.
Probuilder and progrids turned out to be super easy to figure out, especially if you have any prior familiarity with 3d modeling applications. Learning a new one is like cooking in someone else’s kitchen: you don’t need to learn how to cook all over again, you just need to figure out which drawer the spatulas are in.
Next I needed some NPC’s. I started calling the game Pillbox because I wasn’t going to attempt any kind of polished 3d assets, just the Unity capsule primitive. I gave each of them different colors and stuck some simple animations on each of them so they’d each feel like they had a different personality.
Then I needed the player. Another capsule, with a player movement function.
So – at the time I’d gotten really into Unity’s animation features, how you can animate literally any parameter of a gameobject, and decided that the player capsule should have a walk animation, and the walk animation should have particles, because I think I saw a Mark Brown GMTK video about game feel and decided that I should just have all kinds of it.
The dust cloud particles were configured to only activate while the player capsule was at the lowest point of the bounce animation. So it wasn’t just spraying dust clouds constantly, only when the pill hit the ground. I was really, really proud of this. (I still am.)
Next step was UI. I needed to signal to the player that the NPC’s could be interacted with, and also give the player a way to interact with them. To do this I created collision zones for each of them that would trigger a dialogue balloon the appear over each of them. I also looked up a chase camera tutorial that Brackeys did because needs more game feel.
Please take a moment to appreciate that not only does the dialogue balloon icon have a fun bounce animation to draw your attention but also? Also? The icon, is, itself, animated.
At the time I was working from the unity 5 animation cookbook and I think I was determined to apply every possible animation recipe in the book. I do not regret the effort spent. Animate everything, it rules.
Next step was adding the dialogue UI. This took wrestling with the UI canvas to make dialogue windows that pop up and could be interacted with, and would then close when dismissed.
This function was pretty straightforward, building it out so that each of the characters had distinct greetings and had character portrait icons took a bit more work. Please note: the NPC icons also wiggle. As does the ‘dismiss’ X in the bottom right corner.
At this point I was ready to add Yarn. And it turned out: adding Yarn was well beyond my ability as a programmer at the time. I think it would have made more sense to start with one of the Yarn sample projects and modifying it by adding my work to it, rather than trying to add it to my work. And the documentation at the time assumed a level of familiarity with c# that I did not have, so this is where I flamed out. Still, I learned a lot up to that point. Yarnspinner’s come quite a ways, I’m curious to discover if it plays nice with VRChat. Interactable NPCs in a VRC world that have branching dialogue and pull variables from world state would be interesting to see.