Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Basic Networking

Discussion in 'Multiplayer' started by gizzerd91, Dec 25, 2008.

  1. gizzerd91

    gizzerd91

    Joined:
    May 4, 2008
    Posts:
    311
    I've never really gotten into networking in Unity, and now I'm diving in to a super complex thing. :(. But I need to start thinking about it. I need to network an RTS. I figure I just have each unit send a quick message with it's xpos, ypos, and the other computer updates as appropriate. Every message is prefaced with the units unitID, a unique int for each unit, so that the computer knows where to put its new info. Then whenever there's a change in health, who its attacking, or where its moving to, or what move it just used, then it will be sent in the same way. As I write this down I'm realizing that the position could be done the same way. The trouble is, I need a way for the computer to keep almost 500 units in sync. I was looking through the docs, and there's nothing there about how to send a text message to another computer.

    My question:
    How do you (in javascript) send a text message to another computer, and have that computer receive it?
     
  2. Quietus2

    Quietus2

    Joined:
    Mar 28, 2008
    Posts:
    2,058
  3. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Please make sure to post in appropriate areas here on the forums, specifically this one should have been posted in the Networking Multiplayer section. Moving in 3... 2... 1...