JuanLouTech
JuanLouTech2w ago

What is the max amount of properties a model can have?

I have to sync customizable characters in my app and this requires to sync about 21 string properties for colors and mesh variant names and texture urls.
6 Replies
kapa.ai
kapa.ai2w ago
Hi @JuanLouTech. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave: ---------------------- Based on the provided knowledge sources, there is no explicit information about a maximum limit on the number of properties a RealtimeModel can have in NormalVR. However, there are some important considerations to keep in mind when designing your model: 1. Property IDs: Each property in a RealtimeModel needs a unique property ID within that model. The RealtimeModel documentation (https://normcore.io/documentation/room/realtimemodel) suggests starting with property ID 1 and incrementing from there. There's no mentioned upper limit on these IDs. 2. Datastore size limits: While not directly related to the number of properties, the Common Questions documentation (https://normcore.io/documentation/room/common-questions) mentions that datastores are limited to 10MB, and a single datastore update is limited to 125KB. This could potentially affect how many properties you can practically use, depending on their types and sizes. 3. Supported primitives: Make sure all your properties use supported primitive types (https://normcore.io/documentation/room/supported-primitives). For your case, string is a supported type, so you should be able to use it for your color, mesh variant names, and texture URLs. 4. Performance considerations: While there's no stated limit, having a large number of properties might impact performance, especially if they change frequently. For your specific case of syncing customizable characters with 21 string properties, there's no information in the provided sources suggesting this would exceed any limit. However, you might want to consider if all these properties need to be synced individually, or if some could be combined into a more compact representation to optimize network usage. If you need more specific information about property limits or optimizing your model for character customization, you may want to consult the NormalVR documentation further or reach out to their support team directly. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2w ago
<@941753147938984038> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
JuanLouTech
JuanLouTechOP2w ago
@kapa.ai Can I set a stringified json object as a unique string property to sync?
kapa.ai
kapa.ai2w ago
Let me check the knowledge base for you again. One moment! :books: ---------------------- Yes, you can set a stringified JSON object as a unique string property to sync in a RealtimeModel. This approach is supported by NormalVR's Normcore framework. Here's why this works: 1. Supported Primitives: According to the Supported Primitives documentation (https://normcore.io/documentation/room/supported-primitives), string is one of the supported C# primitives that can be used in a RealtimeModel. 2. RealtimeProperty: You can define a string property in your RealtimeModel using the **RealtimeProperty] attribute, as shown in the [RealtimeModel documentation (https://normcore.io/documentation/room/realtimemodel). Here's an example of how you might define such a property in your model:
[RealtimeModel]
public partial class MyCustomizableCharacterModel {
[RealtimeProperty(1, true)]
private string _characterDataJson;
}
[RealtimeModel]
public partial class MyCustomizableCharacterModel {
[RealtimeProperty(1, true)]
private string _characterDataJson;
}
By using this approach, you can serialize your complex character data into a JSON string and store it in a single property. This can be an effective way to sync multiple pieces of data without creating separate properties for each item. However, keep in mind a few considerations: 1. Size Limits: As mentioned in the
Common Questions documentation** (https://normcore.io/documentation/room/common-questions), there are size limits for the datastore (10MB) and single updates (125KB). Ensure your stringified JSON doesn't exceed these limits. 2. Performance: While this method works, frequently updating large JSON strings might impact performance. Consider the frequency of updates and the size of your JSON data. 3. Parsing: Remember that you'll need to parse the JSON string back into an object on the receiving end to use the data. This approach can be particularly useful in your case of syncing customizable characters, as it allows you to package all 21 properties into a single string property, potentially simplifying your model structure. ---------------------- Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: ----------------------
kapa.ai
kapa.ai2w ago
<@941753147938984038> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
maxweisel
maxweisel2w ago
I believe you can have over 1,000,000 properties in a single model if you want We haven't had anyone hit the upper limit. It looks like the maximum propertyID you can use is 16777215