Simulant 20.09 Released!

We've just tagged the first ever stable release of Simulant: 20.09!

Today marks the start of a regular release cadence for the Simulant project. We'll aim to release Simulant every 3 months. Disruptive changes will be merged at the start of the 3 month period so that by the time of release things should have stablised nicely.

So what's new in Simulant 20.09?

Improved Skeletal Animation!

skeletal animation

The previous alpha release introduced Skeletal Animation. Simulant 20.09 brings manual manipulation of skeletal actors! Want your character to turn its head to follow a target? Now you can simply find the joint you want to manipulate, and go for it!

New Dreamcast Audio API

Previously Simulant used ALdc 1.0. This was an OpenAL implementation for the Dreamcast that did all mixing on the main SH4 processor, before sending audio over to the AICA sound processor.

Not only was this slow and wasteful, but there were a number of bugs that were never resolved. In preparation for Simulant 20.09 the Simulant team has reimplemented ALdc from scratch. Leveraging the AICA directly, and its 64 available channels to provide faster and better audio.

ALdc will continue to improve and gain functionality over the next few months!

Better "alias" API

In the previous Simulant release, you could give assets a name during construction by using the _with_alias suffixed methods. This was a very cumbersome API, and increased the number of methods on the AssetManager unnecessarily.

You can now set the name of an Asset or StageNode using it's set_name(name) method. And if you want to do so inline with construction you can use new_X()->set_name_and_get(name); which returns the object itself.

Finding nodes and assets by name is also much more straightforward. Simply use the find_X(name) methods which can be found on the AssetManager and Stage.

New StageNode::destroy_after Method

Quite often you want to destroy a stage node after a delay. For example, your game might have a missile object that should destroy itself if it's still alive after a number of seconds. This behaviour is now simple! All stage nodes now have a destroy_after(Seconds) method, so now you can fire and forget!

New .ms3d Blender Plugin

As Simulant .ms3d support was being added, we became aware that the .ms3d import/export plugin in Blender had stopped working in recent versions and had been removed from the community plugin tree. To help developers (until Simulant supports a more modern skeletal format) we've written a brand new .ms3d export plugin for Blender.

You can find the plugin in the Simulant project on GitLab.

Bug Fixes and Minor Features!

Along with those new features there are a number of bug fixes and minor changes, including:

  • Fixed a typo in the joystick button enumeration (Thanks @freakdave!)
  • Fixed .equals vs == problem when setting positions, scaling, and rotation
  • Fixed issues with object pooling
  • Made MS3D loading more resilient
  • Fixed a bug where the free list in the object pool would break
  • Added a new_submesh_as_capsule method
  • Added more operator overloads for the Degrees class (thanks @freakdave!)
  • Fixed a number of sound issues
  • Fixed depth issues on UI widgets

What's next?

Things that are lined up for next release include:

  • A complete restructure of the core engine API
  • An upgrade to the Bounce physics engine
  • More audio and performance improvements

Have fun!

Simulant Alpha 4 Released

I just missed tagging Alpha 4 by the end of June, which would've continued the 6 monthly release cycle that I'd organically fallen into. This was largely because I've been pushing some final bug fixes into the release to make it so much better!

And what a release it is, a total of 51 merge requests were merged this cycle! Let's see what they bring!

Skeletal Animation

Skeletal animation has been a glaring missing feature in Simulant for years, but now it's here and ready to go! The first skeletal mesh file format that Simulant supports is Milkshape 3D, but in the next few releases I plan to bring more new formats into the mix.

MS3D Model

Mesh objects that support skeletal animation support both pre-defined animations through the existing KeyFrameAnimated interface, and also manual joint manipulation through the new skeleton API.

Disable Culling Per-Node

Previously there was a poorly implemented flag for disabling culling of actors. Now, you can disable all spatial culling of any stage node by setting its is_cullable property. This is useful for debugging, or if you know that a node will always be visible it can lead to small performance improvements.

Better and Faster Memory Pooling

StageNode pooling was rewritten for Alpha 3, but the resulting code had some deficiencies, particularly around iteration and insertion performance. The next iteration of that pooling has arrived in Alpha 4, bringing huge speed improvements.

Utility Functions for Heightmaps

When loading heightmap meshes from texture data, Simulant has always provided information about the way the heightmap was generated via the stored TerrainData object. TerrainData has gained utility functions to get the exact height at a world coordinate, and to give you the triangle indexes at a world coordinate. These are super useful for placing things on your terrain, or performing ray-intersections.

Additionally, you can now pass a TexturePtr to new_mesh_from_heightmap instead of a file which is great if you're generating the heightmap procedurally.

Coroutines

Simulant now has a basic implementation of Coroutines, and all mutexes throughout the codebase have been removed. Not only do Coroutines provide a simpler model of concurrency, and reduced complexity of the entire codebase, but they've improved performance.

None of the Simulant API is now threadsafe, and Coroutines should be used for all concurrency.

New Threading API

Although Simulant isn't threadsafe, that doesn't mean you won't need threads at all. Simulant now provides a consistent and clean threading API for all platforms for you to use in your own code. This is an alternative to C++'s std::thread which has spotty (or non-existent) implementations on older compilers.

Loads of Bug Fixes and Minor Features

Too many to mention, but here are the hightlights

  • Fixed a bug where particle systems would live longer than they should
  • Fixed bugs in particle system updating
  • CylindricalBillboard and SphericalBillboard behaviours were added
  • Removed usages of deque and stack which hurt performance
  • Simplified the texture API
  • Added a new container for faster render queue insertion and iteration
  • Fix alignment issues in optional<T> that could cause a crash
  • Improved Octree and Quadtree performance by pre-calculating child node indexes
  • Allowed positioning and rotating of Geom's on construction
  • Vertex colours are now loaded from Wavefront .obj files
  • Capped deltatime to avoid spiraling
  • Added support for texture matrix manipulation
  • Improved performance of material properties
  • Improved the performance of the Frustum partitioner
  • Improved the performance of UI widget rendering
  • Widgets can now have render priorities
  • Added custom iterators throughout the codebase
  • Improved the performance of index iteration
  • Removed Window backgrounds which were confusing and brittle
  • Fixed crashes in MD2 loading
  • Renamed RenderSequence to Compositor
  • Improved OSX compatibility
  • Added "force" to digital inputs on virtual axises
  • Fixed parent_is_stage method

... and many many more!

Special Thanks

Special thanks go to Charlotte Koch and David Reichelt for their contributions this cycle!

Simulant Alpha 3 Released

It's been 6 months since the last Alpha release of Simulant and it's now time for another! In fact this 6 monthly cycle has become an unintentional habit that I may as well continue!

So what's new since last time?

Well first let's look at the stats:

 382 files changed, 12986 insertions(+), 7013 deletions(-)

That's a fair amount of code churn! Lots of deletions, lots more insertions, so what to do they add up to?

  • Memory management for manual objects has moved to an improved pool system to reduce allocations and improve performance
  • Brand new hierarchical material property system
  • More consistent object management APIs
  • Added a gprof compatible sampling profiler to the Dreamcast build
  • Made Octree depth configurable in the Geom culler
  • Reduced memory usage of Geoms
  • Added a loose Quadree Geom culler
  • Improved render queue performance
  • Improved render queue ordering sequence
  • Made "nameable" objects consistently use std::string for names, rather than unicode for reduced memory usage
  • Added iterator classes for better and faster iteration of Simulant containers
  • Moved to a new default vertex structure for better Dreamcast performance
  • Update to latest GLdc on the Dreamcast
  • UI widget rendering has been refactored for performance
  • Added support for loading .wav audio files
  • Implemented 3D positional audio
  • Allow setting pitch, gain and reference distance for sound sources
  • Conditionally generate mipmaps on the Dreamcast when possible
  • Improved the performance of MD2 animations
  • Renamed "ask_owner_for_destruction" to "destroy"
  • Standardised on "clean_up" rather than "cleanup" across the API
  • Fixed bugs with shininess in .obj model loading
  • Started moving to a transactional API for asset manipulation
  • Allow linking Pipelines to Scenes
  • Fix wrong RAM usage being displayed in Windows
  • Add a RAM usage graph to the stats panel
  • Huge refactor of particle systems
  • Allow specifying multiple materials for a mesh and selecting them per-Actor (multiple skins)
  • Various controller mapping fixes
  • Roll back to an earlier glibc on the automated builds for more portability
  • Added support for integer packed normals
  • Added support for unsigned byte vertex colours
  • Added more utility functions (e.g. smoothstep)
  • Allow controlling blending when loading meshes from file
  • Improved the speed of font loading
  • Improved the built-in font files
  • Improved the performance of applying staged writes to the partitioner
  • Switched to the frustum partitioner by default (spatial hash is still experimental)
  • Build a debug release of Simulant for the Dreamcast on CI
  • Fixed issues with Camera::unproject
  • Many many other bug fixes and performance enhancements!

Massive massive thanks to @freakdave for his great contributions to this release. And also a shout out to @HaydenKow for generally being a great mentor, and everyone else on the Simulant Discord for generally being awesome!

Introducing Simulant

Merry Christmas! The festive season seems like a good time for an announcement, so here we go!

I'm pleased to announce the Alpha release of the Simulant Game Engine - a new open-source project to bring modern game development flows to older platforms.

Simulant is a portable general-purpose game engine, written in C++. It's aim is to allow writing games for older 3D consoles like the SEGA Dreamcast, as well as modern platforms such as Windows, Linux and Android.

Simulant is built to let you get a game up and running fast! The API is designed to be easy-to-use and to read so that even novice C++ developers can build games and experiment. The simulant command line tool lets you set up a scaffold project, and build, package and test for multiple platforms with a few simple commands.

Simulant requires using Linux as a development OS, but uses cross-compilers and Docker to build your game for other platforms.

The development of Simulant as led to the development of GLdc, a brand new OpenGL implementation for the SEGA Dreamcast, and the fledgling ALdc which hopes to bring OpenAL compatibility to the same platform.

Simulant comes with a bunch of features:

  • Multiple renderers (OpenGL 1.1 and OpenGL 2.1)
  • High-level Scene management
  • Powerful material system, supporting GLSL on GL 2.x
  • Hierarchical scene building
  • Scriptable particle system (custom JSON format)
  • Support for loading .obj and .md2 meshes, as well as Tiled .tmx files
  • Complex configurable rendering pipeline
  • Easy-to-use API
  • Automatic memory management of game assets
  • Automatic level-of-detail mesh selection
  • Combination Spatial hash and Octree based culling systems
  • Built-in realistic Newtonian physics engine
  • Entity behaviour component system
  • UI widget rendering system
  • Built-in helpers for scrollable backgrounds, skyboxes and animated sprites
  • OpenAL powered audio
  • There's probably more I've forgotten...

And if that isn't enough, the whole thing is controllable from a simple command-line management command, which allows you to bootstrap projects, build them for multiple platforms, run unit tests, and package your game for Linux (flatpak) and Dreamcast (.CDI). Windows installer support is coming soon!

You don't even have to compile the game engine yourself, just install the management command and it will download pre-compiled game engine libraries which are generated automatically via a complex build system!

Simulant is built to support multiple OpenGL renderers. Currently there are OpenGL 1.1 and OpenGL 2.1 renderers and a GLES 2 renderer will happen soon. As for platforms:

  • Linux: Packaging needs work. Working Flatpak packages are built with the "package" command though.
  • Windows: Executables are buildable using the built-in cross-compiling, there is no installer generation (packaging) yet, although when it lands it will use NSIS. If you want to compile manually + natively on Windows, then building on VC++ should work, it may require some minor patches.
  • Android: An Android build has worked in the past, a long time ago, but it bitrotted away. It's about 80% restored, but doesn't work yet
  • OSX: TravisCI is building for OSX on the GitHub mirror, although it's not being used for anything except checking that nothing broke. You'll have to build OSX projects manually on OSX itself for now.
  • Dreamcast: Builds and generates a bootable .cdi image. Romdisk support is high priority, as is VMU file loading/saving.

Getting Started

Providing you have a Linux installation available (preferably Fedora 28 or 29), getting up and running should be easy. Head on over to the tutorial!

Status

Simulant is currently at Alpha stage. This means the codebase is unstable, and the API is subject to change. If you're using Simulant to build a game, make sure you update frequently, and file bugs and submit patches to help improve things.

Keep an eye on the Simulant Discord chat, and issue tracker.

Get Involved!

Simulant has so far been pretty much a one-man project, for it to reach its potential it needs other contributors. If you want to help out, hit the Discord group and come join the community! Here are some useful links for getting started!

And if you don't have the time to contribute, but want to support my work then my patreon is here

Caveats

Simulant is very much under development, so pay attention to the following caveats:

  • Nothing is stable. APIs will change!
  • The Dreamcast support is currently missing audio, this is work in progress
  • The Dreamcast port is missing built-in support for VMU storage, rom disks and CD audio. You can use native KallistiOS SDK for some of this functionality
  • Work is ongoing to support texconv's texture format for Dreamcast native textures
  • Baseline memory usage is still higher than I'd like
  • The material system is due to change soon to be switched for a more readable JSON based system.
  • The current default OpenGL 2.x shader has a bug which overbrightens some models
  • Thread-safety is a bit hit and miss
  • Some of the APIs are a first-pass and have bugs or inconsistencies
  • On the GL 2.x renderer, render batching (performance) needs improving

Licensing

Simulant is released under the LGPL (with patches accepted under dual LGPL+MIT licensing), there are a number of reasons for this, but it does mean that:

  • If you make and distribute changes to Simulant, you must make those changes available under the LGPL.
  • If your game statically links to Simulant, you must release your app's source code under an LGPL compatible license, or buy a commercial license for Simulant.

For more information, take a look at the licensing page