This Week in Fyrox #1

This post starts a series of weekly progress reports in development of Fyrox Game Engine. Fyrox is a Rust game engine with lots of out-of-box game-ready features and a full-featured editor. This progress report is a bit special, because it will cover everything that happened in the engine from the previous major release (opens new window) which happened almost 4 weeks ago. You can consider this post as a monthly progress report if you like. The list of changes is quite big, so let's get started.

# Node Selector Widget

node selector

Node selector helps you to select a node in scene, it could be a node for Handle<Node> fields in your script, or a node for some further actions (see below). You can find a node by its name, confirm or cancel selection via respective buttons.

# Property Selector Widget

property selector

Property selector allows you to select a property path from any object that implements Reflect trait, it's main usage is in new animation editor. The path then can be used to set a new value for a property the path leads to. The selector allows you to find a property by its name, config or cancel selection via respective buttons.

# Animation System Improvements

For a long time, animation system in the engine was capable to animate only position, rotation, and scale of scene nodes. Now its changed - you can animate pretty much any numeric property using a functional curve to describe complex laws of change for the property. Such functionality is done via reflection. To be efficient, the engine uses special bindings for position, rotation, and scale.

As part of the animation system improvements, new Animation asset was added. It contains list of tracks that are bound to some properties of a specific set of scene nodes.

The animation system will be improved/changed some more to work seamlessly with the new animation editor (see below).

# Animation Editor

animation editor

Fyrox 0.29 will have its own animation editor, that will help you to animate arbitrary numeric properties of scene nodes, including data in scripts. The screenshot above shows its current state, it is far from completion, but it already has basic functionality. On the left side there is a list of tracks, each track represents animation of a single property (it could position, rotation, scale or any arbitrary numeric property). On the right side there is a curve editor that shows how the value change over time.

# Sprite Sheet Editor

sprite sheet editor

Sprite sheet editor should help you to select desired frames for animation based on a series of frames, packed into a single texture. Such animations are used in many 2D games, they're very cheap and quite easy to create.

In action the editor looks like so:

sprite sheet editor in action

# Scene Settings

scene settings

It is now possible to edit scene settings, which includes physics (2D and 3D) integration parameters, ambient lighting color, whether the scene is enabled or not and some more.

# Validation

validation

The engine now validates scene nodes for invalid uses, it checks for most common mistakes, like:

  • Using a rigid body without a collider and vice versa.
  • Using a joint with invalid attached bodies (or not set).

validation in action

The list of check will be improved in the future, currently it should help you to use the engine is a correct way.

# Reflection

Inspect trait's functionality was merged into Reflect trait, it is now possible to query fields metadata while iterating over its fields:

use fyrox::core::reflect::prelude::*;

#[derive(Reflect)]
struct Foo {
    #[reflect(
        description = "A bar property. This attribute will be show in tooltip for the property in the Inspector",
        display_name = "Hello",
        min_value = 0.0,
        max_value = 100.0
    )]
    bar: u32,
    #[reflect(description = "Some other property.")]
    baz: String,
}

fn iterate_properties() {
    let foo = Foo {
        bar: 0,
        baz: "".to_owned(),
    };

    for (field, field_info) in foo.fields().iter().zip(foo.fields_info()) {
        println!(
            "Field name: {}\nDescription: {}\nValue: {:?}",
            field_info.name, field_info.description, field
        )
    }
}

# Book

The book has some improvements as well - the main one is a chapter about camera picking (opens new window) (a way to select an object by mouse in a scene).

# Full List of Changes in Random Order

  • Fixed potential crash when joint was initialized earlier than connected rigid bodies.
  • Model instantiation scaling now used for prefab preview.
  • Fixed lots of potential sources of panic in perspective and ortho projections.
  • Fixed editor's camera movement speed setting for 3D mode.
  • Standard "two-side" shader - useful for foliage and grass (kudos to IceGuye (opens new window)).
  • Sprite sheet editor
  • Support for Vector(2/3/4)<f32/f64/u8/i8/u16/i16/u32/i32/u64/i64> types in serializer.
  • Sprite sheet animation now uses frames coordinates instead of explicit uv rectangles for each frame.
  • Sprite sheet animation now has a texture associated with it.
  • Fixed reflection fallback in case of missing field setter.
  • Ability to set uv rect for Image widget
  • Scene settings window for the editor - gives you an ability to edit scene settings: change physics integration parameters, ambient lighting color, various flags, etc.
  • Prevent crash when adding a new surface to a Mesh node in the editor
  • Fixed directory/file duplicates in file browser widget when double-clicking on an item.
  • Show use count for materials in Inspector
  • Replace Arc<Mutex<Material>> with SharedMaterial new-type.
  • Ability to assign a unique copy of a material to an object.
  • Replace Arc<Mutex<Material>> with SurfaceSharedData
  • Clear collections before deserialization
  • Property inheritance for collections
  • Fixed incorrect material replacement when loading a scene with an FBX with custom materials.
  • Added Blender material slots names in FBX loader
  • Access to procedural flag for SurfaceData
  • Ability to set penalty for vertices in A* pathfinder (kudos to Cordain (opens new window))
  • Property editor for mesh's surface data.
  • Validation for scene nodes
    • Helps to find invalid cases like:
    • Missing joint bodies or invalid types of bodies (i.e. use 2d rigid body for 3d joint)
    • Wrongly attached colliders (not being a child of a rigid body)
    • Shows small exclamation mark if there's something wrong with a node
  • Share tooltip across widgets on clone
  • Fixed color picker: brightness-saturation grid wasn't visible
  • Added support for Collider intersection check (kudos to ThomasHauth (opens new window))
  • Animation resource.
  • Animation system refactoring
    • Use curves for numeric properties.
    • Ability to animate arbitrary numeric properties via reflection.
  • Prevent crash in case of invalid node handle in animation
  • Curve::value_at optimization - 2x performance improvement of using binary search for spans.
  • Curve::add_key optimized insertion using binary search.
  • Node Selector widget - allows you to pick a node from a scene.
  • Merge Inspect trait functionality into Reflect trait - it is now possible to obtain fields metadata while iterating over them.
  • Property Selector widget - allows you to pick a property path from an object that supports Reflect trait.
  • Reflect implementation for Uuid
  • fyrox::gui::utils::make_cross - small helper to create a vector image of a cross
  • FieldInfo::type_name - allows to get type name of a field without using unstable std::any::type_name_of_val

# Support

If you want to support the development of the project, click one of the links below. Preferable way is to use Boosty (opens new window) - this way the money will be available for the development immediately. Alternatively you can can use Patreon (opens new window), but in this case the money will be on-hold for unknown period of time (details are here (opens new window)).

Also, you can help by fixing one of the "good first issues" (opens new window), adding a desired feature to the engine, or making a contribution to the book (opens new window)

Fyrox Engine 2019 - 2024