I’ve finally made a game in Unity. A very basic game. As basic a game as I could make. It is a game in the sense that you can win or you can lose. However, it is NOT a game in the sense that you have any control over how you win or lose.
You’re a baby ape. It is 10 million years ago. You’ve been born into a strange primitive world and you depend on your parents for survival. There are dangers all around that threaten your family. Will you survive?
It’s a text game. A lot of text games have a “Choose Your Own Adventure” feel, and through a tutorial I learned how to make those. They are fun and I look forward to making some very cool ones with some basic graphics and a synthy soundtrack. But for this game I wanted to see how a text game would fit in with the survival genre. This is both genres combined and stripped down to the barest bones. Each time you press enter, a day passes. Every day you find out whether or not you or your family have enough to eat and are safe. This is based on chance.
—— This part is for the geekier inclined —-
The way I’ve coded the game (and yes, this is my first ever game with code, so I’m more than a little proud) is so that when you press enter a random number between 0 and 1 is picked. The closer that number is to 1, the safer you and your family is. The closer that number is to 0, the more danger. To achieve this, I used an if statement, and an enumerator with values that represents each of the states.
The enumerator values kept growing. At first, I planned on ten values for my one enum variable to switch between. Once the variable switches to an enum value, a method would be called that changes the UI text to represent that current state the family is in and deduct or increase their health when appropriate. I ended up with 13 values since I needed: a safe and well-fed value, a safe and unfed value, an unsafe and fed value, an unsafe and unfed value. Then if the father dies protecting the family I needed four similar values that represent mother and child… and then if the mother dies (as she is likely to for being more vulnerable) two more values representing the dependent infant attempt to survive by itself… Then, when your character dies, there’s a death value that tells you that the game is over… if you character survives the 100 days, there’s a win value that lets you know that you’ve won… and finally there’s a start value which sets all the stats and introduces you to the game. Thirteen values connected to thirteen methods that wait for you to press enter to trigger a random float that decides the value your enum variable will switch to therefore progressing the game. I made this game in about a week, but of course it took me more than a month to understand this stuff, so in a sense, this was about 4-6 weeks in the making even if I didn’t really know what I was learning for.
—— End Geeky Section ——
For me, finishing this game comes with relief. If I can make this, I can make something more complex next time. It is less a game than an essential foothold a tiny way up the mountain of Unity competency. I’ve staked this territory as my own, and built a primitive home, ready for the next ascent. I’m also relieved to have found a way to put my games online. I have the Unity Cloud to thank for that. All you need to do is upload your files to an FTP server or a GitHub repository (I chose the latter) and link the Unity Cloud so they can: access the files, build the game as a WebGL and create a webpage with its own link for others to play. The most impressive additional feature I’ve found is that the Unity Cloud will periodically check the repository for updates and build a new version of the game based on any uploaded changes. This is autonomous. So, once you set up the game on the Unity Cloud (and maybe check up on it once in a while) all you have to do is push new changes to your GitHub repository and the cloud will do the rest. This is all free. It’s astonishing what technology is free these days. Sure, if you make over 100k making games using Unity they start to charge you, but if I ever get to that point I will be happy to give back.
I have found that the link to this game can break. Or more that the game becomes unplayable through the link provided after a given duration. I will sporadically check up on it and replace the link when necessary.
Please lower your expectations, and I hope you at least find this (proto) game a curiosity since the grim subject matter definitely falls short of being fun. You will need a desktop to play it (no smart phones for this one).
Here’s the link: https://developer.cloud.unity3d.com/share/ZkFi5kNNYf/
Oh, one last thing. You need to click on the game window once it’s loaded to activate it. Otherwise it won’t respond when you press enter. It’s a little annoying but not sure yet how to change that.
More later…