Here's a short trailer I put together with the latest build. Also I made a short video on my YouTube channel explaining a bit about the game.
It’s been a month since the last development blog, so this is going to be a big update. As you can see in the footages here, the game now looks very different now. I’ll focus on the top 3 changes in this blog update.
In the last update, I was still using primitive cubes as walls and did not have actual assets in the game. I guess I was sort of putting off 3d modelling these environmental assets, since I don’t have a lot of experience with 3d modelling. Well, actually I had to do a bit of 3d modelling for some school courses a few years ago, but I really hated those courses and never really picked it up again. But that’s a story for another day…
Once I got started on them, I actually had a lot of fun making these models. I went with a low poly aesthetic for these without texturing them, in part because due to my skills, but also because it fits the approach to the style of this game. The gameplay is all about extracting the essence of stealth gameplay and making it work on touchscreen and mouse. It’s getting down to the simplification, kind of like designing an icon or a logo. So it felt natural that 3d models should also be the simplest forms that they can be as long as they are sending the right message.
Lighting is perhaps the most crucial change since the last update to this game. I experimented with different types and levels of lighting, ultimately settling with this type of soft, dark, and coloured directional lights.
Since my previous game development experiences have mostly been 2D games, I haven’t had the chance to play with the lighting system in Unity. I took some time to figure out baked lights and ambient occlusion, but I finally got it to look the way I want. All of the static, non-moving objects in the game now have soft and realistic shadows on the surfaces of objects and on the floor. Even though my 3d models are basic and low poly, the environment as a whole has character thanks to this lighting. And since most of the lights are baked, it doesn’t affect the performance much. Even my old iPad Mini 2 can run this game at 30fps without dropped frames.
Also I made a choice to use hard shadows for moving characters, even though static objects have soft shadows. This was in part for performance reasons - iPad Mini 2 is pretty old now - but it is also to make the moving characters stand out. Hard shadows have an effect of making the shadows pop, so the object as a whole is easier to see. While visibility of moving characters is not a big issue on bigger screens, it is more important on phone screens where everything is much smaller. On tiny 5 inch screens, important things need to pop out as much as possible.
VISION CONE VISUALIZATION
Here’s the last important part of the update. The vision cone visualization, as well as the method of detect the player has completely changed. Originally I thought ray casting to the player every frame would be too resource intensive, so I had a cone shaped collider in front of the enemy instead. When the player would collide into the enemy’s cone collider, the enemy would shoot a ray out to check that the player is visible to the enemy and not behind a wall. This approach was functional for the most part, although some times the ray would slightly miss the player for some reason. Is Unity’s ray casting system somewhat inaccurate? Or maybe I wasn’t updating the ray’s position as often as I should’ve.
Anyway, I had a problem with using a spotlight as a visualization for the vision cone, so I decided to completely change the visualization as well as the method of detection. Instead of using a collider, now the enemies are using multiple rays every frame to check if it can see the player. And the rays are visible to the players as well, thanks to the dot visuazliation I am using now. I was partly inspired by Lidar visualization I saw for Google self-driving car videos. The dots are much more clear indicators for vision cone visualization than the spotlights I was using before. Spotlights tend to get fainter with distance, so it was hard to accurately judge the real distance for detection. The dots make it much clearer.
So that's it for the updates. Oh, and we'll be changing the name of the game to...
Who or what is Johnny? I can't tell you yet. You'll have to play the game when it comes out to find out :)
This week I added a drone to the game. The drones can’t hurt the player, but they can inform the nearest robot of the player’s position, so that robots can come and kill the player.
Drone code is essentially the same as the robot’s code, minus killing animation and wall detection, so it was quite easy to implement. Figuring out how to notify the nearest robot took some time, but I think it works without issues now. There is one last type of enemy to implement. I'll save the details on that one for the next devblog update.
I also experimented with more level designs. I’m finding out more and more about what types of levels are fun. It seems that maze-like levels with narrow corridors are not good for this game, since you can’t evade robots easily on a linear path. They’ll keep following you until you get killed. It’s better to have blocky obstacles that you can circle around to lose the bots. When I make the environmental assets, these blocks will be tables, hospital beds, machines, etc.
Also, I’ve been adjusting the player’s walking speed to make the game fun. I sped up the player quite a bit and the game feels smoother now. I’ve been thinking about this for a while, and Alex (story writer for this game) suggested it as well, so I went ahead and did it. This is the same thing I did with Everything is Undead. The game started out with very slow movements, and then I sped it up a lot when Gab (who did sounds for the game) suggested speeding up the game a bit. In the end, the game got a lot more fun when it sped up, so thanks to him for that. I wonder if other game designers do this as well? Well, I guess this is just part of balancing. At the moment, the game feels a bit too easy, so I’ll probably slow the player down a little bit.
Last bit of update, and it's a really tiny update. Two weeks ago I added a new death animation to the game where the bots impale the player with their arms. This death animation felt a little bit off sometimes, because the angle of the arms used to fixed to some angle inwards. If the player happens to be a little bit off to the sides, the arm would extend at the same angle and not actually go through the player character.
This bothered me a lot, so I added some vector math that figures out exactly the angle that it needs to bend to impale the player realistically. I wonder if the guy that invented vectors foresaw this use for his math concept. Haha.
Trying out a new death animation. Is it too violent? Haha. I'm gonna keep it this way while I work on other parts of the game.
I fiddled around with enemy AI a lot for the last couple of days. I tried dynamically updating their patrol patterns when they spot the player, and I also tried making the bots notify each other when they spot the player. Both of those changes made the game impossibly hard... For the time being, I'm gonna roll back the enemy AI to the previous state. I want this game to be challenging, but not frustrating impossible!
Things I'm gonna work on next: another type of robot, more levels, end level record page, collectibles script, and more. Off to looking at this screen for the next couple of days :)