pir8x
pir8x
NNormal
Created by ReeseR on 8/28/2024 in #🤝ask-a-question
Best way to sync data on a table?
I think it would still work for you. In our model, we never update any of the list elements - we just add score events (net change). RealtimeSet has an event for when a model is added, which the clients' local sim then uses to calculate/update the score locally.
28 replies
NNormal
Created by ReeseR on 8/28/2024 in #🤝ask-a-question
Best way to sync data on a table?
...for i.e. a bowling score sheet your event could be { player, frame, delivery, pins }
28 replies
NNormal
Created by ReeseR on 8/28/2024 in #🤝ask-a-question
Best way to sync data on a table?
I don't know if this fits your use case, but we did a thing where instead of storing/syncing player score totals, we sync a log of score events in an unordered RealtimeSet.
event 0 { player = 1, score = 1 }
event 1 { player = 2, score = 5 }
event 2 { player = 2, score = 2 }
event 0 { player = 1, score = 1 }
event 1 { player = 2, score = 5 }
event 2 { player = 2, score = 2 }
Everyone's local arrays only get updated on the ModelAdded event. Then we calculate the local scores from the log as required:
List<scoreEvents> player2Scores = localScoreEvents.FindAll(e => e.player == 2)

player2Score = 0
foreach(scoreEvent in player2Scores)
{
player2Score += scoreEvent.score
}

// player2Score is 7
List<scoreEvents> player2Scores = localScoreEvents.FindAll(e => e.player == 2)

player2Score = 0
foreach(scoreEvent in player2Scores)
{
player2Score += scoreEvent.score
}

// player2Score is 7
(Our game is turn-based and has infrequent score updates.) (Pseudo-code - our scoring system has more dimensions and data in the score "ledger", but hopefully you get the idea.)
28 replies
NNormal
Created by pir8x on 6/3/2024 in #🤝ask-a-question
Unable to build with "Development Build" flag in 2.10.2
😃 thanks!!
8 replies