Client lagg spikes when you have huge verse array lists.

Summary

Having a huge array list in verse with objects has impact on teleporting a client, where if you teleport it from location A to location B (e.g. spawn to another part of the island) it freezes for 8 seconds. I know this sounds weird and I don’t understand how the two are related.

Please select what you are reporting on:

Creative

What Type of Bug are you experiencing?

Assets

Steps to Reproduce

  1. Create an array list with objects, important, they should be like vector3’s, transforms etc or other classes. Add A LOT of them like 2k
  2. Add a teleporter ‘far’ away, like 15k distance
  3. Add a button connected to teleporter
  4. Launch session → Press button → Notice how your client freezes for like 8 seconds trying to load the props around you

Important, you need to make your class less optimized, thats why using transform, vector3 is required.

What I did to bypass this freezing was using primitives, this was way more efficient and avoided my client freezes.

Example of my ‘optimized’ class:

template_reward_data_optimized := struct:
# Translation components
TranslationX : float = 0.0
TranslationY : float = 0.0
TranslationZ : float = 0.0

# Rotation components (in degrees)
Yaw<public> : float = 0.0
Pitch<public> : float = 0.0
Roll<public> : float = 0.0

# Scale components
ScaleX<public> : float = 1.0
ScaleY<public> : float = 1.0
ScaleZ<public> : float = 1.0

Tag : string = ""
Special : int = 0 # 0 = reward_show, 1 is random_loot, 2 = hitable_on_target_reached, 3 = billboard, 4 = clickerprop
Index<public> : int = 0

Non optimised would be to use

template_reward_data := struct:
# Translation components
Transform : transform
Tags: string # Add all tags, e.g. reward_show, random_loot etc
Index : int = 0

Expected Result

No client freezes

Observed Result

Client freezes for 8 sec trying to load after teleporting

Platform(s)

PC