#How to handle arbitrary number of child states?
1 messages · Page 1 of 1 (latest)
Maybe I can add an Absent state to each player.
And hardcode 4 players on each side
4 is the maximum per side
are these players distributed across different computers or are they all playing through the same computer?
I think it could change how you want to model it
It's intended for multiple players on different devices.
But I can simulate all in my local testing
There has to be one if it's supporting multiplayer gameplay
Okay so each player is really communicating with the server as a proxy
Not sure if this matters too. The FSM doesn't care if the commands are received via network or local function calls.
It should be fine as long as it knows what commands are? Not how they are sent?
ya totally
so are you thinking each computer will have a state machine of each player?
which have to be synced together across each computer?
In context you can have an array of spawned machines for each side https://xstate.js.org/docs/guides/actors.html#spawning-machines
Documentation for XState: State Machines and Statecharts for the Modern Web
context: {
sideOne: [...],
sideTwo: [...]
}