J
15d ago

Optimization Advice

I am developing UI for my game. I read this article:

https://rive.app/community/doc/best-practices/docQqXohqHJa

My game has a lot of characters and I want to dynamically show character portraits on the screen for characters in the party. My question is if it is better to embed all the character portraits in the rive file or load them dynamically? I don't care if the rive file becomes large but I don't want to use up lots of memory. Will embedding all of them use more memory if they are not displayed at the same time?

Hope that makes sense. Thank you!

2 replies
15d ago

Hi I guess it will depend on the number of characters, but using the Solo tool, you will only render the image you have active, so it will not affect memory in a significant way. But can give you more information about what is best in this case.

14d ago

all of the images will be loaded in memory when the Rive file is loaded, regardless of whether they are embedded or referenced. This is to ensure the content is available immediately when the graphic is running.

Referenced (out-of-band) assets will be preferable to use if you make use of the same assets (fonts, images, audio) across multiple different .riv files.