Valheim-Modding/Jotunn

[BUG] icons visual issues (hammer piece table)

galathil opened this issue · 3 comments

Details: icons in hammer table has sometimes visual issues
Jotunn Version: 2.10.1.0
Jotunn Submodule(if applicable): none
Repeatability(Consistent(100%), Inconsistent(50%), Rare(1%), Unknown(==1)): Inconsistent or rare

Problem Description:
I've develop a mod that add vanilla prefabs as building pieces in the game. The code wich generate the icon is :

private static Sprite CreatePrefabIcon(GameObject prefab)
{
    Sprite result = RenderManager.Instance.Render(prefab, RenderManager.IsometricRotation);
    return result;
}

The mod is available here : https://github.com/galathil/MoreVanillaBuilds
Note that my mods icons are affected by this random issue, not vanilla icons. You need to restart the game to clear this issue.
Other mods in plugin folder :

Maybe i make a mistake with RenderManager but i look other mods that include custom content in the game and syntax is the same.

Expected Behaviour:
No visual glitches

Actual Behaviour:
Visual glitches sometimes :

Link to your server's and client's LogOutput.log
No error in logs

Hey, thanks for the report. I am not sure why this happens yet, has to be investigated more. Which will be hard when its not reproducible. But as some sort of "workaround" you could use the Render Manager cache for caching the generated icons to disk. This will also improve mod loading time a lot since you generate quite a lot of icons. Check out the tutorial section for more information: https://valheim-modding.github.io/Jotunn/tutorials/renderqueue.html#caching-icons

Thanks for you reply. i'll implement caching in my mod and if i find any additionnal infos (or evidence) about the bug, i will post here.