cryptomax
cryptomax
NNormal
Created by cryptomax on 6/16/2024 in #💭feature-request
Control instantiation rate on connection?
So if you have 30-50 rigibodies when connecting to a room there is a pretty heavy duty hiccup. A way to stagger that instantiation burst that was built in would be pretty nice.
6 replies
NNormal
Created by cryptomax on 6/6/2024 in #💭feature-request
Possible option to force firing updated model event
Not sure if there are technical difficulties with doing something like this, but to have an event (or maybe just a property setting) that would fire the event if the model was sent an update even if the model didn't change value. This would make it so you could easily use a simple int to continously play various sound effects or trigger various animations from just an int becuase it could keep firing?
18 replies
NNormal
Created by cryptomax on 6/1/2024 in #🤝ask-a-question
DidChange Event not firing
The did change event is not firing on the client that is setting it from fresh. using System.Collections; using System.Collections.Generic; using UnityEngine; using Normal.Realtime; public class ChangeEventTester : RealtimeComponent<IntSyncFreshModel> { public bool chooseRandomAtStart; public Vector2 randomRange = new Vector2(1, 5); // Default random range private IntSyncFreshModel _model; protected override void OnRealtimeModelReplaced(IntSyncFreshModel previousModel, IntSyncFreshModel currentModel) { _model = currentModel;
if (previousModel != null) { previousModel.int1DidChange -= Int1DidChange; } if (currentModel != null) { if (currentModel.isFreshModel) { InitializeFreshModel(currentModel); } else { Int1DidChange(currentModel, currentModel.int1); } currentModel.int1DidChange += Int1DidChange; } } private void InitializeFreshModel(IntSyncFreshModel model) { Debug.Log("Model is fresh."); if (chooseRandomAtStart) { model.int1 = Random.Range((int)randomRange.x, (int)randomRange.y + 1); Debug.Log($"Random value picked: {model.int1}"); } else { model.int1 = 0; // Initialize with your desired default value Debug.Log("Set int1 to default value 0."); } } private void Int1DidChange(IntSyncFreshModel model, int value) { Debug.Log($"int1 changed to: {value}"); } public int GetCurrentInt() { return _model.int1; } } Any idea why that would be?
10 replies
NNormal
Created by cryptomax on 5/30/2024 in #🤝ask-a-question
OwnerIDSelfDidChange
Does realtimeView Have this event as well or only RealtimeTransform?
8 replies
NNormal
Created by cryptomax on 5/28/2024 in #🤝ask-a-question
rigidbody realtime transform vs just realtime transform
I am aware that realtime transform has two modes one for rigibodies and one for non, are you able to tell me the number of properties that are syncing in either case? I'm curious to know the sheer number of extra properties rigidbody transform syncs
34 replies
NNormal
Created by cryptomax on 5/21/2024 in #🤝ask-a-question
Enabling Gameobject with realtime view on it
If I have a game obejct that is off when the scene loads, and that game obejct has a realtime view and custom component on it, will the realtime view properly register with the realtime when I enable the game obejct?
6 replies
NNormal
Created by cryptomax on 5/17/2024 in #🤝ask-a-question
*probes bot for insider information on when the room API will be ready*
🙂
7 replies
NNormal
Created by cryptomax on 5/9/2024 in #🤝ask-a-question
RealtimeView doesn't have a connected property?
It appears RealtimeView doesnt' have a connected property, whats the best way to get connection state from it?
4 replies
NNormal
Created by cryptomax on 5/2/2024 in #🤝ask-a-question
What happens if we disable a rigidbody game object with a realtime transform and view on it?
Will it be able to resume syncing if reenabled? Does it break the object?
10 replies
NNormal
Created by cryptomax on 4/17/2024 in #🤝ask-a-question
Checking realtimeTransform.isOwnedLocallySelf
Is checking this identical to checking any local bool in a script or does it have to fetch that property from the server?
11 replies
NNormal
Created by cryptomax on 4/16/2024 in #🤝ask-a-question
If two players request ownership at the same moment
Are there circumstances where it looks momentarily like you could own the item locally but then your ownership is rejected by the server?
25 replies
NNormal
Created by cryptomax on 4/15/2024 in #🤝ask-a-question
Does syncing a rigidbody with realtime transform while kinematic limit the values being synced?
If a rigidbody is kinematic does realtime transform truncate the sync variables in any way for efficiency?
6 replies
NNormal
Created by cryptomax on 4/14/2024 in #🤝ask-a-question
Manually syncing position, rotation at 20hz?
If I were manually syncing an object position and rotation, should the model setter just be setting every frame or can resources be saved by setting it only 20x a second becuase thats what normcore would use anyway? It woudnlt' be in sync with normcores refresh anyway i'd assume so how does that work? Is there a way to sync at normcores refresh rate?
32 replies
NNormal
Created by cryptomax on 4/12/2024 in #🤝ask-a-question
Prevent ownership takeover isn't designed to be used dynamically during time correct?
If we have a rigidbody that multiple poeple may be touching but we dont want realtime transform to automatically transfer ownership of.
14 replies
NNormal
Created by cryptomax on 4/11/2024 in #🤝ask-a-question
Can you get a client id directly from realtimetransform?
Can you get a client id directly from realtimetransform?
36 replies
NNormal
Created by cryptomax on 4/9/2024 in #🤝ask-a-question
Should a realtime custom component that is changing every frame be handled any differently?
Or should you still just use a didchange event even if it is changing every frame all the time?
11 replies
NNormal
Created by cryptomax on 4/7/2024 in #🤝ask-a-question
Constant force syncing
So if you have a constant force that is being applied to an object, Should you bother trying to sync turning it on and off between players or does it not matter because whoever owns it will simply control the rigidbody behavior anyway.
10 replies
NNormal
Created by cryptomax on 4/5/2024 in #🤝ask-a-question
Disabling object with realtime view?
I see you aren't supposed to start with a disabled view but what about disabling and reenabling a realtime view during runtime after that?
21 replies
NNormal
Created by cryptomax on 4/3/2024 in #🤝ask-a-question
Does setting a fresh realtime component upon entering a room model fire a didchange event?
It seems like it should, but the behavoir i'm getting at the moment seems like it is not. There was a bug fix in normcore for a didchange vent that was failing to fire but I believe that is fixed in my version 2.7
6 replies
NNormal
Created by cryptomax on 3/22/2024 in #🤝ask-a-question
How is StopWatch Recipe updating other clients?
I dont see a didchange event in this model so how is this starting the stop watch on clients other than the one who started the stopwatch model? using Normal.Realtime; using Normal.Realtime.Serialization; [RealtimeModel] public partial class StopWatchModel { [RealtimeProperty(1, true)] private double _startTime; } /* ----- Begin Normal Autogenerated Code ----- */ public partial class StopWatchModel : RealtimeModel { public double startTime { get { return _startTimeProperty.value; } set { if (_startTimeProperty.value == value) return; _startTimeProperty.value = value; InvalidateReliableLength(); } }
public enum PropertyID : uint { StartTime = 1, }
#region Properties
private ReliableProperty<double> _startTimeProperty;
#endregion
public StopWatchModel() : base(null) { _startTimeProperty = new ReliableProperty<double>(1, _startTime); }
protected override void OnParentReplaced(RealtimeModel previousParent, RealtimeModel currentParent) { _startTimeProperty.UnsubscribeCallback(); }
protected override int WriteLength(StreamContext context) { var length = 0; length += _startTimeProperty.WriteLength(context); return length; }
protected override void Write(WriteStream stream, StreamContext context) { var writes = false; writes |= _startTimeProperty.Write(stream, context); if (writes) InvalidateContextLength(context); }
protected override void Read(ReadStream stream, StreamContext context) { var anyPropertiesChanged = false; while (stream.ReadNextPropertyID(out uint propertyID)) { var changed = false; switch (propertyID) { case (uint) PropertyID.StartTime: { changed = _startTimeProperty.Read(stream, context); break; } default: { stream.SkipProperty(); break; } } anyPropertiesChanged |= changed; } if (anyPropertiesChanged) { UpdateBackingFields(); } }
private void UpdateBackingFields() { _startTime = startTime; }
}
21 replies