Unity3d多人游戏手机游戏需要通信堆栈

时间:2015-10-30 11:18:27

标签: unity3d scale multiplayer

我目前正在使用Unity3d中的mutliplayer游戏,具有以下要求:

  • 在Unity3d中开发(专为Android,iOS和WebGL构建)
  • 必须在端口80上连接以支持大多数防火墙(学校,办公室等)
  • 游戏分为房间(同一房间最多5名玩家)
  • 发送的邮件数量非常少(每5秒1-2左右)
  • 全双工通信(客户端 - >服务器,服务器 - >客户端)
  • 服务器端需要能够水平扩展并支持大量CCU(显然不是用Unity编写的)
  • 在移动网络上运作良好,假设某些玩家的连接不良

为了简单起见,Clash of Clans'的沟通方式几乎相同。

我目前正在考虑通信技术堆栈最适合支持所有产品规格。

2 个答案:

答案 0 :(得分:0)

Currently this is what I'm considering:

Current tech stack idea

  1. Players will connect using WebSockets on port 80
  2. Host our game servers on stateless machines with session stickiness enabled
  3. Have a centralized cache layer (Servers first try to load data from here)
  4. Have a persistent DB layer (If we get a cache miss, load from DB)
  5. Any changes in a room's state in a server will fire a pub/sub event to update any existing player connections on other servers

I would be happy to hear if anyone has a better idea that can answer my requirements any better.

答案 1 :(得分:0)

Not sure if you want to code the communication stack by yourself. If you want to look at third party solutions, did you check SmartFoxServer?