Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Is Photon really what I should be using for my RTS?

Discussion in 'Editor & General Support' started by II_Spoon_II, Aug 18, 2018.

  1. II_Spoon_II

    II_Spoon_II

    Joined:
    Jun 16, 2018
    Posts:
    180
    Hello,

    So I had made a post earlier asking some info about networking, I was going to use uNET untill I hearn it's getting removed, then I went with Photon, but I wanted to have more info before going too far into the project.

    If anyone have ever made a RTS, is there any networking framework I should be checking?

    I want the solution with the less coding in it, since I am doing it solo.

    I was planning on using photon Cloud, is there any other networking frameworks offering the same services?

    Thank you ^^
     
  2. hippocoder

    hippocoder

    Digital Ape Moderator

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I think factors like host migration matter a lot less with RTS games, so you might want something quite a bit cheaper. You probably want to just send actions instead of actually moving any units, just make sure it's deterministic and networking will be way cheaper, possibly free if hosted by player.
     
  3. II_Spoon_II

    II_Spoon_II

    Joined:
    Jun 16, 2018
    Posts:
    180
    What do you mean by just send actions? Send actions to the server then he makes the moves?

    My game will be a player spawning units simply by clicking the sport where he wants to instantiate them, and he may order them to rechange their position, simple, and not thousands of unitys, just few.

    Is P2P gonna be fine for a an RTS game? no need for server? (it's only gonna be a 1 v 1 game at the beggining)

    What's the cheapest solution in your knowledge?

    Thank you for your feedback
     
    Last edited: Aug 18, 2018
  4. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,980
    When designing a multiplayer networking solution for a specific game, you want to come up with the most network efficient solution for your game. FPS and RTS games benefit from completely different designs. For an RTS style game, the best solution is a deterministic simulation where actions are replicated but not individual unit movements. This because there are usually lots of units in an RTS game. In a typical FPS style game, the individual unit movements are usually replicated, because an FPS usually has relatively few units and the priority is on rapid updates for those units.

    When somebody says to send the actions instead of the unit movements, that would mean sending the action request and then letting the deterministic simulation actually handle the individual unit movements. So in an RTS you might order a unit to attack a specific unit or to move to a specific location. That order is the action you would send over the network. You would not send transform updates for every game object every frame, because that would hurt the network performance and limit how many units could be managed that way. By sending only the action (order) and letting each client's deterministic simulation handle the actual frame by frame movements, you can drastically reduce network load in an RTS and support lots of units.
     
    hippocoder likes this.
  5. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    2,980
    The absolute cheapest solution for a 1v1 RTS game would be a custom UDP based networking solution you build yourself. You could develop your own STUN implementation to punch through NATs and routers. Create a simple matchmaking server, and then people play directly against each other P2P without any dedicated authoritative server.
     
  6. II_Spoon_II

    II_Spoon_II

    Joined:
    Jun 16, 2018
    Posts:
    180
    I got you, very well explained, thank you ^^

    I have never done such a thing, I am new to networking, I am a sfotware developer basically, but I will look into that and do a little bit of research thank you ^^

    If you have any other advises or opinions I would be glad to hear :)