SlideShare a Scribd company logo
12
Most read
15
Most read
17
Most read
Real-time Online Multiplayer
with
by fales
February, 2017
1 Introduction
Goals
Problems
Guidelines
Common techniques
TCP vs UDP
2 Godot Low Level Networking
Server
Client
Problems
Solutions
3 Godot High Level Networking
Server
Client
Optimizations
4 Benet module
5 End
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Goals
Having multiple persons playing the same game together, on different
machines, through a network.
No apparent input delay: Players must feel like they are playing the
game on their computer
No apparent lag or video delay: Players should experience a good
simulation
No cheaters: Players should not be allowed to do or see anything besides
what allowed by the game
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
The Internet is not a pipe
This is wrong
This is more like it
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Problems
Networks are unreliable (packets can take different route and
arrive out of order or get lost)
Networks have limited data rate and can be slow or become
clogged
Networks add delay (even the light takes time, imagine a
decades old copper twisted pair)
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Guidelines
There is no one fit all solution.
It really depends on you game. (genre, mechanics, interactions).
There are a few general guidelines
Everything should happen on the server, clients are mere
dummy displays.
Clients should only send their inputs or commands (server
must discard disallowed commands)
Send as little data as possible as often as possible to keep
latency at a minimum for RT games.
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Common techniques
UDP Networking
State synchronization
Interpolation
Compression/Size optimizations
Lag compensation
Common techniques
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
TCP vs UDP
TCP
Connection based
Reliable delivery
Ordered delivery
High latency
UDP
Connectionless
Unreliable delivery
Unordered delivery
Low latency
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Godot low level UDP
Echo Server
var _clients = []
var _udp = PacketPeerUDP .new()
func _ready ():
_udp.listen (4321)
set_process (true)
func _process(delta ):
var msgs = []
while _udp. get_available_packet_count () > 0:
var pkt = _udp.get_var () # or get_packet ()
var ip = _udp. get_packet_ip ()
var port = _udp. get_packet_port ()
if _clients.find(ip + ":" + str(port )) == -1:
# New client
_clients.append(ip + ":" + str(port ))
# Prepare message to be broadcasted
msgs.append(ip + ":" + str(port) + "-" + str(pkt ))
# Broadcast messages
for c in _clients:
var splitted = c.split(":")
_udp. set_send_address (splitted [0], int(splitted [1]))
for msg in msgs:
_udp.put_var(msg)
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Godot low level UDP
Client
var _udp = PacketPeerUDP .new()
func _ready ():
_udp. set_send_address ("localhost" ,4321)
set_process (true)
func _process(delta ):
var msgs = []
while _udp. get_available_packet_count () > 0:
var pkt = _udp.get_var () # or get_packet ()
msgs.append("Server␣says:␣" + str(pkt ))
# Show messages
for msg in msgs:
print(msg)
func send_data(data ):
_udp.put_var(data) # or put_packet
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Problems with UDP
Detect client disconnection (ping/timeout)
Detect out of order packets (time sync)
Detect/resend packet lost if we want it to be reliable
(sequence/acks)
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Some solutions
Have the client sends some ping packet, if a ping is not
received by the server for more than X seconds, the client
is considered disconnected
Send and additional time value with packets you want to be
ordered. Keep the last received time, if you receive a lower
time, drop it. (see wrap)
Have the two parties add sequence numbers to pacekets and
send acknowledgment of received data. Keep a queue of
last sent/received packets. Stop sending until you receive an
ack for the lowest missing packet if the new packet has a
sequence number higher than the lowsest plus the ack window
size. Reorder received packets... mess!
Note: have a look at var2bytes and bytes2var
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Godot High Level Networking
Based on ENet library (might change in the future or on
specific platform)
Allow both reliable and unreliable communication over UDP
Based on RPC calls
See http://docs.godotengine.org/en/latest/tutorials/high level multiplayer.html
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Godot High Level Networking II
Node network modes:
Master: This node is considered master (this instance owns it)
Slave: This node is considered slave (someone else owns it)
RPC/RSET modes:
sync: called both locally and over network
remote: called only remotely (no matter the owner)
slave: the function will be called only on slave nodes
master: the function will be called only on the master node
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Server
func create_server ():
set_network_mode ( NETWORK_MODE_MASTER )
var host = NetworkedMultiplayerENet .new()
host. create_server (4321 , 4)
get_tree (). set_network_peer (host)
var time = 0
func update_remote_state (tick ): # Tick is ideally 20/30 FPS (ie. 0.05/0.03)
var state = []
# Parse the game state
# ... eg.
state.append(get_pos ())
state.append( get_linear_velocity ())
# Send RPC , called on the node with the SAME PATH in the client
time += 1
rpc_unreliable (" update_state ", time , tick , state)
slave func update_state (time , tick , state ):
# ... (see next slide)
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Client
func create_client ():
set_network_mode ( NETWORK_MODE_SLAVE )
var client = NetworkedMultiplayerENet .new()
client. create_client ("127.0.0.1", 4321)
get_tree (). set_network_peer (client)
var last_time = 0
slave func update_state (time , tick , state ):
# Handle wrap -around , see rfc1185 as reference
if last_time >= time: # Out of order packet ... drop
return
last_time = time
# Handle state update here eg. tween this object
get_node("Tween"). stop_all ()
get_node("Tween"). interpolate_method (self , "set_pos",
get_pos (), state [0], tick ,
Tween.TRANS_LINEAR , Tween.EASE_IN)
get_node("Tween"). interpolate_method (self , " set_linear_velocity ",
get_linear_velocity (), state [1], tick ,
Tween.TRANS_LINEAR , Tween.EASE_IN)
get_node("Tween"). start ()
Note: the node that makes the RPC MUST have the same node path for in
both server and client for this to work
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Optimizations?
Try to bundle homogeneous data in the same state update
(but make sure the maximum packet size will be less than
400-450 bytes, or it might get dropped).
Optimize your state update! (see note, eg. boolean can be 1
byte instead of 4)
Use prediction!
Instead of interpolating recv pos and recv vel, interpolate to recv pos
+ recv vel * tick , and keep predicting till next frame
Note: http://docs.godotengine.org/en/stable/reference/binary serialization api.html
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Benet module
Developed to use ENet at full power
Does not use RPC (unless you want to)
Allow for broadcast send (to specific client)
Uses signals to notify of recv packets, clients
connect/disconnect
Allow for unreliable but ordered channels (you don’t have to
manage time)
Allows multiple channels
Github: https://github.com/Faless/godot-enet-better
Note: will likely not be included in Godot, I’m looking to port it to the C API
by karroffel and bojidar-bg when it’s ready
Real-time Online Multiplayer with Godot Engine fales
Introduction Godot Low Level Networking Godot High Level Networking Benet module End
Thanks for your time!
Questions?
Useful link:
http://gafferongames.com/networking-for-game-programmers/
Gaffer on Games - Game Networking
https://developer.valvesoftware.com/wiki/Lag compensation
Valve Wiki - Lag compensation
Full working demos in this presentation: https://github.com/Faless/godotcon-multiplayer
Real-time Online Multiplayer with Godot Engine fales

More Related Content

PDF
ブループリント+ビジュアルスクリプトと仲良くやる方法
PDF
Press Button, Drink Coffee : An Overview of UE4 build pipeline and maintenance
PDF
Game design - Retention
PPTX
Unity - Game Engine
PDF
게임제작개론 : #8 게임 제작 프로세스
PPTX
Unity 3D
PPTX
Modular Level Design for Skyrim
PPTX
Scene Graphs & Component Based Game Engines
ブループリント+ビジュアルスクリプトと仲良くやる方法
Press Button, Drink Coffee : An Overview of UE4 build pipeline and maintenance
Game design - Retention
Unity - Game Engine
게임제작개론 : #8 게임 제작 프로세스
Unity 3D
Modular Level Design for Skyrim
Scene Graphs & Component Based Game Engines

What's hot (20)

PPTX
Zookeeper 활용 nifi clustering
PDF
게임제작개론: #1 게임 구성 요소의 이해
PPTX
[IGC 2017] 넥슨코리아 심재근 - 시스템 기획자에 대한 기본 지식과 준비과정
PDF
게임서버 구축 방법비교 : GBaaS vs. Self-hosting
PDF
シェーダ体系の話
PPTX
레벨 디자인의 구성
PDF
임태현, MMO 서버 개발 포스트 모템, NDC2012
PPTX
이봄, 스토리텔링으로 즐기는 콘서트 - 시나리오 기획자를 위한 TRPG의 세계, NDC2019
PDF
모두의 마블 부분 유료화 아이템 제안서(고유 랜드마크) Ver.1.0.0
PPTX
[IGC 2017] 넥슨코리아 오현근 - 평생 게임 기획자 하기
PDF
우리가지킬고양 게임소개서
PDF
게임 시스템 디자인 시작하기
PPTX
레벨기획 프론티어 온라인 '이름없는 동굴' 던전_v2
PDF
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
PDF
프로그래머에게 사랑받는 게임 기획서 작성법
PPTX
Game Design Document - Step by Step Guide
PDF
양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012
PPTX
Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]
PDF
졸업작품을 앞둔 게임 기획/프로그래밍 전공 교류회
PPTX
우리 프로젝트에 맞는 게임 엔진 - 테크니컬아트디렉터 김태근
Zookeeper 활용 nifi clustering
게임제작개론: #1 게임 구성 요소의 이해
[IGC 2017] 넥슨코리아 심재근 - 시스템 기획자에 대한 기본 지식과 준비과정
게임서버 구축 방법비교 : GBaaS vs. Self-hosting
シェーダ体系の話
레벨 디자인의 구성
임태현, MMO 서버 개발 포스트 모템, NDC2012
이봄, 스토리텔링으로 즐기는 콘서트 - 시나리오 기획자를 위한 TRPG의 세계, NDC2019
모두의 마블 부분 유료화 아이템 제안서(고유 랜드마크) Ver.1.0.0
[IGC 2017] 넥슨코리아 오현근 - 평생 게임 기획자 하기
우리가지킬고양 게임소개서
게임 시스템 디자인 시작하기
레벨기획 프론티어 온라인 '이름없는 동굴' 던전_v2
오딘: 발할라 라이징 MMORPG의 성능 최적화 사례 공유 [카카오게임즈 - 레벨 300] - 발표자: 김문권, 팀장, 라이온하트 스튜디오...
프로그래머에게 사랑받는 게임 기획서 작성법
Game Design Document - Step by Step Guide
양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012
Unity 2018-2019を見据えたDeNAのUnity開発のこれから [DeNA TechCon 2019]
졸업작품을 앞둔 게임 기획/프로그래밍 전공 교류회
우리 프로젝트에 맞는 게임 엔진 - 테크니컬아트디렉터 김태근
Ad

Similar to Real-time Online Multiplayer with Godot Engine (20)

PPT
Realtime html5 multiplayer_games_with_node_js
PDF
Lets Play Together
PDF
Basic Multiplayer Online Game with Node.js & dgt-net
PPT
Multiplayer Games Chapter 6 Network Topologies.ppt
PPTX
Developing Multiplayer Games in Unity3D
PPTX
Networking Architecture of Warframe
PDF
Scalability & Big Data challenges in real time multiplayer games
PPT
Realtime html5 multiplayer_games_with_node_js
PDF
Akka for realtime multiplayer mobile games
PDF
Akka for realtime multiplayer mobile games
PPTX
Game Networking for Online games
PDF
38199728 multi-player-tutorial
PPTX
Hadean: How We Tackled A Gaming World Record
PPT
NetRacer for the Commodore 64
PPTX
Photon Session / Unite12 Conference
PDF
Jan Hloušek, Keen Software House
PDF
Tech solutions and tricks in real time mobile multiplayer
PDF
Rawkets: An inside look at a multiplayer HTML5 game
PDF
Мультиплеер на Go+Lua / Sergey Lerg (Spiral Code Studio)
PDF
Introduction to the Unreal Development Kit
Realtime html5 multiplayer_games_with_node_js
Lets Play Together
Basic Multiplayer Online Game with Node.js & dgt-net
Multiplayer Games Chapter 6 Network Topologies.ppt
Developing Multiplayer Games in Unity3D
Networking Architecture of Warframe
Scalability & Big Data challenges in real time multiplayer games
Realtime html5 multiplayer_games_with_node_js
Akka for realtime multiplayer mobile games
Akka for realtime multiplayer mobile games
Game Networking for Online games
38199728 multi-player-tutorial
Hadean: How We Tackled A Gaming World Record
NetRacer for the Commodore 64
Photon Session / Unite12 Conference
Jan Hloušek, Keen Software House
Tech solutions and tricks in real time mobile multiplayer
Rawkets: An inside look at a multiplayer HTML5 game
Мультиплеер на Go+Lua / Sergey Lerg (Spiral Code Studio)
Introduction to the Unreal Development Kit
Ad

Recently uploaded (20)

PPTX
ai tools demonstartion for schools and inter college
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
assetexplorer- product-overview - presentation
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
Adobe Illustrator 28.6 Crack My Vision of Vector Design
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
wealthsignaloriginal-com-DS-text-... (1).pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
Digital Strategies for Manufacturing Companies
PDF
Digital Systems & Binary Numbers (comprehensive )
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PPTX
history of c programming in notes for students .pptx
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
System and Network Administration Chapter 2
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PPT
Introduction Database Management System for Course Database
ai tools demonstartion for schools and inter college
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Navsoft: AI-Powered Business Solutions & Custom Software Development
assetexplorer- product-overview - presentation
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
Adobe Illustrator 28.6 Crack My Vision of Vector Design
Wondershare Filmora 15 Crack With Activation Key [2025
wealthsignaloriginal-com-DS-text-... (1).pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Digital Strategies for Manufacturing Companies
Digital Systems & Binary Numbers (comprehensive )
CHAPTER 2 - PM Management and IT Context
How to Choose the Right IT Partner for Your Business in Malaysia
history of c programming in notes for students .pptx
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
System and Network Administration Chapter 2
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
Introduction Database Management System for Course Database

Real-time Online Multiplayer with Godot Engine

  • 2. 1 Introduction Goals Problems Guidelines Common techniques TCP vs UDP 2 Godot Low Level Networking Server Client Problems Solutions 3 Godot High Level Networking Server Client Optimizations 4 Benet module 5 End Real-time Online Multiplayer with Godot Engine fales
  • 3. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Goals Having multiple persons playing the same game together, on different machines, through a network. No apparent input delay: Players must feel like they are playing the game on their computer No apparent lag or video delay: Players should experience a good simulation No cheaters: Players should not be allowed to do or see anything besides what allowed by the game Real-time Online Multiplayer with Godot Engine fales
  • 4. Introduction Godot Low Level Networking Godot High Level Networking Benet module End The Internet is not a pipe This is wrong This is more like it Real-time Online Multiplayer with Godot Engine fales
  • 5. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Problems Networks are unreliable (packets can take different route and arrive out of order or get lost) Networks have limited data rate and can be slow or become clogged Networks add delay (even the light takes time, imagine a decades old copper twisted pair) Real-time Online Multiplayer with Godot Engine fales
  • 6. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Guidelines There is no one fit all solution. It really depends on you game. (genre, mechanics, interactions). There are a few general guidelines Everything should happen on the server, clients are mere dummy displays. Clients should only send their inputs or commands (server must discard disallowed commands) Send as little data as possible as often as possible to keep latency at a minimum for RT games. Real-time Online Multiplayer with Godot Engine fales
  • 7. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Common techniques UDP Networking State synchronization Interpolation Compression/Size optimizations Lag compensation Common techniques Real-time Online Multiplayer with Godot Engine fales
  • 8. Introduction Godot Low Level Networking Godot High Level Networking Benet module End TCP vs UDP TCP Connection based Reliable delivery Ordered delivery High latency UDP Connectionless Unreliable delivery Unordered delivery Low latency Real-time Online Multiplayer with Godot Engine fales
  • 9. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Godot low level UDP Echo Server var _clients = [] var _udp = PacketPeerUDP .new() func _ready (): _udp.listen (4321) set_process (true) func _process(delta ): var msgs = [] while _udp. get_available_packet_count () > 0: var pkt = _udp.get_var () # or get_packet () var ip = _udp. get_packet_ip () var port = _udp. get_packet_port () if _clients.find(ip + ":" + str(port )) == -1: # New client _clients.append(ip + ":" + str(port )) # Prepare message to be broadcasted msgs.append(ip + ":" + str(port) + "-" + str(pkt )) # Broadcast messages for c in _clients: var splitted = c.split(":") _udp. set_send_address (splitted [0], int(splitted [1])) for msg in msgs: _udp.put_var(msg) Real-time Online Multiplayer with Godot Engine fales
  • 10. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Godot low level UDP Client var _udp = PacketPeerUDP .new() func _ready (): _udp. set_send_address ("localhost" ,4321) set_process (true) func _process(delta ): var msgs = [] while _udp. get_available_packet_count () > 0: var pkt = _udp.get_var () # or get_packet () msgs.append("Server␣says:␣" + str(pkt )) # Show messages for msg in msgs: print(msg) func send_data(data ): _udp.put_var(data) # or put_packet Real-time Online Multiplayer with Godot Engine fales
  • 11. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Problems with UDP Detect client disconnection (ping/timeout) Detect out of order packets (time sync) Detect/resend packet lost if we want it to be reliable (sequence/acks) Real-time Online Multiplayer with Godot Engine fales
  • 12. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Some solutions Have the client sends some ping packet, if a ping is not received by the server for more than X seconds, the client is considered disconnected Send and additional time value with packets you want to be ordered. Keep the last received time, if you receive a lower time, drop it. (see wrap) Have the two parties add sequence numbers to pacekets and send acknowledgment of received data. Keep a queue of last sent/received packets. Stop sending until you receive an ack for the lowest missing packet if the new packet has a sequence number higher than the lowsest plus the ack window size. Reorder received packets... mess! Note: have a look at var2bytes and bytes2var Real-time Online Multiplayer with Godot Engine fales
  • 13. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Godot High Level Networking Based on ENet library (might change in the future or on specific platform) Allow both reliable and unreliable communication over UDP Based on RPC calls See http://docs.godotengine.org/en/latest/tutorials/high level multiplayer.html Real-time Online Multiplayer with Godot Engine fales
  • 14. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Godot High Level Networking II Node network modes: Master: This node is considered master (this instance owns it) Slave: This node is considered slave (someone else owns it) RPC/RSET modes: sync: called both locally and over network remote: called only remotely (no matter the owner) slave: the function will be called only on slave nodes master: the function will be called only on the master node Real-time Online Multiplayer with Godot Engine fales
  • 15. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Server func create_server (): set_network_mode ( NETWORK_MODE_MASTER ) var host = NetworkedMultiplayerENet .new() host. create_server (4321 , 4) get_tree (). set_network_peer (host) var time = 0 func update_remote_state (tick ): # Tick is ideally 20/30 FPS (ie. 0.05/0.03) var state = [] # Parse the game state # ... eg. state.append(get_pos ()) state.append( get_linear_velocity ()) # Send RPC , called on the node with the SAME PATH in the client time += 1 rpc_unreliable (" update_state ", time , tick , state) slave func update_state (time , tick , state ): # ... (see next slide) Real-time Online Multiplayer with Godot Engine fales
  • 16. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Client func create_client (): set_network_mode ( NETWORK_MODE_SLAVE ) var client = NetworkedMultiplayerENet .new() client. create_client ("127.0.0.1", 4321) get_tree (). set_network_peer (client) var last_time = 0 slave func update_state (time , tick , state ): # Handle wrap -around , see rfc1185 as reference if last_time >= time: # Out of order packet ... drop return last_time = time # Handle state update here eg. tween this object get_node("Tween"). stop_all () get_node("Tween"). interpolate_method (self , "set_pos", get_pos (), state [0], tick , Tween.TRANS_LINEAR , Tween.EASE_IN) get_node("Tween"). interpolate_method (self , " set_linear_velocity ", get_linear_velocity (), state [1], tick , Tween.TRANS_LINEAR , Tween.EASE_IN) get_node("Tween"). start () Note: the node that makes the RPC MUST have the same node path for in both server and client for this to work Real-time Online Multiplayer with Godot Engine fales
  • 17. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Optimizations? Try to bundle homogeneous data in the same state update (but make sure the maximum packet size will be less than 400-450 bytes, or it might get dropped). Optimize your state update! (see note, eg. boolean can be 1 byte instead of 4) Use prediction! Instead of interpolating recv pos and recv vel, interpolate to recv pos + recv vel * tick , and keep predicting till next frame Note: http://docs.godotengine.org/en/stable/reference/binary serialization api.html Real-time Online Multiplayer with Godot Engine fales
  • 18. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Benet module Developed to use ENet at full power Does not use RPC (unless you want to) Allow for broadcast send (to specific client) Uses signals to notify of recv packets, clients connect/disconnect Allow for unreliable but ordered channels (you don’t have to manage time) Allows multiple channels Github: https://github.com/Faless/godot-enet-better Note: will likely not be included in Godot, I’m looking to port it to the C API by karroffel and bojidar-bg when it’s ready Real-time Online Multiplayer with Godot Engine fales
  • 19. Introduction Godot Low Level Networking Godot High Level Networking Benet module End Thanks for your time! Questions? Useful link: http://gafferongames.com/networking-for-game-programmers/ Gaffer on Games - Game Networking https://developer.valvesoftware.com/wiki/Lag compensation Valve Wiki - Lag compensation Full working demos in this presentation: https://github.com/Faless/godotcon-multiplayer Real-time Online Multiplayer with Godot Engine fales