A downloadable asset pack

Download NowName your own price

For more assets like this, follow my itch.io page!

This is a Godot Addon to easily connect devices on the same LAN network. Source-code is also available on Github: https://github.com/henriquelalves/GodotEasyLAN

How it works

This addon uses basic network setup by creating a 'Host' device that continuosly send UDP packets with it's own IP and a 'room password' for it's 'lobby'; the packet is sent to the 0.0.0.0 IP address of the router, which broadcast the packet to all devices connected on the same LAN. 'Client' devices will receive the packet and create a list of available hosts and their respective room passwords. When a Client connects to a Host, it uses the stored IP to create a connection using Godot high-level multiplayer API.

How to use

This addon only works on routers that allows hairpinning. This addon handles the creation and setup of Ǵodot's High-Level Multiplayer framework. The addon is composed of two nodes: a 'Host' node, and a 'Client' node. To connect different devices, you must setup a device to be a Host and the others to be Clients; after that, the Host has to start_broadcast to send to the Clients it's address information. A password is generated on the Host and sent to Clients, and should be visible to the players; to connect them, you should use connect_to_server_code on the Clients and use the password sent to the client as the argument (passwords are basically hashes of a Host IP Addresses dictionary). The Host should use stop_broadcast whenever it should stop sending the players its IP Address to start the game.

Basically:

  1. setup on Host and Clients devices.
  2. start_broadcast on Host device.
  3. connect_to_server_code on Client device, using the hash received by the server code.
  4. stop_broadcast on Host.

Demo project

This is a simple demo in which you must choose whether you'll be 'Host' or 'Client'; then, it estabilishes connection using the Addon. After players are connected to the host, it can start the 'game' by clicking Start, which will transfer all players connected to the game to a simple scene that synchronizes players mouse-clicks to move their Godot Icon.

License

All code and assets are under MIT license.


Download

Download NowName your own price

Click download now to get access to the following files:

godot-easy-lan-win-linux-mac-stable.zip 115 kB
Version 1

Comments

Log in with itch.io to leave a comment.

E