RTS MMO Strategy query

Hi all,

I trying to find out alittle bit of information on how to approach setting up a RTS, I’ve already read a considerable amount of Posts on using Lockstep and several issues in regards to amount of units to instance etc.

i’ve still got a few queries probably due to the out of the norm setup, The different elements consist of 3 different areas

  1. account manager - manage own resources, buildings, units, tech etc etc in real time (similar to any mafia war game you can get on fb nowadays)
  2. arena - multi user battle - fps style element (using master server to create rooms for battles), singular unit per player - RPG element (Unit is developed / upgraded by the user through experience attained and account manager)
  3. war / battle - AI / NPC controlled battle - RTS style element (multi user war controlled by the AI scripts / central server, no user input)

i have both parts 1 and 2 started and working correctly however the aspect i having difficulty understanding is section 3. the idea behind this is that the user selects a groups of units and identifies a target to attack, the simulation takes place and a report is generated for the user whom can then watch the outcome or a simulation of the battle on their client, therefore no user interaction takes place.

However the few issues i’ve thought about is due to neither user/s having any input a lockstep technique is not required to ensure each user receives the updates from other clients so this can be ruled out, also no user has to watch the simulation to actually have an outcome generated and can even be offline during the simulation.

This poses the major issue, is it possible to conduct a simulation a battle on a server like photon (or would ulink be required - fully authoritive), this similuation can then be replecated on the client with animation / physics occuring to show the same outcome.
additional issues with this includes the amount of units being animated etc, and ensuring that the client simiulation follows the same steps to reach the previous simulation.

If this can do done, i’m assuming id have to use a different support database like ulink which can simulate unity on the server end, and have to setup my own .net math table for the calculations, and maybe record in maybe a list the similation sequence or variables used by the server to seed to the client as they simulate the battle at a later point. (most might argue that this isn’t RTS but i may expand on this as a fourth area where users do have an interaction into the battle, but that will have to be different entirely.

I’d appreciate any direction on how to setup the third section.

Interesting idea - given that there is no rendering/physics up front then I think you can use any kind of server to simulate the battle. The server would need to serialize the battle and outcome in a format that the client could read - the client would then use this information for playback.

As for which information to serialize, I’d think that you could get away with only serializing the significant events:
0:00 Unit1,Unit1b MoveTo 10,10
0:00 Unit2 MoveTo 10,11
0:10 Unit1,Unit1b Attack 10,10, Unit2
0:10 Unit2 Attack 10,10, Unit1
0:15 Unit1 Killed
0:15 Unit2 Attack 10,10, Unit1b
0:16 Unit2 Killed

The client could be responsible for sorting out the physics/animation and interpolating movements/pathfinding.

Could any server link photon acheive this, i would have thought server would need to have physics to calculate intersections etc. therefore the server solution provided by Ulink or unity’s own implementation could provide this.

I suppose if scripted well enough physics wouldn’t need to be required, though this could get complex very fast, especailly utilising x,y,z co-ordinates i suppose a grid would be required in order to establish co-ordinates and used for detection calculations (i.e. distances etc).

Do you think this would be a feasible approach that realistically can be worked up and implemented.

Thanks to your reply

I would think you could do it with a bot client that runs on a server somewhere using Unity’s networking, ulink, or TNet(would be my choice for this).

The hard part as mentioned is not getting the battle to play on the bot client but replicating it back to the user after it has already played. You need some way to record the battle’s actions and play it back to the client after it has already finished, or the results need to be static based on the battle’s input parameters. If you know the battle will always play out the same based on the initial variables this would be very doable simply by running the battle again but on that particular client and not even bothering with trying to send anything from the bot client.