Serialization, reflection, and other mechanisms are often used for saving data in an editor or a tool like the asset pipeline, and then loading that data into the engine at run-time. This process is well-known, flexible, and allows us to store the data in any format conceivable. Still, all those techniques show certain weaknesses when it comes to keeping iteration times to an absolute minimum.
Author Archives: Stefan Reinalter
Translating a human-readable JSON-like data format into C++ structs
Even though Molecule’s run-time engine exclusively uses binary files without doing any parsing, the asset pipeline uses a human-readable non-binary format for storing pretty much everything except raw asset files like textures or models. This post explains the process behind translating data from such a human-readable format into actual instances of C++ structs with very little setup code required.
Continue reading
Implementing a semi-automatic structure-of-arrays data container
In performance-sensitive applications like games it is crucial to access data in a cache-friendly manner. Especially when dealing with a large number of objects of the same type, e.g. individual components in an entity-component-architecture, we should make sure to read as little data as possible. However, simple arrays-of-structures are often not suited for this, with structures-of-arrays yielding better performance. But the latter are not natively supported by the C++ language.
Using runtime-compiled C++ code as a scripting language
Today’s post is less of an insight into how Molecule works, and more of an announcement about an upcoming feature we are very proud of!
Molecule Engine’s scripting system uses runtime-compiled C++ code as a scripting language, and you can see the system in action here (please make sure to watch the video in original quality).
This allows the engine to leverage the full performance potential of native C++ code, while providing designers and scripters with extremely short iteration times, commonly only experienced when using traditional scripting languages such as lua, python, or others.
Scripters won’t have to deal with internal engine details, and don’t need to worry about pointers or other low-level language stuff. They only work with a pure C-interface and opaque structs, as can be seen in the video. But programmers can easily dive in and feel right at home with the whole engine available to them in native C++-code.
Furthermore, programmers can aid scripters easily by using their favourite debuggers and IDEs for debugging and development. Scripters will love certain IDE features such as IntelliSense, completion listboxes, and other things a modern IDE provides!
Let us know what you think in the comments!
Adventures in data-oriented design – Part 4: Skinning it to 11
Having finished the third part of this series about data ownership, we will turn our attention to performance optimizations and data layout again in this post. More specifically, we will detail how character skinning can be optimized with a few simple code and data changes.
Adventures in data-oriented design – Part 3c: External References
In the last installment of this series, we talked about handles/internal references in the Molecule Engine, and discussed their advantages over raw pointers and plain indices.
In a nutshell, handles are able to detect double-deletes, accesses to freed data, and cannot be accidentally freed – please read the previous blog post for all the details.
A faster quaternion-vector multiplication
Today’s post is only a small gem I accidentally came across while I was looking for something entirely different: a faster method of multiplying a quaternion by a vector. Continue reading
Adventures in data-oriented design – Part 3b: Internal References
As promised in the last blog post, today we are going to take a look at how Molecule handles internal references to data owned by some other system in the engine.
Adventures in data-oriented design – Part 3a: Ownership
One thing I have noticed during the development of the Molecule Engine, is that defining clear ownership over data can tremendously help with following a data-oriented design approach, and vice versa.
Input Evaluation SDK available for download
I’m proud to announce that the first evaluation SDK for our input technology is now available! A new version of the core technology has also been released, with some minor additions and improvements.
Check out www.molecular-matters.com for more information on the input library. Further SDKs will follow during the next few months.
Adventures in data-oriented design – Part 2: Hierarchical data
One task that is pretty common in game development is to transform data according to some sort of hierarchical layout. Today, we want to take a look at probably the most well-known example of such a task: transforming joints according to a skeleton hierarchy.
Memory allocation strategies: a growing stack-like (LIFO) allocator
Continuing from where we left of last time, I would like to discuss how we can build growing allocators using a virtual memory system. This post describes how to build a stack-like allocator that can automatically grow up to a given maximum size.
Game Connection Paris 2012 slides
The slides for both the master class and the session I held at the Game Connection in Paris are now available:
Master class: Memory Management Strategies (PPT, PDF).
Session: Debugging memory stomps and other atrocities (PPT, PDF).
A big “Thank you!” to all the people who attended, I really enjoyed working with you. Looking forward to seeing some of you again next year!
Core Evaluation SDK available for download
After lots of work I’m proud to finally announce that the first evaluation SDK for our core technology is now available!
Check out www.molecular-matters.com for more information on the core library. Further SDKs will follow during the next few months.
Join my master class at Game Connection Paris
I’m happy to announce that I’ll be holding a master class about memory management strategies at Game Connection, which will take place Nov. 28-30 in Paris. In this 7h master class we will discuss a wealth of different topics regarding memory management, and take a much more detailed look at things I’ve written about in my blog. I’ll try to create a good mixture between technical details and practice sessions.
I’ll also be giving a talk about debugging memory stomps on the following day.
It would be a pleasure to meet up with some of you there!
Memory allocation strategies interlude: virtual memory
Before we can delve into the inner workings of growing allocators, I would like to explain the concept of virtual memory and discuss what it is, why it is needed, and what we can use it for.
Continue reading
Memory allocation strategies: a pool allocator
As promised last time, today we will see how pool allocators can help with allocating/freeing allocations of a certain size, in any order, in O(1) time.
Memory allocation strategies: a stack-like (LIFO) allocator
Last time, we were looking at a linear allocator, probably the simplest of all memory allocators. This time, we will detail how to implement a non-growing stack-like allocator, along with conventional use-cases.
Memory allocation strategies: a linear allocator
During the next few weeks, I’d like to detail how the memory allocators inside Molecule work, starting with a simple, non-growing linear allocator today in order to cover some base first.
Building a load-balanced task scheduler – Part 4: False sharing
Even though a task scheduler can help with alleviating the burden of having to distribute small pieces of work to different threads, it cannot help preventing a few issues common in multi-threaded programming, especially in multi-processor environments.