Save and load user generated content

Hello there,

I’m creating a little memory game, with a feature allowing players to create their own tiles by drawing on a plane (inspired by this tutorial https://www.youtube.com/watch?v=wIfovfaf01w&ab_channel=UnrealUniversity).

The thing is, I can’t figure out how to save and load this kind of user-generated content.

If I use the nodes “Export to disk” or “Export Render Target”, it does create a .exr file, and I can “import” it like any other file in the editor.

However, I have no idea how to convert this .exr into a texture runtime.

It’s not possible to export a Render Target as a PNG runtime, only as a EXR.
It’s not possible to convert a EXR into a PNG runtime.
The plugin “Runtime Image Loader” doesn’t support EXR files.

I don’t really know what I can do. Any idea?

Thanks :smiley:

Just to help you out to get this done. Are you using blueprints or C++ too?

have you tried this one

also this is a multiplayer game right?

Hi, thanks for your answer.

It’s a blueprint project, and no it’s a single player game :slight_smile:

I’m using this node. Exporting as a .exr works, but not as a .png (or any other formats).

In the end I just need a texture2D created runtime.

I have a plugin that allow me to convert a .png into a texture2D runtime, but it doesn’t support the .exr file.

Allright think it should work as like this.

On RenderTarget Set image to

now you can export as png to disk.

let me know if it works

also you can import as file too like below

if you will have multiple images etc you can search directory as .png and make them as array etc.

1 Like

Amazing, thanks a lot!

It was because of the “Render Target Format” :stuck_out_tongue:

Now the player can save their custom drawings.

Now the point is to “combine” this new Texture2D with a render target so the player can edit the existing drawing. I haven’t found the solution yet, so if you have any ideas, I’d love to hear them! :slight_smile:


Thanks again!

My pleasure, depends on how you make the painting? are you painting a mesh if so you can just paint a new mesh vertex colors from texture.

How you make painting?

Like this:

Well on this logic save and retrieve functions that I show you should be multiple since data is layered.

Which is ok can be done same way just iteratively.

On your canvas while saving

  • For Each Material
    • Set other materials to not visible in scene capture
    • Capture and save as RenderTargetSave_001_MatIndex

So now you saved multiple layers as image data.

Retrieve as same, a little bit more work.

  • Check RenderTargetSave_001 as file in directory matching (or you can use seperate folders)
  • For each file
  • Create Material and append to canvas (afais there is over there draw texture function)

after these since its editing process you have to coralate brush names with the retrieved ones so player can modify those.

I made this and it works great, thanks to the node “Draw Material to Render Target”!

Thanks again for your help :smiley:

1 Like