Speed up level art by using Splines and Blueprints

Speed up level art by using Splines and Blueprints

Tutorial based on Rogue Spirit game development.

Creating levels is time-consuming but with UE4 you can create a lot of tools that will speed up the process.

Random ground mesh placing

Placing small props on levels takes time.

Using Random mesh spawner which is using Instanced Static Mesh Component for less draw calls.

Pipeline

Pipeline is simple:

  1. Select mesh you want to populate,
  2. Chose if it’s sphere-based or box based,
  3. Select size,
  4. Select random rotation, random offset, random scale,
  5. If you don’t want to put them on something just add the actor to ignored actors,

Draw Debugs

This can be done better in C++ and component visualization but let’s face it: we are a small team and we don’t want to spend to much time on editor stuff.

Drawing just for preview.

Deciding on rotations

It is not complicated but a lot of nodes are needed. Can be moved to C++

Deciding on scale

Simple as this 🙂

Deciding on Location

Just decide where to put another instance.

Trace to get ground location

Trace to get the final location.

It’s a really simple Blueprint which can speed up laying some small props on the ground.

Using Splines for placing meshes

Some of our spline-based mesh spawning

Splines can be powerful when dealing with meshes. Remember that construction script can be costly here and you should cache your computed version without calling construction script again.

Pipeline

Here the pipeline is more complicated as it has a ton of options.

  1. Decide if it’s Distance based or Spline Points based. Spline points-based can be helpful sometimes when you want to “merge” the same mesh without using UE4 group actors. It’s faster as it’s using Instanced Static Mesh,
  2. Decide on random things like scale, rotation, offsets,
  3. Decide if should trace ground,

Type: On Spline Points

Use Spline Mesh at Points means you can add Spline Mesh Components instead of Instanced Mesh Components.
Getting random rotation
Getting random scale
Deciding if adding instance or using Spline Mesh Component instead

Type: Distance / Duration

This one looks more complicated as everything done in Blueprints. C++ version is much simpler.

Placing meshes by spline distance

What this is doing is :

  • Iterating spline by its length,
  • Deciding if use spline rotation and scale,
  • Doing down trace if needed,
  • Adding offsets,

Again this is based on Instanced Static Mesh.

Moving on Spline – Rat

Moving Rat on Semi Generated Spline.

We are always thinking about how we can add more life to our levels. One of them has moving rats. There is a couple of ways of doing this:

  • By implementing AI behavior which will be CPU costly,
  • By using Distance Fields Niagara particle which will be GPU costly,
Using Distance Fields for Particle Movement
  • By using Splines which lead to manual placing them on levels,

We decided to use Splines for this, as performance is critical for us.

Our way to create splines – 5 min for each rat.
Thanks to navigation you can create longer and more complex paths.

Pipeline

The pipeline is using semi generation with some helpers:

  1. Move points on your level,
  2. Click generate: this will create spline for you using a navigation system,
  3. Modify points which aren’t good enough,
  4. Do trace fix to make points lying on the ground,

Tracing down

It’s really simple – just trace from a point down.

Generating Spline on Navigation Mesh

This part is simple in C++ but looks more complex in Blueprints.

part 1
part 2

Basically we are getting path from navigation from one point to another. We are adding Spline Points along path points. Simple as that.

Summary

We are constantly thinking about how to speed up our pipelines and will be sharing more in the future.

Tags: , , , , ,

One Response

Leave a Reply

Your email address will not be published. Required fields are marked *