Happy New Year!
Another quarter has gone, and that means it's time for another tagged release of SImulant! A lot has happened over the last 3 months, mainly driven by the development of the Driving Strikers Holiday Edition Dreamcast game demo that has been developed by the main Simulant contributors.
So onto what's new in this release!!
The way the core of Simulant has been structured until now has been quite messy due to the way the engine unexpectedly developed over time. Specifically, objects and properties that would logically be at the Application
level, belonged to the Window
- the Window
class had multiple unrelated responsibilities and it was a big code smell.
In 21.12 this has all changed!
time_keeper
, shared_assets
, vfs
, idle
, sound_driver
, stats
, and frame started/finished signals are now found under the Application
new_stage()
) is now handled by the Scene
class templateThis is a much cleaner structure and the Window
class is now only responsible for things like event handling and functionality related to the window itself.
Alongside a huge cleanup with how widgets are rendered and sized, we've introduced two MVP widgets that make the UI system much more powerful:
Frame
- this widget is a container widget that you can pack child widgets into, either in a left-to-right, or top-to-bottom orientation. Keyboard
- this widget is an onscreen keyboard that you can create to gather input from a player when a physical keyboard isn't available.Both widgets are a first-pass iteration, and have some rough edges that will be ironed out before the next release.
We've introduced a new default UI theme in this release. The bold blue has been toned down and widgets by default have a dark theme. We've also cleaned up the UI theming so that you can create a new look just by providing new background, foreground, text, and highlight colours.
We've updated our copy of Bounce to the latest upstream version, and there have been a number of performance improvements in our wrapper code. Also we've introduced new functions to RigidBody
as well as a new KinematicBody
class!
TTF fonts are now used by default over .FNT fonts. You can specify a default font and size in the AppConfig
for your application and Simulant will use that for UI widgets, and panels. You can now override fonts easily per-widget by calling Widget::set_font()
and this will use an internal font cache to make sure that fonts are only loaded when necessary.
ALdc, our Dreamcast OpenAL implementation, has been upgraded. This provides working, low-CPU positional audio when running on the Dreamcast platform!
There have been a vast number of big fixes and improvements over the last 3 months - too many to list! The focus on the next quarter will be to continue to improve the widget framework and we'll start tentatively looking towards adding networking support to the engine!
Happy Halloween!
As a Halloween surprise two members of the Simulant team, Luke Benstead & David Reichelt, have been working on a mini Halloween Dreamcast demo called "Tunnels"!
It is available for you to download on the itch.io page.
Tunnels is a mini-demo of the Simulant engine. It's been written over the past three weeks as a demonstration of what Simulant allows you to do in very little time. Both Luke and David have day jobs, and this has been developed in their spare time - probably an hour a day each at most - and a good majority of that time was spent improving Simulant itself!
Along the way flaws were discovered in Simulant and many were fixed, others will be fixed later. Some planned features were dropped due to limited time, but may reappear at some point. In the future we'll use Tunnels as a test bed for new Simulant features, and as a regression test.
Tunnels demonstrates a number of features - that possibly have never been in a Dreamcast homebrew game before:
There were a number of features that were unfortunately dropped due to time constraints:
Many issues were fixed in Simulant, including:
Special thanks go to the following people!
It's a couple of days later than expected, but I'm happy to announce the 21.09 release of Simulant!
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.
Up until now there are have primarily been two methods of displaying loaded mesh in your game scene, these are:
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.
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.
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.
There have been a number of bug fixes and improvements including:
smlt::optional<T>
returns insteadSmoothFollow
behaviour has received some improvements, including the ability to pause and resume followingSimulant 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!
Unfortunately a little later than scheduled, I'm happy to announce the release of Simulant 21.06!
Due to me moving home it's a little less feature packed than some releases, but, there's still plenty to see! Without further ado, here's the new shiny!
The Dreamcast natively supports a kind of texture compression called VQ compression. It's a remarkably memory efficient way of supplying texture data. Of course, other platforms don't natively support VQ compression in hardware so that makes it tricky to support in a cross-platform way.
In 21.06 we've added support for .dtex files which is the output format of the excellent texconv utility. When loading .dtex files, VQ compressed formats are loaded directly to hardware on the Dreamcast, but decompressed in software on other platforms! This allows you to ship a single compressed image format for use everywhere, with the caveat that decompression will hit loading times (and of course, memory) on non-Dreamcast platforms.
Path
TypeUp until now, Simulant has been using the unicode
type to deal with file paths. However, paths are not always valid unicode and so should not be stored in a unicode type. Instead Simulant now uses a new Path
type that is based on std::string
. This will behave more correctly, and also be more efficient.
Previously each Mesh got its own VertexData instance, and each SubMesh got its own IndexData. This could potentially be very wasteful. Now you can pass a VertexDataPtr or IndexDataPtr during Mesh or SubMesh creation respectively and these can be shared across multiple meshes/submeshes.
We now have an automated Doxygen build process that generates up-to-date API documentation which you will always be able to find here.
get_platform()
is now GlobalPreviously information on the platform an app was running on was available via the window
property. This made little sense, as by definition the platform is global state.
Now in addition to get_app()
which was added in the last release, there is now a global get_platform()
function that returns a Platform*
so you can query information about the system (e.g. how much memory is available etc.)
Up until now you could enable fog in some capacity on the stage, this API has been removed in favour of fog being a Material-level property as it should always have been. The additional properties are:
s_fog_mode
s_fog_density
s_fog_start
s_fog_end
s_fog_colour
Texture formats previously didn't allow for different component orders (e.g. BGRA) and some formats were ambiguous. These problems have now been rectified with better texture format naming.
You can now pass TextureFlags
when loading skyboxes to have full control over the kind of filtering etc. that takes place.
It's a common case that you'd like a stage node to "follow" another node, but without any kind of hierarchical re-parenting. For example, once you've created a skybox, you'd probably like it to stay positioned around your camera. Previously you could use node parenting and the (brittle) StageNode::lock_rotation
function, but this has now been replaced with link_position
e.g.
skybox->link_position(camera);
To unlink you simply pass nullptr
to link_position
Previously sounds used a constant buffer size, but this could mean that high quality audio could suffer from drop-outs. Now the buffer size is calculated based on the bitrate of the audio.
A little bit of API clean up. Source
is now named AudioSource
, and SourceInstance
is now called PlayingSound
. This makes the API much clearer.
That's it! There's the usual scattering of bug fixes and small features but 21.06 is a big leap forward in just a few months!
It's the end of the first quarter of 2021, and that means another Simulant release!
After the fairly quiet release in December, the time we have a feature packed version for all you lovely game developers!
It's always been the intention to support as many platforms post-Dreamcast as possible, and supporting the PSP really is a no-brainer when it has such an active homebrew community. 21.03 includes the first steps towards full-featured support for the PSP. PSP builds are running on CI, and some demos are successfully running. There's plenty more to do though, so if you're in the PSP community and want to make PSP support first-class then please get involved!
Stage node memory usage has been reduced by 33% on average, sometimes this can be much more. The node pool is now shared across all stages (which reduces wasted space when using multiple stages) and larger stage node types (e.g. Widgets) have been refactored so that stage node types are approximately equally sized (again, reducing wastage).
The Material system has been re-written under the hood to reduce memory usage. Material property values are now only stored if they differ from the default material definition, effectively now Materials and MaterialPasses are a delta-diff from the base material which greatly saves memory.
In addition to this, property types are no longer stored in a Variant (which would greatly waste memory, a boolean property would take the same space as a 4x4 matrix!), and Material property accesses have been optimised to improve performance.
.FNT font loading has been refactored to be blazingly fast. Previously loading fonts would stall the Dreamcast for a second or two, but now it's near instantaneous!
You can now check if an input axis was activated or deactivated during the last frame by calling input->axis_was_pressed("...")
or input->axis_was_released("...")
. This removes some of the boilerplate needed when doing one-off checks for in-game menus, or weapons firing etc.
Simulant now uses SDL's desktop scaling flags if supported. Also the platform
classes have gained a native_resolution()
function which will tell you what the native resolution of the platform is.
Simulant is now using the last Bounce physics engine available before it was taken offline. The Simulant community is now maintaining a fork of the project in its community GitLab group, which will be used to fix bugs etc. going forward.
Previously texture uploads would always happen just before the render pipeline was processed - this was problematic if you were loading a lot of textures into RAM in a single frame. Now textures have a "flush" method which will force the renderer to upload the texture to VRAM and free the memory (if that's the configuration).
All built-in texture map properties now have a default texture, this differs depending on which map property it is, diffuse_map for example has an all-white texture. This creates consistency across renderers when accessing textures that haven't been explicitly bound.
Also, the s_texturing_enabled
material property has been changed to s_textures_enabled
and is now a bitmask of enabled texture maps, so you can for example turn on diffuse_map and light_map, but leave normal_map disabled etc.
There have been a lot of fixes to the threading subsystem. The Dreamcast platform no-longer uses pthread and instead uses native threading primitives.
The old L_
prefixed logging macros have been replaced by S_
prefixed macros which take printf style variadic arguments, placeholders still follow the {0}
, {1}
format.
Logging in release mode no longer outputs the file and line of the logging statement.
Streaming .OGG files no longer maintains the whole file in memory, and instead a persistent file buffer is used.
Huge thanks to all the contributors this quarter, but particularly to @freakdave who has contributed the most beautiful demo to the samples folder (seen above). Thank you!
Happy Holidays!
For an early Christmas present, I've just tagged version 20.12 of the Simulant game engine!
It's been a pretty quiet release cycle - there's been a lot going on in the world recently! However, there are still some really neat changes in this release!
Coroutines landed a while back, but the API for using them was clunky and unfamiliar. In 20.12 we've added familiarly-named functions to manage coroutines: cr_async
, cr_await
and cr_yield
.
cr_async
also now returns a CRPromise<T>
which has a convenient then()
method for triggering events once the coroutine has completed. This is great for scheduling game logic to run sequentially, and is a bit more elegant than using idle tasks.
MS3D support landed in 20.09, but it wasn't fully compatible with the Dreamcast port and caused unaligned read crashes if you tried to use it there. This has now been fixed and MS3D models can be used on the Dreamcast.
Firstly, scene management function names have been cleaned up. You can now preload
a scene, before activation or, you can preload_in_background
to do so in a coroutine. Utilizing the .then()
pattern can allow you to preload in the background, then activate a scene once done - which is great for loading screens.
On top of that preload
, preload_in_background
, and activate
accept arbitrary variadic arguments which are accessible in your scene's load method. This allows you to have one scene class, but pass flags to it on activation to alter its state. For example, you could pass the filename to a level file, or enable an "arcade" mode etc.
There have also been an array of bug fixes, including numerous sound bugs (including fixing garbled stereo sound) and problems with frustum culling!
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?
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!
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!
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.
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!
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.
Along with those new features there are a number of bug fixes and minor changes, including:
new_submesh_as_capsule
methodThings that are lined up for next release include:
Have fun!
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 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.
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.
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.
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.
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.
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.
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.
Too many to mention, but here are the hightlights
... and many many more!
Special thanks go to Charlotte Koch and David Reichelt for their contributions this cycle!
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?
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!
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:
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:
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!
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.
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
Simulant is very much under development, so pay attention to the following caveats:
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:
For more information, take a look at the licensing page