3Ducttapes(); Yvo von Berg | CG Toolsmith blog | C++, Python

Tycoon UE4 Closed beta!

Closed beta launch!

Hey guys, finally managed to build a version that I can ship!

Check it out: http://cgtoolsmith.com/tycoon

I’m looking for beta testers for my new plugin so I can make the product better. I’m announcing the closed beta today.

Beta tester? Do you use Unreal Engine? Are you interested in testing a cool new geometry tool for free?

Register here: Tycoon Service Center

Have a look at the docs: Docs Currently Unreal Engine 4.23 only.

Thank you!

Tycoon

Tycoon C++ UI update and animation tests

Slate UI

Recently did a very first user test. I’ve decided to rebuild most of the UI to make it more artist friendly. Here is the new prototype. With a focus on sliders. Was quite a bit of work, but learned a lot about the UE4 Slate framework.

Animation blueprints

Started to build an animation system for the trains.

I’ve learned that if you use ‘BlueprintCallable’ you can expose C++ methods directly to blueprint nodes. However I had to change the plugin type from ‘Editor’ to ‘Runtime’. Which makes sense because my animation system would run at runtime. :)

I currently have the following methods:

  • TycoonSwitchTrain: Sets the active train to use, to control the carts (child actors), I call GetAttachedActors() on the main train actor.
  • TycoonChangeSpeed
  • TycoonStartAnimation
  • TycoonChangeCartOffset: Each train has an offset on the track.
  UFUNCTION(BlueprintCallable, Category = TycoonConfig)
    void TycoonChangeCartOffset(int32 value);

Tycoon C++ Track presets

Track presets

  • Testing partial track presets, so you can quickly place your favorite loopings. Currently set to work with a specific track length only.

Regenerating Normals and Tangents after deformation

  • I have to update the normals and tangents after deforming the track piece, this process can be slow on larger meshes. To solve this I run the normal generation as an Unreal background task: https://wiki.unrealengine.com/Using_AsyncTasks

It is only possible to update geometry on the main game thread, so I cache all the generated values and re-run the update on the game thread every few seconds. The result is a nice streamlined workflow where the normals catchup quickly after adding some pieces.

  // Generate normals
  (new FAutoDeleteAsyncTask<TangentCalculationAsyncTask>(
    NewPiece
    )
    )->StartBackgroundTask();

Tycoon C++ Track adjustments

Track adjustment tools

I’m testing some tools to adjust the track after it has been built. I’m basically changing the cached angle value of a specific piece. I’m hoping I can extend this functionality to implement some sort of ‘autocomplete’ feature.

  • Change single piece and update entire track.
  • ‘Auto adjust’: Change single piece, and try to align back to original track.

Tycoon C++ UI updates

UI cleanup

I just finished another pass on the UI for Tycoon. Most of the options are now persistent, when drawing the UI I lookup the previous values from the current tycoon collection actor.

I have also added actor inputs to my slate UI, these were tricky to find in the Unreal documentation, here is an example on how to use them:

SObjectPropertyEntryBox

    [
        SAssignNew(MainMeshInputWidget, SObjectPropertyEntryBox)
        // Only allow and show these object types
        .AllowedClass(UStaticMesh::StaticClass())

        // The Unreal UAsset path e.g. '/game/mesh/cube.cube'
        // This is the actual value that the field saves
        .ObjectPath(this, &FTycoonToolEdModeToolkit::GetPathMain)

        //  Whether the asset can be 'None' 
        .AllowClear(true)

        // Callback changing the asset, 
        // you can lookup the AssetData from the selected asset here.
        .OnObjectChanged(
            this, 
            &FTycoonToolEdModeToolkit::ChangeAssetDataMain
        )
    ]

New UI, I have used this great app to create the wireframe: whimsical

demo

Reload fixes

  • Tycoon will now remember the position and rotation of the first piece so it doesn’t reset back to the origin when you reload.
  • You can now place different meshes in the track while building.

Attachment features

  • Enable/Disable attachments for different sections of the track.
  • Control the minimum ground height.
  • Amount of pillars for each piece.
  • Control the local offset of each row.
  • Switch between attachment calculation from the track piece down or from the ground up until the system reaches the track piece.
  • Tycoon will generate a normal Unreal spline from the entire track, I’m planning on creating some Unreal blueprints or Houdini engine examples on how you can fully customize the attachments.

I’m currently thinking of ways on how I can make the building more dynamic, so stay tuned.