Brainstorming and Experimenting (Oct 03 2025)
- Thomas Tang
- Oct 4
- 2 min read
Some things I've been trying out for the new online game, that I still haven't figured out the actual gameplay of. One way to get the game to remember what things you had when you reconnect is to save it to the room. Rooms and players have custom properties that can be stored for a certain period of time. That means everything data that a player or a card has can be put there.
This works fine for something that's just a number, like how much money a player has. This gets harder for something like what exact cards a player has, because room properties can't store game objects. My first solution was to keep everything in arrays of integers, where the integers are the card's photon ID. The problem is that arrays are annoying to use, especially if has to constantly change (which will happen in a card game). My current workaround is to get the array, convert it into a list, modify the list, turn that list back into an array, and save that.
Then there's the question of sending information to other players. When you apply a room property, it automatically applies to all other players. Which in some situations I do not want, like in game with simultaneous turns (what they do on their turn should be hidden until everyone is done). Currently my solution is, the game keeps track of what properties you have changed during your turn, and only officially saves them to the room properties when your turn is done.
Most of this so far has just been brainstorming, most of it hasn't been implemented yet and combined with all my other systems (like undos). I think most of the hardest part of the brainstorming is done though.
I can also talk about how over the past 2 days I had to deal with a very odd bug. When creating an object, it would sometimes just disappear immediately for no reason. And it would only happen in the offline mode, if it's online the objects are created without issue. Eventually I found a workaround, which is to delay the creation of the object by a fraction of a second. I don't know why this solved it, considering I had never encountered this issue before in any project, but I guess this is what I have to do.
Comments