Are there any good, scalable multiplayer RTS engines available for Unity? I can’t find any on the asset store, nor any forum posts mentioning RTS. The networking is the more interesting part of the problem, and the requirements are different to most other genres.
I’m not going to make any claims because I don’t know how “scalable” you want the game to be, but you’re welcome to check out my signature. At the very least, you’ll know that you’re not alone in thinking about RTS games
Interesting - that looks really easy to use. Nice tutorials too!
It wasn’t clear, though, what the networking model is. Could it handle large numbers of units, or would that use a lot of bandwidth? Conservatively, I was hoping to simulate several hundred characters with a dozen players; but I don’t see a technical reason why I shouldn’t simulate a thousand characters with a hundred players. More of an MMORTS.
The backend scheme I have in mind is based on fairly well-known RTS networking techniques, which rely on determinism in the simulation to avoid sending large amounts of data over the wire. The network load should be very low indeed, and the limitations on scale mostly come from the client’s ability to run the simulation fast enough, and the necessity to serialise out the whole state in order to support join-in-progress (which is pretty much essential for large team games).
In my day-job last year it took about four people about three months to implement something like this, but we were experimenting, disagreeing, and working to constraints based on the company’s fluctuating commercial interests. Thinking about it since then, I think with different constraints, different focus, and hindsight, it might be possible to do it in a lot less time. It’s always easier when you already know what to write! We also only managed to support around 100 units, but I think a more focused, less generic design could do more, especially if the units are less complicated.
As it’s a documented design (though I don’t have the references to hand) I thought maybe somebody has already implemented it, or something similar. I’m less interested in designs based on unit positions getting sent around, as I doubt they’d scale so well - though they do have the benefit that each machine only needs to simulate the units it owns…
I’ve had a little play now to see what sort of numbers might be reasonable, and I’m currently running 5000 units with very simple logic. I wasn’t sure how well Unity would cope with updating and rendering that many individual GameObjects, but it’s doing OK. I haven’t done anything particularly special here, so with simple logic and a bit of effort on the rendering front larger unit counts should be possible, and even with much more complicated update logic, a few thousand units should be easily achievable.
This is all standalone at the moment, but as it’s based on deterministic logic the network traffic should be negligible - approximately linear with number of players, and independent of the unit count. The profiling results so far are pleasing enough that I think I’ll go ahead and see where it ends up.
My suggestion is; don’t worry about Unity. You won’t be rendering 5000 units at once anyway, because in any reasonable setting, they wouldn’t “fit” on screen. Like many games (Sins of a Solar Empire, Supreme Commander, etc), at certain zoom levels you’re going to be abstracting out the graphics of individual units anyway.
Good luck on your endeavors! Keep us informed
Barely on topic, and sorry for the blatant self-promo, but check this out: ImageShack - Best place for all of your image hosting and image sharing needs It’s unity’s networking and this isn’t in any way 5000 units, but it’s several hundred (everything like bridges and little island units are placed by one of the players, islands and smoking geysers are not) running networked between one player in Australia and the other in the US. I would guess, based on profiling my own tests, that around half the time is spent on rendering, but I wasn’t playing that one…