Stone Shire – Post Development Thoughts & New Project

First of all, I will like to thank the players of the community for supporting Stone Shire. This game came out May 21st of last year, and was the first of its kind on this console. It was meant to bring a block-building experience similar to Minecraft to the Wii U. It was also meant to be transformed into something more like Elder Scrolls. Unfortunately, a lot of these features I was unable to include in the game, both due to the limitations of the system (and the Unity engine) and me simply being a one man team, which led to a slow development time. I apologize that I was not able to give you the full experience that you expected. The lag of the game is something I did not want to occur, and it seems introducing the lighting and water mechanics unfortunately brought a lot of bad performance.

Unity is a great engine to work in, but it’s also not optimized for procedural generation. Because the Unity APi is not allowed to be touched both in code and by multithreading, a lot of the optimization I did was mostly C# related, aka based on all the operations I did outside Unity. The way Unity works is that it has a main thread that it processes all its processes through. While beneath the hood it is multithreaded, unfortunately, I as a programmer cannot touch anything there. For instance, in Stone Shire, if I could make mesh construction, the rendering step done by the CPU, be broken up into smaller steps, I could have made the game a whole lot less laggy. It’s not a problem when it’s just one or three chunks of meshes being built up, but when there’s multiple ones constantly being updated due to light and water, unfortunately, there’s a freeze I cannot get pass due to the mesh construction process sharing the same thread as everything else. This had led me to unfortunately passing a lot of inputs into fixed update, which is not a good thing in practice but was necessary to have the game run smoother on the Wii U. Of course, I had the algorithms for light calculations and mesh vertices building done in a different thread, since it was all c# related, so the pre processing step was actually pretty fast. However, to build the mesh, you have to pass the data to the main thread to have the mesh actually applied, and that led to the slowdowns that the game constantly experienced.

In addition, I used the Greedy Meshing technique to reduce the amount of faces on the collision mesh of the chunks, as this was taking a good portion of the mesh building time when the mesh was applied. With this made, the mesh building time became a whole lot faster than it was during alpha builds on the Wii U. Unfortunately, if I did this with the rendering part (the mesh you actually can see that has textures), this would make me have to create a texture material for each type of block in the game, and that would have led to some devious overlord of the game. Therefore, in the worse case scenario where each block is a different object compared to its adjacent neighbor, this would actually be a worse scenario technical wise since now you have to deal with both maximum face count and an abundance of sub materials.

I will strive in the future to bring a better experience to this genre, hopefully on Nintendo’s next console. However, I am bringing a pause to the post development of Stone Shire for the moment as I work on a new smaller project, which I will give details to in the next coming weeks. I enjoy working on Stone Shire, but I must also continue to create more games to put out on the Wii U. I will work on smaller patches to bring the game to a more stable quality, but a lot of features like monsters, animals, and the weather system I wanted to implement would have to wait until a future iteration of the game.

Thank you for following along on my adventure and I hope you stay for the next chapter in Finger Gun Games life.



Stone Shire 1.1 10/20/2015 Progress

Things have been going well on the development of this upcoming patch for the game. Been making a lot of quality of life changes to the game. For instance, players will be able to play solely on the Wii U GamePad for those who like the comfy life of lying on the bed or couch with their handheld in their hands. And they can also play with a Classic or Pro Controller. So you can just place your GamePad on its dock and play it like a second TV or play it on your TV. The GamePad is still used as an inventory peripheral, so you still have to use it. I have a non-GamePad feature of navigating the inventory currently in development, but it probably won’t make it until multiplayer is implemented.

The jumping has been improved, so now the player can make more precise jumps. The problem on the live build is that when you make a jump, you’re committed to it, not able to change its direction mid flight. Now you can, which should make jumping on places you want a whole lot easier.

There is one issue I am dealing with right now, and that involves the speed of updating a chunk after mining a block. On my PC with a Intel Core i7 4790K, the block update process takes only 200 ms. This includes light propagation and generation of the procedural mesh. However, on the Wii U, whose CPU is not as good, the time to process is a whopping 5000 ms! That’s a 25x difference. And the process that takes the most chunk of this time is the mesh generation process around 2500 ms, where as the remainder is held by the light process, which is composed of two module processes. This is with limiting the processing to only a set amount of space around the block. Because light propagation requires multiple chunks to be updated due to the possibility of how light radiates, multiple chunks are updated at each cycle (which is limited again by a variable to keep the game at a steady enough frame rate). This may sound easy to optimize on paper, but I am using Unity for this project, and unfortunately, Unity has to build its meshes on the main thread. This means whenever a number of game objects with procedural building processes are active, the game essentially stops until they are done, resulting in chopping gameplay. This problem is solved by brute force with a better CPU, but with the Wii U, this is going to require some heavy ingenuity or cutting some corners. Obviously, these processes are put in their own threads, but the slowdown mostly comes from chunks being rebuilt. And the process itself in general creates a short time where the player mined the block, but the terrain doesn’t update until it has processed it.

There’s still a few more solutions I can try to get this up to better speed, such as further queuing the chunks that are rebuilt. I have a main queue of chunks that immediately have to be updated, for when the player removes or places a block for immediate feedback. So I can make a second queue of not so important chunks. It’ll mean that light and water will be updated slower visually, but it may be the price to pay to make this all stable. I have to be careful with this, of course, because the bigger the queues are, the more ram this can take. My game however doesn’t go above half a gig most of the time, so I should be fairly alright. There’s still the bug that the game crashes when in extended play reported by players, so I’m going to have to find that memory leakage that’s happening somewhere.