





🌟 Special thanks to our amazing supporters:
✨ $10 Tier: [Geeks Love Detail]
🌈 $5 Tier: [Arch Toasty][Benedikt][David Martínez Martí]
We'd like to start the year with a fresh survey! Answering it really helps us, and "more surveys" was much demanded in the last survey :)
Zun was happy with the look of the new floodfill lighting for torches, so he worked on optimizing the code behind it. He spent most of his time converting the code to Rust. Rust is a programming language that Zun himself will explain here:
[Zun]
Code written in C# in Unity is quick enough for most uses, but it has some trade-offs which limit it from reaching the "maximum" performance similar code can reach when written in a different language. Prime example of this is that C# is compiled to machine code every time you run it and there are strict time limitations on doing so (you don't want the game to take 2 minutes to launch), which limits the possibilities for optimizing. Another "problem" is that the C# environment is not especially aimed at maximum performance, so there are circumstances where the code could be quicker but there is no proper way of expressing what you want to do in C#.
So there are some programming languages more aimed at performance, notably C, C++ and Rust. We're using Rust because the environment around it is much more modern compared to C and C++; building on different platforms is easy with "Cargo", it has built-in systems for testing, it comes with a decent standard library. Unity itself is also developing their own language (Burst compiled C#) to use for this exact use case, but at the time of writing it seems to be somewhat work in progress.
Of course C# has it's merits as well - it is generally easier to write, maintain and distribute. So the usage of Rust will be limited to some small parts of the game that run a disproportional amount of time, like terrain generation and now preparing the data for torch lighting. A relatively straight forward translation of the updated torch lighting turned out to be more than 5 times as fast, which adds up to seconds of processor time saved over many torches.
[Zun out]
Zun is our programmer, and I busy myself with most of the other tasks; writing these blogs, making textures and models, thinking about game/UI design, checking and responding to messages, etcetera. But the current and next updates dont require new textures/models, so I can focus my energy on other tasks. This week, Ive returned to learning more about Unity and programming in C#. Im still not experienced enough to contribute to Colony Survival itself, but Im getting closer!
I suddenly got inspired to make a simple game about firing a howitzer. Ultimately youd be firing on distant targets surrounded by targets you explicitly shouldnt hit. Heres my progress in five GIFs:
[ 5970 ]
[ 1939 ]
[ 1814 ]