Hi there!
I’m contemplating idea of a game with hybrid RTS\Dota-like gameplay, where each of 4-6 players controls only handful of units (10-20 for each player max., probably less) and has to perform fairly complicated tactical tasks /w lots of micromanagement. Imagine playing TBS in real time, where you have 1 unit of each type, and you will roughly get the idea. Total unit count, in this case, will be something like 100 (120 max). This raises the question.
I know that the only working solution for RTS is P2P with lockstep, and it will require lots of tinkering to achieve deterministic simulation in Unity (and I’m not sure I can manage it). However, ~100 actors isn’t that much number, it’s comparable with most MMORPGs and some shooters. Is it realistic to do this using client-server approach, usual for FPS? If so, what middleware can you suggest? I’m looking to Photon right now (cloud sounds great), but didn’t try it yet.
(Forgot to mention. Target platforms are only PC and (probably) Mac, I don’t care about mobile devices)
That’s a tricky question. Actually, there might not be a simple reply to this.
Did you search the forum for similar discussions? You will notice how many different opinions are out there about this 
The idea about using a deterministic simulation is to minimize the data you have to sync. Usually for large armies. Lockstep eliminates issues when a particular update is late.
Your case is different. Having only 20 units per player is not that much but if you send their positions and targets, this will certainly be a lot more than just a player’s input per (lock)step.
Actually, it might be good to just find out for your game. Start with non-determinism and without lock step. If things break you can figure out why and learn why determinism is needed and where lockstep would help. As you know both concepts you should find out where each helps and if it’s relevant.
Try to keep updates/unit and second low. Send target positions and skip a few position updates while every client interpolates the position to the target.
You can get away with small differences between clients most likely. Example: Maybe it doesn’t matter if a particular shot really hit another unit or if that got destroyed before. Make up a rule who decides a hit. Destroying a object should be in the hands of the owner. If the target unit calculates a hit or if that’s done by the firing unit is up to you.
You should playtest early and analyze issues to get networking right. In my opinion this is the best way to get the game playable in a good way.
I agree with tobiass… Do networking first, get that solid… test test test test test test the crap out of it!
Thanks a lot for reply. You’re, of course, right, the only real way is to test. I just wanted to hear some opinions (in addition to walls of text I’ve already read in similar topics :p). tobiass, I like your idea of one shot not making a difference, and I imagine this solution.
Since total actors count is higher than in FPS (but not too high), and responce-time requirements are lower (but not too low), I can imagine a model, where you do state sync (like in FPS), but at a lower frequency (mb once a 200ms, like in AOE). I definitely have to test this one, mb it will be completely broken, but at the first glance it seems right: clients share state every 5 secons, so they’ll be in sync, and in-between they’ll run simulation. This way net traffic should be manageable.
Unlike in action, in RTS you don’t really care about exact aim and positioning, so if, during simulation, one of your units hits another, and during resync it turns out that he missed, in most cases this won’t be even noticeable. Yes, it may be weird to see how dead enemy ressurects, but it will be a 0.2sec glitch (he’ll probably won’t even play his death animation) and it will annoy no more, than cathing up units, running at 4x speed in Warcraft or League of Legends. So, anyway, I have all my testing ahead =)
And yes, to determine who’s right, server, running simulation, (or game host) will have priority to override local data.
Usage of lock step and deterministic simulation in games like age of empires was due to the desirability of supporting even dial up connections with a simulation of their kind and teams capable of doing that.
If you see you can create the simulation engine in a good amount of time then why not do it if your target are countries with low bandwidth concerns but if you are targeting countries which you can get away with higher speeds specially cause you are targeting PCs, then why make development long?
So it depends on your real bandwidth requirements, if you have to do it, then you have to either do it that way or don’t do it at all, if you don’t, then you don’t.
And about possibility, yes it’s possible. In PC/Mac you have access to native code plugins if you require them and in mono you have access to same floats and doubles and ints and calculations and timing is using the same CPU realtime clock, If jit and GC are concerns then you can do the whole thing in C++ about networking and use the dll in your unity game and unity just does the rendering and effects job.