The Machinery Beta — December 2020 (version 2020.12)

Happy holidays! Here at Our Machinery, we’re taking some well-earned time off. Hope you have the opportunity to do the same! Our gift to you is a new beta release version. If you have a chance, take some time and check it out over the holidays. Hopefully, it’s all you wished for.

If you are already running The Machinery, this new release should pop up in your Downloads tab. Otherwise, get it from our beta download page and have a look at this quick introduction video. If you find bugs in this release or have requests for specific features, post them to our issue tracker. For more general discussions, hit us up on the forum or Discord.

Key highlights in this release are:

As always, we also have a number of smaller updates.

Online API Documentation

The API documentation for The Machinery is now available online as well as in the beta download package. You find it online at http://www.ourmachinery.com/apidoc/apidoc.html

In addition, the documentation has been enhanced with a number of new features:

  • We’ve split it up into individual files that load and render faster.
  • We’ve added a Sublime Text-style fuzzy search field that lets you quickly find what you are looking for.
  • There’s also a comment section for asking questions and suggesting improvements.

Online API documentation.

You need an Our Machinery account to access the documentation. If you have downloaded the Beta, you already have one. Otherwise, don’t worry, it’s quick and free to sign up. And it’s totally fine to set up an account just to look at our API.

Plugin Assets

Plugins can now live as assets in a project. To add a plugin, use “Import…” and point to a DLL built for The Machinery:

A plugin asset and a custom tab from that plugin.

Every time you open a project that has a plugin asset, its code will be loaded into The Machinery and when you close the project, the code will be unloaded.

Note: Just as when you put a plugin in the plugins folder, plugins are only loaded if their names start with tm_ (marking them as The Machinery plugins). You can add plugins that are not The Machinery plugins in the same way. This can be useful if your plugins have other (non-machinery) plugins that they depend on.

Putting plugins in a project as opposed to putting them in The Machinery’s plugins directory can be useful if you have plugins that only one specific project depends on.

If you check the ☒ Import when changed checkbox, The Machinery will re-import and reload the plugin every time it detects a change. You can use this to hot-reload your project plugins.

Note that since The Machinery APIs change with each release version, a plugin DLL built for one specific version is unlikely to work with another version. Thus, to open a project with plugin DLLs, you should make sure that your version matches the version the DLL was built for. In the future, when The Machinery is out of beta, we will provide more stable APIs that will work across multiple releases.

Also, note that plugins aren’t sandboxed. You should take the same precautions when running a plugin as when running an executable.

The gameplay samples now store the plugins containing their specific gameplay code as plugin assets. We ship these samples with their gameplay source code, so you can modify it and update the DLL of the project’s plugin asset.

Since the beginning, The Machinery has had two components for controlling an entity’s position, the Transform Component (which just held the position) and the Link Component (which allowed for hierarchical linking to parent entities).

This was always a source of confusion among our users — why do they have to know about two different transform components — and in this release we’ve finally decided to address it.

The Link and Transform components have now been merged and there is now only a single Transform component. Your old projects will automatically be migrated to this new format when you open them, let us know if there are any issues with the migration.

The functions that used to be in tm_link_component_api are now found in tm_transform_component_api and some have been renamed for the sake of clarity. We’ve also added functions for easily accessing position, rotation and scale as well as shorthand macros called tm_get_position(), tm_set_position(), etc.

Gameplay APIs and Simulate Entry

This version does two major changes to how you write code that executes while your project is in simulate mode — that is when it is running in Simulate Tab or when you’re running a published project.

First off, we decided to remove tm_gameplay_api. This API previously contained functions for managing transforms, tags, physics collision types, and finding assets. However, it didn’t really add anything new, it just wrapped other APIs, although sometimes presented in a simplified manner. This mostly just confused users, since there seemed to be multiple APIs that did similar things. Now we instead provide equally user-friendly functions in our standard APIs, largely thanks to the merge of the Link and Transform component.

If you are migrating a project that used tm_gameplay_api, then use these replacement APIs:

  • Managing Transforms: tm_transform_component_api (there are shorthand macros at the bottom of transform_component.h)
  • Managing Tags: tm_tag_component_api
  • Finding Physics Collision Types: tm_physics_collision_api
  • Getting assets: tm_the_truth_assets_api->asset_object_from_path

The gameplay samples use these APIs now.

Secondly, we have introduced a new way of entering into gameplay code. We call this Simulate Entry. Defined in simulate_entry.h, there is a new interface tm_simulate_entry_i. The user can provide implementations of this interface in their plugin. The interface has a start, stop and tick function, which will be run when the simulation starts, stops, and once per frame respectively. In other words, this provides a “main point of entry” for your gameplay code, sort of like the “main file” of a C program.

Register an implementation of tm_simulate_entry_i on the interface TM_SIMULATE_ENTRY_INTERFACE_NAME. Then open The Machinery and, inside your project, create a new Simulate Entry asset. If you’ve registered your implementation correctly, it will be possible to choose from a dropdown within the Simulate Entry asset’s properties.

Now, when you simulate an entity (either by opening it in the Simulate Tab or publishing your project), the simulation will look in the directory next to the entity for a Simulate Entry asset and, if found, use the referenced tm_simulate_entry_i to enter into your code. If it doesn’t find one in the directory of the asset, it will look in each parent directory for one. This makes it possible to put a “catch-all” Simulate Entry in your root folder. You can also have levels in different directories with a Simulate Entry asset in each directory, making it possible to enter into different simulate code depending on which entity you simulate.

The gameplay samples have been migrated to use tm_simulate_entry_i.

A new sample called gameplay-interaction-system. It utilizes all the APIs that replace tm_gameplay_api as well as the Simulate Entry mechanism.


Core

  • Fixed function signatures that were incorrectly set to () when they should be (void).
  • Faster startup time for The Machinery.
  • Improved the loading speed for DLLs in --hot-reload mode. In fact, it is now so fast that we’ve turned --hot-reload on by default. There is a --no-hot-reload flag if you for some reason want to disable hot-reloading.
  • Faster loading of big binary projects.
  • Fix for error in UTF-16 surrogate pair handling. [#372]
  • Ability to boot the machinery in Safe Mode by passing a --safe-mode flag or holding F8 during boot. This lets you recover from situations where The Machinery is crashing at bootup because it’s trying to load a broken project or settings file. [#361]
  • Fix for a bug that could cause corrupt project files when saving. [#363]
  • Fix for TM_STATIC_HASH() not working near EOF. [#358]
  • Fix for The Truth reporting errors about tm_rotation when it should have reported that the application was trying to get a property from a NULL object.

Entities

  • Fix for infinite recursion in the Entity Graph when an entity spawns another copy of itself. [#361]
  • Added the ability to query the debug name from a scene tree node.

Plugins

  • When creating a plugin using File > New Plugin…, the plugin now comes with a build.bat file for quickly getting up and running.

Samples

  • A new sample called gameplay-interaction-system has been added. It shows how to set up a small game with a custom component called Interactable Component. It makes it possible to create levers, buttons, and rotating doors within the editor.

Animation

  • Fix for simple animation not stopping when changed to (None). [#349]

Physics

  • Physics visualization parameters can now be controlled in detail.
  • Fix for the computation of the inertia tensor — should be computed in local space.

Asset Browser

  • Entities now have the same icons in the Asset Browser as in the Entity Tree.
  • Asset and directory icons now have different colors, increasing readability.
  • Assets can be filtered by file extension.
  • Added support for list, grid, and detail view.
  • Sorting of assets by name, size, and file extension is now possible in the detail view.
  • Drag and drop import of zip, 7zip, and tar archives is possible.
  • The folder tree view now shows the correct folder when navigating.

UI

  • Fix for a crash when closing the Import Project tab.
  • Fix for keyboard not working in the Entity Tree after using the main menu.
  • Views added with Add View are now focused.
  • Better profiling of jobs.
  • The Settings tab now automatically starts as pinned.
  • The editor UI now runs multi-threaded with each tab in the UI being rendered as a separate job. If you have a multi-core machine, you should see a significant reduction in the time spent rendering the UI.
  • The entity picker now adds additional grayed out context to distinguish entities with the same name.
  • Fix for grid color not changing when altered through themes.
  • Implemented custom resize borders.
  • Added a small caption bar to the window when in Focus mode.
  • Disabled keyboard shortcuts in the Entity Tree when renaming an entity or when a context menu is open.
  • Project loading is now done asynchronously in the background: a modal dialog gives you the opportunity to cancel the load.

Import and Content Pipeline

  • When you drop a DCC asset into the scene, it now automatically rigs it in the same way as if you had clicked “Import Assets” within the DCC asset’s property panel. There is an option available in the Import Settings that enables automatic creation of entity prototypes when such a drop occurs.
  • There are now Import Settings available for specifying in which directory entities rigged from DCC assets should end up.
  • Undo support for import of entities and resources from DCC assets.
  • Fix for a crash if multiple files were imported simultaneously.
  • Support for zip, 7zip, and tar archives when importing assets via the Import Assets button.

Entity Graph

  • Inputs and outputs in graphs are now editable from within the Input or Output node. They can be edited, removed, and re-ordered. The editing of inputs and outputs inside the property panel has also been improved.
  • Fix for a bug where a graph stops working after an inherited subgraph node is overridden.
  • Fix for a crash if the Draw Call node was wired with incorrect data. [#359]
  • Fix for Get Velocity and Set Velocity nodes not working.
  • Added Lerp nodes for float, vector types, and quaternion.
  • Added Grid node for basic 3D looping control flow.
  • Added Set Light node, allowing you to change light parameters from the entity graph.
  • Added full vertex color support to creation graph, lit, and unlit nodes.

Rendering

  • Added various validation checks to improve debugging.
  • Added debug names to almost every graphics resource, use --vulkan-validation to enable these for graphics debugging.
  • Added extensive reference documentation for the .shader files in docs/.
  • Preparations for moving The Machinery to use a “full bindless” model for resource binding is done. An error will be printed in case your GPU lacks support for it, please notify us if you see it.
  • Selection outlines are now rendered before gizmos.
  • Report printing any leaked GPU resources on shutdown of The Machinery.
  • A lot of naming cleanups for consistency and readability in the renderer plugin and APIs.
  • “Additional image views” is now its own resource.
  • Thread-safety fix in DXC compiler wrapper.

Creation Graph

  • Render Pass now supports specifying load operation to use when binding its render targets.
  • Triggering execution of a Render Pass from an event can now be done by using the new Render Pass Event node.
  • Create GPU Image node can now be configured to be Instantiated per graph instanced or run in Shared mode (default).
  • The output of a Create GPU Image node can now be consumed by any shader stage, not just pixel shaders.
  • Vertex colors are now supported in dcc-material.
  • A Physics Shape Output node has been added and has been added to dcc-mesh.

Project Management

  • If there were multiple windows present on shutdown, they will now be all restored on startup.
  • The project state is now restored when recovering from a crash or opening a specific project from the command line as well.

2020.12.a Hotfix

  • Fix for Runner not loading plugins from Plugin Assets.
  • Fix for crash when selecting Change View in a tab’s context menu.
  • Help menu now links to API documentation.
  • Fix for Import Project crash. [#437]
  • Fix for copy pasting from a closed project. [#429]
  • Fix for crash when showing modal dialogs.