Skip to content

Unity Networking

JungSu Kim edited this page Jan 27, 2016 · 2 revisions

Reference

TODO

  • 유니티 네트워크 시스템의 키워드의 의미 이해하기
  • High Level API 사용방법 익히기
  • Low Level API 사용방법 익히기
  • 매칭 시스템 이해하기
  • 로비매니저 이해하기
  • 서버 모드로 실행하는 방법 알아보기

Networking Overview

High level scripting API

  • Control the networked state of the game using a “Network Manager”.
  • Operate “client hosted” games, where the host is also a player client.
  • Serialize data using a general-purpose serializer.
  • Send and receive network messages.
  • Send networked commands from clients to servers.
  • Make remote procedure calls (RPCs) from servers to clients.
  • Send networked events from servers to clients.

Engine and Editor integration

  • A NetworkIdentity component for networked objects.
  • A NetworkBehaviour for networked scripts.
  • Configurable automatic synchronization of object transforms.
  • Automatic synchronization of script variables.
  • Support for placing networked objects in Unity scenes.
  • Network components

Internet Services

  • Matchmaking service
  • Create matches and advertise matches.
  • List available matches and join matches.
  • Relay server
  • Game-play over internet with no dedicated server.
  • Routing of messages for participants of matches.

NetworkTransport real-time transport layer

  • Optimized UDP based protocol.
  • Multi-channel design to avoid head-of-line blocking issues
  • Support for a variety of levels of Quality of Service (QoS) per channel.
  • Flexible network topology that supports peer-to-peer or client-server architectures.

Sample Projects

  • Multiplayer 2D Tanks example game
  • Multiplayer Invaders game with Matchmaking
  • Multiplayer 2D space shooter with Matchmaking
  • Minimal Multiplayer project

Networking Components

  • Network Animator
  • NetworkBehaviour
  • NetworkClient
  • NetworkConnection
  • NetworkDiscovery
  • NetworkIdentity
  • Network Lobby Manager
  • Network Lobby Player
  • NetworkManager
  • Network Manager HUD
  • Network Proximity Checker
  • NetworkReader
  • NetworkServer
  • NetworkStartPosition
  • NetworkTransform
  • NetworkTransformChild
  • NetworkTransformVisualizer
  • NetworkTransport
  • NetworkWriter

High Level API

  • Using the NetworkManager
  • Object Spawning
  • State Synchronization
  • Remote Actions
  • Player Objects
  • Object Visibility
  • Network Messages
  • Matchmaker
  • Scene Objects
  • Converting a Single Player Game to Multiplayer
  • Multiplayer Lobby
  • Network Clients and Servers
  • Host Migration

Using the Transport Layer API

  • Features
    • Establishing Connections
    • Communicating using a variety of “quality of services”
    • Flow control
    • Base statistics
    • Additional services like communication via relay server or local discovery
  • Workflow
    • Initialize the Network Transport Layer
    • Configure network topology
    • Create Host
    • Start communication (handling connections and sending/receiving messages)
    • Shut down library after use.

Internet Services

  • Matchmaking service
  • Relay server

WWW => UnityWebRequest

Clone this wiki locally