1. First Steps - Theuntextured/AsyncConveyorPlugin GitHub Wiki
After downloading and adding the plugin to the desired project, the first step will be to create a ConveyorManager blueprint class.
Conveyor Manager
Functions to override
Inside, there will be two functions which are to override:
- Handle Dropped Items
- Get Item Visual Info
Get Item Visual Info (Previously "Get Item Mesh")
Below is an example implementation of Get Item Visual Info:
The function should return the desired static mesh which will be used as a visual for a specific item while on conveyors.
The "Transformation" return value is the added local transform of each instance (for example to scale down the mesh).
"Materials" is an optional return value. It will not override any material if empty. Leaving an index empty will skip the material.
In the above example, item information is stored as a structure. Each structure is assigned to a Name which can be accessed through a data table.
Handle Dropped Items
Handle Dropped Items is an event (no return values) which will run every time one or mode items are dropped from conveyors, which can happen when a conveyor is removed while it has items on it, or (togglable) when an item has reached the end of a conveyor. The event will input an array of dropped items, which include the item struct, and the location where they were dropped.
An example of how to use this event is to spawn the items at the location of their drops, by getting the items via a data table (method shown above). In the showcase example, I simply caused a string to be printed displaying the name of the item dropped and its location. However, the data table method is shown below (I have added a member to the item structure to represent the class associated with the item).
Variables
There are also several variables which can be changed:
- Draw Debug Shapes can be used for debugging the conveyor network (careful: not async and it will slow down the game a lot on large networks).
This can also be enabled with the console command
debug.Conveyor 1ordebug.Conveyor 2.
0: Disable drawing debug information.
1: Enable drawing debug information within cull distance to the player character. (NOT the editor camera)
2: Draw all debug information. (Enabling the option in the Conveyor Manager actor will be equivalent to this)
- Max Cycle Steps is the maximum number of steps per frame which an item can take. (Suggested to be left to default)
- Vector Tolerance is the maximum distance for nodes in different conveyors to be connected. It also affects the maximum distance for splines to be assigned to nodes. (Recommendation is to leave this set to 1. Very low values will cause unexpected behavior when moving away from the world origin)
- Max Meshes Per Instancer is the maximum number of instances per instanced static mesh component. Increasing this number will decrease draw calls, but it will also increase frame time when the visible item count changes.
- Item Cull Distance is the minimum distance at which items will no longer be rendered.
- Transform Texture Max Height represents the maximum number of visible items per type, per LOD. This means that for every item, each LOD will have a maximum of this number of instances visible at once. Increasing this number will increase memory usage on both CPU and GPU. Use "stat conveyors" to visualize how much memory is being used. The maximum for this variable is 16384.
- Items Cast Shadow will enable shadow rendering on conveyor items. However, this is strongly discouraged, since it can heavily affect performance.
- Use New Splitters will avoid items from slowing down when approaching splitters, but it will also make items overlap inside splitters. It is recommended to turn this on if your splitters are covered up (Like they are in Satisfactory) and off if they are visible (Like in Factorio or Minecraft's Immersive Engineering/Create mod).
- Item Rotation Speed controls how fast items will rotate to follow the direction of motion. Set to 0 to disable dynamic rotation.
- Auto Extraction On Any Thread and Auto Insertion On Any Thread - see Auto insertion & Extraction to understand how to use these.
Using the Conveyor Manager
Once these steps are done, just place the actor anywhere in the world and you should be good to go!
Setting Up Materials
Firstly, for item materials, it is important to make them compatible with instanced static meshes. To do this, enter the material editor, and in the details panel, search for "Instanced". There will be a check box for "Used with Instanced Static Meshes". Enable the option and your material will now work with items on conveyors.
Since v2.0.0, the system uses material WPO to move the items. There is a new material function you need to add in your material. This is called "Conveyor Compatibility", shown below.
Simply connect it as in the image above. If you had something connected to the two pins, connect it into the "Conveyor Compatibility" node, as follows:
You might notice that there is an extra input on the function, named "Tangent Space Normal". The default is true, so there is no requirement to edit this. In the detail panel of the material, you will find a value called "Tangent Space Normal", just like the input on the material function. The two should be the same. (So if one is true, the other MUST be true, if one is false, the other MUST be false)
You might notice that the the material also has 2 new parameters, as shown below:
Leave the 2 parameters untouched, they will be handled by the conveyor system.
Where Next?
Head into the Conveyor Component page to learn how to create a conveyor belt type.