Page MenuHomeAnticto

Mutable for Unreal Engine 4 | Technical documentation
Updated 664 Days AgoPublic

Version 2 of 66: You are viewing an older version of this document, as it appeared on Mar 26 2020, 9:42 AM.

Integrating

Engine Changes

In most versions of Mutable, some changes in the Unreal Engine codebase are required in order to improve the performance. These are modifications that cannot be implemented through plugins. In some platforms like Windows, Mutable will still work without the engine changes, but it may have lower performance and some editor features may be disabled, like automatic compilation of models when packaging.

The engine modifications are distributed through a patch file that you can find with every release of the plugin. In order to apply the patch you can use standard tools like TODO.

Compilation warnings

The patch with engine changes includes some helpers to try to detect if any modification is missing. If these warnings are visible it is a sign that some of the changes have not been applied, or may have been overwritten by other changes or merges.

These are for the runtime:

#define ANTICTO_MUTABLE_ENGINE_PATCH_TEXTURESTREAMING
#define ANTICTO_MUTABLE_ENGINE_PATCH_VERTEXBUFFERS
#define ANTICTO_MUTABLE_ENGINE_PATCH_MORPHTARGETVERTEX

These are for the editor:

#define ANTICTO_MUTABLE_ENGINE_PATCH_COOKHOOK

You don't have to manually use these defines but if they are not present, the plugin will show warnings at compile time.

Please note that these are just simple preprocessor defines, so they do not guarantee that the actual changes are present, but capture most error cases.

Performance tuning

Statistics widget

A good starting point to see the performance of Mutable in your game, is to use the provided statistics UMG widget. You can find it in the plugin Content folder with the name UI/MutableStats.

imatge.png (535×1 px, 469 KB)

If your project is not using UMG you can access this statistics and log them or display them from the central singleton object UCustomizableObjectSystem. These are some of the relevant methods:


	// Get the singleton object. It will be created if it doesn't exist yet.
	UFUNCTION(BlueprintCallable, BlueprintPure, Category = Status)
	static UCustomizableObjectSystem* GetInstance();

	// Find out if the performance engine patches have been applied
	UFUNCTION(BlueprintCallable, Category = Status)
	bool AreEnginePatchesPresent() const;

	// Find out the version of the plugin
	UFUNCTION(BlueprintCallable, Category = Status)
	FString GetPluginVersion() const;

	// Get the number of instances built and alive.
	UFUNCTION(BlueprintCallable, Category = Status)
	int32 GetNumInstances() const;

	// Get the number of instances waiting to be updated.
	UFUNCTION(BlueprintCallable, Category = Status)
	int32 GetNumPendingInstances() const;

	// Get the total number of instances includingbuilt and not built.
	UFUNCTION(BlueprintCallable, Category = Status)
	int32 GetTotalInstances() const;

	// Get the amount of memory in use for textures generated by mutable.
	UFUNCTION(BlueprintCallable, Category = Status)
	int64 GetTextureMemoryUsed() const;

	// Return the average build/update time of an instance in ms.
	UFUNCTION(BlueprintCallable, Category = Status)
	int32 GetAverageBuildTime() const;
Last Author
jordi
Last Edited
Mar 26 2020, 9:42 AM

Event Timeline

jordi edited the content of this document. (Show Details)
alexei edited the content of this document. (Show Details)
alexei published a new version of this document.
alexei published a new version of this document.May 21 2020, 12:51 PM
jordi changed the visibility from "All Users" to "Public (No Login Required)".May 26 2020, 12:04 PM
pere published a new version of this document.
alexei edited the content of this document. (Show Details)
alexei published a new version of this document.
pere published a new version of this document.
gerard published a new version of this document.Oct 8 2021, 4:07 PM
gerard edited the content of this document. (Show Details)