Networking RTS possible with Unity's physics?

I’ve only dipped my toes into the shallow end of the pool, so-to-speak, in terms of networking knowledge right now, but I have some specific questions.

I’ve read that for all practical purposes networking an rts game with Unity is virtually impossible (or just very very hard?) with Unity’s physics and math, because it’s not deterministic.

#1: That being said, if I limit my networking functionality to just be 1 player versus 1 player (i.e. 1v1), would this allow me to compensate for the non-determinism by being able to send enough information of the game state to the server (or client server) given the “average” bandwidth most players have available to them nowadays?


#2: Secondly, the physics I’m currently using is needed for player collisions and for “effects” such as boulders being triggered to fall off a cliff (which is just for show). Is it possible to network for collisions properly (or at least good enough), to where the game is playable? I think player and player-building collisions would be a necessity, but the just for show stuff I could do without.


#3: And, lastly, if I simply give in to the fact that my game can’t have replays (due to non-determinism), and the fact that I’m only striving for 1v1 to start with, is it possible to have a rudimentary multiplayer 1v1 rts game working using Unity’s physics, math, components, API, etc…

All in all, I’d like to know if it’s possible to have functioning multiplayer for an rts game with Unity, no matter how limited or bad it may be? Thanks for any help.

#1: That would defeat the purpose of the standard RTS networking design. The idea is that you only send what the user does, and replicate it across all clients. This is why having a deterministic simulation is important; if one user has different results from the same computation as another, this will butterfly into larger desyncs.

#2: Of course it is, but you will need to program this yourself in a way that will yield the same results across all clients

#3: No, not with unity physics.

Yes, you can have a fully function rts style game in unity. It will take a bit of work getting it to function how you want though, as unity doesn’t really have a clear cut way to do this.

Ok so two followup questions then:

  1. I can’t use Unity’s physics AND math? Or I can’t use Unity’s physics, but the math is okay to use?

  2. What physics system could I possibly implement if I can’t use Unity’s?

  1. Correct. Floating point math is not deterministic (which is what makes the physics non deterministic). There is a way to make it that way, but it is quite a bit more inefficient. You have to implement your own method to do this.

  2. You need to make your own, though I think there are some out there that would be considered deterministic.

Maybe I can help point you in the right direction. What are you trying to do?