Simulant 21.09 Released!

It's a couple of days later than expected, but I'm happy to announce the 21.09 release of Simulant!

Swirling Blades Image

There are a couple of big features in this release, and the usual scattering of smaller features, bug fixes and improvements. Here are some of the highlights.

The MeshInstancer Stage Node

Up until now there are have primarily been two methods of displaying loaded mesh in your game scene, these are:

  • Actor - a fully dynamic stage node that allows behaviours, multiple levels of detail, and an array of other features. To support all this, Actors are very memory-intensive.
  • Geom - a completely static stage node, attached meshes are compiled on construction. Usually used for level geometry.

There are times though when you need some middle ground: you want to spawn multiple instances of the same mesh, but you don't want to have to take the overhead of creating an Actor for each one. And that's where MeshInstancer comes in!

The new MeshInstancer stage node is a fully dynamic stage node (it can be moved, have behaviours etc.) but when instantiated with a mesh, it doesn't immediately render anything. Once you have created a MeshInstancer you can then spawn multiple instances of the mesh over and over again at relative positions around the MeshInstancer. The mesh instances that are created use very little memory, and are incredibly fast to render. MeshInstancers are ideal for spawning things like foliage, trees, rocks etc.

In 21.09 we have implemented a first-pass at the MeshInstancer, but in following releases we intend to add levels of detail like actors, and much more - while ensuring that things remain fast and light.

A Stream-based JSON Parser

Up until now Simulant bundled in Jsonic, which is a very small JSON library and this was used for parsing material and particle script files, among other things. It wasn't a publically advertised API though so unless you went digging around the Simulant codebase you wouldn't know about it.

Jsonic (and many other JSON parsers) suffered a flaw though that was catastrophic for low-memory environments like the Dreamcast: it would load the entire JSON file into RAM.

Simulant 21.09 now includes a custom public JSON parsing API which uses an underlying file stream to move around the file data. This allows minimal memory usage even with massive files and it's resulted in much lower memory usage when loading materials and particle scripts.

Faster UI Widgets

UI widgets have been cleaned up, many bugs have been fixed, and they are much more performant. This is the result of increased user testing and feedback on the UI subsystem. Newlines in text are now also handled correctly without causing a crash which had been a long-standing bug.

The UI subsystem is still very much a work in progress, and we welcome testers and contributors to help build it out into a first class part of the engine.

Miscellaneous Improvements

There have been a number of bug fixes and improvements including:

  • The Simulant test suite now uses far less memory
  • A performance issue and potential memory leak in the physics subsystem has been fixed
  • We've continued our drive to factor out C++ exceptions where they aren't necessary, using smlt::optional<T> returns instead
  • The SmoothFollow behaviour has received some improvements, including the ability to pause and resume following
  • Console logging now uses ANSI colours for INFO, WARN, and ERROR levels
  • You can now force a texture file extension when loading 3D models - this is useful to force a platform-specific texture format (e.g. .dtex on Dreamcast) even if the model file specifies say, a .png
  • GLdc has been updated and this has received a lot of performance improvements recently

Simulant Needs You!

Simulant has come a long way over the last few years, but to really fulfill its potential it needs more people to get involved! If you've ever wanted to write a game, give it a try! If you're a developer and you want to add new features and improvements, get stuck in!

Special thanks again to everyone on the Simulant Discord - particularly @freakdave you continues to be our number one contributor and tester!