27 May

Week 8 Recap

Looking Back

Two months gone by, already. Time flies.

As expected, I have been busy with the loading and persistence aspect. This stuff is just hell to get right with performance in mind. Until a few days ago, I still had a mechanism which would unload terrain chunks from memory once they at a large distance from the player. Upon tracking back, those chunks would then be loaded again. First, this was a major improvement, since the chunks were not being completely generated from scratch, anymore. However, harddisk input / output tends to become a bottleneck very quickly. As it turns out, that was not even the biggest issue. Unity’s many flaws (compensated by its myriad of benefits) include the reliance on rather old Mono version, with its abysmally bad garbage collector. Frequently allocating large chunks of memory, e.g. for terrain loading, is therefore a surefire way to produce equally frequent, nasty spikes of performance drops when the garbage collector runs. Big no-no.

As a temporary solution, I simply do not evict any data, anymore. The memory footprint will appear high for a “simple” looking game, but at this time I am not willing to put in any more time into an issue which is largely out of my hands.

So, what will actually work now? Well, starting a game in one of the larger regions will take only slightly longer instead of multiple times as long as a small region start. When players move around the environment, more terrain is loaded incrementally, until the entire map resides in memory. Here is a little demonstration of the loading in the Unity editor:

The current settings in the standalone build should make it hard for players to overtake terrain building, so they should be able to seamlessly run from one corner of the map to the other. While this means that precious little time has gone into actual game features, the performance fixes will make testing a lot more bearable.

Speaking of testing, I have uploaded a new alpha build with all changes as of today. Check the forum and help me out, if you like.

Looking Forward

With the most glaring performance issues having been addressed, I have a good feeling about continuing on gameplay. Last week I mentioned the task system, especially its user interface, as a next big task for me. Next week’s goal will be enabling players to assign a “tend campfire” task to one of the companion NPCs. From there, I can iterate on the system and extend it for arbitrary tasks, as usual.

Thanks for reading and until next week.

20 May

Week 7 Recap

Looking Back

As mentioned last week, it was time for another look at the terrain. Previously, all geometry was generated procedurally from (relatively) simple algorithms. While this offers a maximum of flexibility, it is also a maximum of pain in the ass to implement and extend. I have changed the system to still create the basic terrain layout procedurally, but geometry is now made up of pre-built pieces which are then combined into a whole terrain chunk.

Work in progress terrain pieces

Work in progress terrain pieces

These pieces have lower complexity, because I made fewer subdivisions on their surfaces. Currently, this also means that flat ground areas look very bland. Some shader-magic and splatted normal maps will change that soon enough.

Terrain with new pieces

Terrain with new pieces

On the loading front I am still working on continuous terrain loading. First I had to switch to a different persistence solution. Now I am trying to find a way to load terrain without slowing the game to a crawl.

Looking Forward

I will continue working on the terrain until the whole thing runs somewhat acceptably. Initial loading times are already down by a large amount. Once the continuous loading is done, I will upload a new alpha build.

After that, I want to tackle the task system next. All characters in the game are supposed to be able to issue and work on tasks of all kinds. Players also need a useful interface to define their tasks. That will keep me busy for a while…

Thanks for reading and until next week.

13 May

Week 6 Recap

Looking Back

So, the last two weeks have flown by. First I have had some mental/physical health issues which stopped me in my tracks. I thought I was resistant to stress when working on something I love. I was mistaken. Stress-induced panic attacks are not fun. 0/10, would not do again. Luckily, I had a few days of vacation planned already just after breaking down. This week I had to start slow to keep the pressure low. Now I should be back in full swing.

As for the interesting part, I was still able to implement some good stuff. Object placement is now in a solid state, with spawning locations finally being consistent, correct and efficiently queryable. Consequently, players will not spawn below the terrain geometry, anymore.

I have also made some fixes to the player representation. Movement is much smoother, the player character now has an actually updated physical volume and cannot move through walls anymore… Additionally, character animations are now unified, which also affected NPCs. See the following, short video:

Compare that to the last video to see the small but significant progress.

As a last improvement, NPCs now have latent survival tasks. Finding and consuming food already works, albeit in a rather rudimentary fashion.

Looking Forward

Next week I want to make another iteration on the terrain. Running the game on a weaker machine is barely watchable. I will try to simplify geometry and retain detail using shaders. If time permits, I will also implement continuous terrain loading. In effect, this means that only the immediate surroundings of the player need to be loaded, while all other geometry can be replaced with simplified representations for pathfinding purposes.

This is a deviation from my plan to work straight towards an MVP. However, since I would like some testing feedback, I need to provide testing versions which actually run on medium performance machines.

Thanks for reading and until next week!