This week has been dominated by back-end stuff with no really visible (to the end-user) result. In particular:

  • I updated my OS X build to Clang 3.9. It is much better at finding potential problems, so I tracked down a few hundred warnings and fixed them!
  • Refactored a whole bunch of code to clean it up, speed up incremental compilation (by breaking huge chunks into lots of little ones), and add asserts to help find bugs.
  • Combined a few copy/paste code-paths into generic versions, giving me one target to debug.
  • Spent a lot of time reworking my CMake configuration to better handle external dependencies.
  • Added OpenMP support, and use it to speed up world-gen.
  • Fixed an issue in world-gen that would sometimes lead to an error message “unknown material”, and chunks of land mysteriously turning into aluminium (or whatever was first on the materials list).
  • Settlers who are lumberjacking will keep doing so if there are more trees to chop, rather than dropping their axe and going for a walk.
  • Fixed an issue (see the RLTK notes) that quitting/saving (with Q) and then immediately reloading would cause all kinds of havoc. It turns out that the ECS wasn’t being properly purged, systems were running twice, and all entities were duplicated. A quick way to have extra settlers, but not what I had in mind.
  • Fixed an issue that made rivers not always start at the very edge of the map (off by 1).
  • Settlers can now drown if they find themselves in deep water. They will try and swim, and may survive if it works out – however, until pathfinding is updated to allow for them to traverse water, the odds aren’t good…

Not exciting, but should help in the longer term.

RLTK – The Modern C++ Roguelike RToolkit Github**

Using parallel_each to iterate across a set of components will now use OpenMP if you have it available, and fall back to std::future otherwise. OpenMP generally handles thread pools better than the default C++ standard library, so this was a performance win for Black Future. There is now also a delete_all_entities function to quickly erase the Entity-Component-System (it also nukes all components). Likewise, delete_all_systems purges the systems list. This is useful for quit/resume.