Skip to main content

Post Processing

Errant Biomes allows you to run your Blueprint or C++ code on offline spawned instances.

It allows you to define additional logic to change where to spawn instances and what assets to use.

Species Setup

Post processes are added in the Post Processes list property in the species.

There you select the class of the post process to be used. You'll be able to set properties of that class object. You can have multiple post processes in the same species.

species post process property

Blueprint Setup

Blueprint functions are a lot slower than built-in Errant Biomes operations and slower than C++ post-processes

So use it with that in mind.

It can be a good place to experiment and then rewrite as C++ post-process.

If possible it's best to use functionality that comes in species itself.

When the post process is used Errant Biomes will output its duration to the Output Log with messages like:

LogBiomes: Post-processing for species ES_PP took 0.000546 seconds

Check that to know if the solution is performant enough for your needs.

You can create your blueprint post process by creating a class based on BiomesInstancesPostProcessBlueprintSimple

There you need to override the Process Instance function.

Here's an example of a simple blueprint graph that would add an offset to each instance. While not useful on its own as it's better to use offset property in the species it shows how to access the transforms.

Note that the Asset input is by ref input.

So it's an input and output at the same time. Allowing you to change what asset is being spawned.

Like this:

Here's the setup from the line-traced water lilies example:

C++ setup

To create a C++ class that works on Errant Biomes instances you need to inherit the BiomesInstancesPostProcess class and override the Process Instances method.

There you are given a map of FSoftObjectPath that contains an asset that will be spawned to TArray<FTransform> which contains all the transforms generated for that asset.

You can change, remove or add assets and/or transforms for each of those assets.

This class is found in the ErrantBiomesEditor module, which is editor-only

Here's a simple example that just adds an offset to each instance

#pragma once

#include "BiomesInstancesPostProcess.h"

#include "MyBiomesPostProcess.generated.h"

UCLASS()
class UMyBiomesPostProcess : public UBiomesInstancesPostProcess
{
GENERATED_BODY()
public:
virtual void ProcessInstances(
UWorld& World,
const TSoftObjectPtr<UBiomesSpecies>& Species,
const FTransform& InstanceToWorld,
TMap<FSoftObjectPath, TArray<FTransform>>& AssetToInstances) override
{
for (auto& [AssetPath, Transforms] : AssetToInstances)
{
for (FTransform& Transform : Transforms)
{
Transform.AddToTranslation(FVector(0, 0, 200));
}
}
}
};