UEFN Bug: 8K Material Limit BREAKS Matchmaking for Your Lobby

Summary

If your Creative map creates ~8,000 material instances in a single lobby, it will silently enter a phantom joinable state:

  • Lobby appears joinable in matchmaking.
  • Players inside see no issues.
  • Matchmaking thinks this lobby is joinable and sends ALL new players in that region to this lobby
  • All new players get “Network Connection Lost.”

This affects both Scene Graph Beta using materials & mesh_components and non–Scene Graph maps using dynamic materials (with parameters).

Scene Graph is worse because every static mesh without an explicitly cached material spawns its own material instance, quickly hitting the 8K limit.

Please select what you are reporting on:

Verse

What Type of Bug are you experiencing?

Matchmaking

Steps to Reproduce

There’s two easy ways to get this result:

  1. Using Static Mesh Components creations, which automatically creates new material instances:
PutLobbyInUnjoinableModeV1WithSceneGraph()<suspends>:void =
    loop:
        Sleep(0.1)
        for (X := 0..100):
            Entity := entity{}
            Meshes.Box_EAFB9DAA{Entity := Entity}  # Implicit material creation
  1. Direct Material Creation. (In Scene Graph any Material, in non Scene Graph only dynamic materials with parameters you can modify dynamically through verse)
PutLobbyInUnjoinableModeV2WithSceneGraph()<suspends>:void =
    loop:
        Sleep(0.1)
        for (X := 0..100):
            Material := AnyMaterial{} # Just creating instances

Spawn one of the 2 methods in the OnBegin, wait for about 10 seconds and try join your existing session with an extra account. You will notice the player can’t join your session because ‘Network Connection Lost’

Note: It does not matter wether you reach the 8k threshold after 10 seconds or 10 hours. Once it’s reached, the lobby is broken.

Expected Result

Session should be joinable.

Observed Result

Network Connection Lost for all players trying to join this existing session. It does not matter if you use matchmaking or party join.

Platform(s)

Any

Additional Notes

Hotfix for Creators

Caching materials will MOST LIKELY bypass this for 99.9% of use cases and is the best current workaround.

  1. Cache all materials at startup (e.g., in OnBegin).
  2. Always reuse cached materials for meshes and props.
  3. Never repeatedly create new materials per spawn.

Example 1: Static Mesh Creation

var CachedMaterials : [string]material = map{}

OnBegin(): void =
    set CachedMaterials = map {
        "color_green" => ColorGreen{} # Replace with your real material
    }

if (CachedMat := CachedMaterials["color_green"]):
    Meshes.Box_EAFB9DAA{Entity := Entity, Material := CachedMat} # PASS in the Material, 'Material' field name is dynamic, check in UEFN/verse assets how this field is called, it can also be that you have more material fields here. Make sure to always use a cached instance to avoid new material instances to be created.
    
# This mesh_component is something you can add to your entity etc like usual in Scene Graph.

Example 2: Creative Prop Material Assignment

if (CachedMat := CachedMaterials["color_green"]):
    MyCreativeProp.SetMaterial(CachedMat)


Any dynamic entity/material map is at high risk:

  • Brainrot maps (Steal/Grow a Brainrot)
  • Go Garden
  • Tycoons

Caching materials bypasses the 8K material instance limit and prevents your lobby from entering the phantom joinable state.


Final Note

Our Grow Garden game (7541-4900-1724) is a good example of how this naturally hits the 8k limit:

We continuously create and dispose entities as fruits grow, and also use materials for fruit coloring.

Luckily, we discovered this bug before going live.

Our old PVP Tycoon map, however, was completely wrecked after 3 months of development because of this bug, matchmaking got interrupted and killed our CCU.

Please, Epic Games, fix this ASAP—many creators don’t know about this hotfix.

We’ve seen firsthand how devastating this can be to creators’ months of work, and we’ve already noticed other maps running into the same invisible problem.

Community: Please share this post with any creator using Scene Graph or dynamic materials—they NEED to see this fix.

Would this cause tps/verse performance ? i have a map again setting a ton of material instances and over time performance drops to 10 tps just wondering if you had similar things ?

I haven’t noticed lower tps with material instances over time to be honest, here’s some tips I can give you to debug your TPS issue:

  1. Isolate the problem, if you think the problem is material instances, try to disable this and see if you still run into performance drops. Can be very painful & time consuming, but it is what it is. We’ve spend 100+ hours with the team to debug this particular Connection Lost Issue by literally disabling everything and bringing pieces back every time.
  2. Another approach, which I personally like since it gives me faster feedback, is to try and heavily increase the usage of what I think is making performance drops. E.g. if I think material instances are the issue, I will run this x5, x10, x100, to find out wether it has an impact.

Hope that helps.

FORT-947717 has been added to our ‘To Do’ list. Someone’s been assigned this task.

1 Like