Changelog #51 - Calculations

Very good to finally experience summer completely. It actually gets hot here in Sweden! I’ve been to midsommar celebration, some birthdays, and walks in the awesome Swedish forests, so this time there are not so much gameplay changes, but anyway, there are a lot of internal changes, plus some usability and tutorial improvements.

Meanwhile been slowly rewriting code to get rid of one library that caused much problems: I edited some code for like 10 minutes per day and I think there were over 20k lines changed. Then I decided to try again to fix the actual issue instead of removing the library. And somehow I succeeded! Now I have the latest version protobuf and it doesn’t crash when trying to free strings from memory after being dynamically reloaded. There was a lot of other issues with static linking (such as armed conflicts between ssl versions), but it turned out they all were solvable. What all that means? That in playtest build, your C drive won’t fill by 100G anymore and eventually you will be able to restart game without hitting Alt+F4 on gameover screen :D

Another thing - I really want to try Unreal Engine 5 and convert the project to it, since there are a lot of sweet things (such as C++20 support). But I can’t do that yet because I need tessellation, which were cut out in UE5 - and they didn’t provide any proper replacement. I tried to return it in engine sources, but there were too much changes then and since then. Maybe I’ll try again one day, but for now it’s better to concentrate on the game. For now, I only updated the project to 4.27.2.

Also, I replaced standard unordered containers with other implementations made by community. The choice fell to robin_hood for strings and emilib for ints - benchmarks in the internet shown that these are the fastest. This is a premature optimization and game didn’t needed that - but anyway, updated containers game 4-10 times turn calculation speed boost! Now it’s almost instant even on 300x300 maps where are a lot of things going. It was not a secret that standard containers are not as good, but such huge speed boost is quite surprising. Here is this benchmark. Author wants to update it - I hope he will include Unreal Engine’s TMap there.

Lastly, I made a couple of very important features that were waiting really long (but no longer than this protobuf bug, which have been here almost since project start). The first one - you can now manually deattach groups that are about to deattach on the next turn. This way you can select which resources go to deattached groups (by drag’n’dropping them). This is usually not needed because they are distributed automatically depending on productions, an intention of sending expedition to the wilderness, but sometimes you need to do this faster than through resource transfers after deattachment. So here it is - but actually resource rearrangement is not implemented yet… Another feature is production number breakdown - some players question why is it -10 food per turn, or -0.5 wood per turn. Now you can hover the production number and the game will list all things that contribute to the production number - other productions, food consumption, resource transfers and so on.

Here is the full changelog:

  • breakdown of production number on hovering
  • encyclopedia button at top right, where you can search for all in-game terms and tutorials
  • new icons for some resources (such as coal, charcoal)
  • new particles for procedural resources
  • improved some text and UI
    • improved faction selection menu
  • improved tutorial windows
    • some new tutorial windows
    • now they’re displayed automatically
  • new pieces of writing
    • a description for Roman Empire
    • a lot of new tooltip extensions
  • manual deattachment of far group implemented (clicking on small “+” flag button)
  • locked tooltips now auto-hide if you move mouse away from them
  • CPU optimizations, 4-10x speed boost of turn calculations
  • tiny GPU optimizations
  • updated unreal engine to 4.27.2
  • a lot of bugfixes
    • removed unintentional armor bonuses from armor mastery when armor doesn’t defend from certain damage type
    • now you can’t investigate tiles hidden by fog of war
    • fixed issue with protobuf dynamic unloading
    • fixed all memory leaks that were result of this issue
  • new bugs