Welcome to this new update! It will touch upon varied topics and as always I’ll try to present an interesting insight into what it means to develop Ghost of a Tale. But first, let’s start with a screenshot of Dwindling Height’s war room… 🙂
Switching to 5.4
Well, that didn’t go quite as planned…
In fact, the move (from 5.3.1 to 5.4) I alluded to in the previous update was basically a catastrophic one. The reason is very simple: 5.4 was in beta stage. And it is entirely my fault for thinking “how bad could it be”.
For months it was written on Unity’s road map that 5.4 would be delivered at GDC 2016. And they did indeed release it; but as I was saying it was just a beta. To be more precise it was the 10th beta. And I thought “alright, some new things won’t quite work yet, but that’s ok”. That was naïve.
Turns out the move to the beta took me about week. At which point, after the 20th crash to desktop, I had to face the fact I had made a terrible decision and subsequently spent about a day just to revert to 5.3. With the indispensable help of Cyrille I managed to salvage about 85% of what I had created while using the beta, and had to rebuild the rest.
Bottom line is: the 5.4 beta Unity ended up releasing in place of the “real” 5.4 is still months away from being anywhere near production-ready and it is my fault for not picking up on the obvious beta clue. Lesson learned.
We’re now back to 5.3 and while we won’t get the improvements we were hoping from 5.4 I’m just very happy to be able to work again! 🙂
Since the game doesn’t use baked lighting at all (every light is dynamic) it presents some optimization challenges. Casting shadows is very expensive in Unity. And baking shadows is quite limiting and would really bog down my workflow.
So I had to come up with ways of keeping nice visuals (shadows are a big part of it) and yet not burn the framerate budget on things that wouldn’t be seen.
It took a lot of work but I improved on the system I already mentioned in a previous update. Before, the lights visibility distance were subordinated to a unique value; an absolute distance all the game’s lights followed.
I changed that so each light now has a specific visibility distance, depending on its location and visibility. That level of granularity keeps lights looking the same, but they’re smoothly turned off by the game as soon as they’re not needed anymore.
It makes a very big difference in the framerate. Before, in the jail, I was around 45-50fps. Now I’m mostly around 70fps (oscillating between 65fps and 82fps). The courtyard is another matter though and I still have a lot of work to do there.
On top of this optimization work I also started using a different LOD system (called AutomaticLOD) for some of the game’s assets (models are getting simplified the further away they get from the camera). It allows the poly count to go down without any noticeable visual drawback. I’m still putting the asset through its pace but so far it works brilliantly and the developer is both helpful and reactive, which is extremely important!
We have this game mechanic where the player can hide in a plethora of items (chests, barrels, cupboards, etc…). Basically anything that would accommodate Tilo’s size.
But since the beginning, tables have been a sticking point. Because it looks like Tilo should be able to fit under one, but actually the table colliders did not allow him to simply walk under a table. Yet it wasn’t visually very clear.
A long time ago I had implemented an automatic system that would put Tilo in a “forced sneak mode” when he would get near a table (touching it). And it would allow Tilo to walk under the table. It worked alright for the most part but wasn’t entirely satisfying.
In the game, when you want to hide somewhere, you switch to the “sneak stance” (hold the right gamepad trigger) and the option to hide becomes available. But again, with tables we were in a situation where it was a half-way thing; you weren’t hiding but merely “concealed”. Sometimes.
And it came with a couple of problems: when Tilo sneaks his walking speed decreases (which might be unwanted if you’re being chased) and when under a table it wasn’t clear if the enemies should see you or not. All because Tilo wasn’t officially hidden.
The solution was to simply turn tables into bona fide hiding spots. This was achieved by lowering slightly the tables’ height so that Tilo can’t quite fit under even when sneaking; hiding under a table is now a clear-cut player decision. You enter the hidden state, or you exit it. No more confusion.
Those kind of things become clearer as we play the game and the structure becomes more established; things that are half-baked like that tend to stick out more.
And on this point I think I’ll end this update. I hope it was an interesting enough read! As usual, please leave your questions and comments below. See you in the next update! 🙂