Limit On Number of Verse Persistent weak_maps Increased

Hi everyone,

We’ve made a small but useful update:

The limit on persistent weak_maps per island has been increased from 2 to 4.

This change is aimed at helping teams manage larger or evolving data sets more effectively. The data size limit still applies per weak_map, so this effectively increases the overall amount of data you can store, though it requires using additional weak_maps.

Why This Matters

If you’ve been running into the data cap on a single weak_map, an option is to split your data across multiple weak_maps. With additional weak_maps available, the data cap is effectively higher.

Additionally, best practice for versioning data has changed. Rather than adding new fields to the same structure (which causes old, unused data to continue being saved) when old fields are no longer useful, a better approach is to separate each version out as its own option field. With the additional weak_maps now available, this approach can be adopted immediately, even for islands previously at the persistent weak_map limit. For example:

Code:

player_data := class<persistable><final>:
  V1:?player_data_v1 = false
  V2:?player_data_v2 = false
player_data_v1 := class<persistable><final>:
  Data:int
player_data_v2 := class<persistable><final>:
  Data:string

With this pattern, you can define conversion from V1 to V2, then explicitly set V1 to false once the migration is complete. That ensures the older data is no longer saved, resulting in more efficient serialization and less data needed.

The previously suggested approach of keeping a version field and adding new fields over time tends to accumulate legacy data that may never be referenced again. The option-field pattern avoids that.

In Summary

  • The persistent weak_map limit is now 4 per island, up from 2.
  • Per-persistent weak_map data size limits remain unchanged.
  • This gives you more room to split data logically.
  • Option fields for each version that can be disabled after migration are a cleaner way to manage data evolution.

Hope this helps! Let us know below if you run into any edge cases or have suggestions based on your experience.