Giter Site home page Giter Site logo

godot-multiplayer-starter-project's Introduction

Godot Multiplayer Starter Project

License: GPL v3 Godot Version Ask for help

Last commit

Get the README in your language

Or contribute by translating it !

🇫🇷 Français

Summary

This repo is a starter project (or boilerplate) for multiplayer networking in Godot. It uses a separated Server/Client structure which is different from what the Godot docs proposes.

Why ? Because for some projects, a confined Server/Client structure is really helpful, and I prefer to work that way. This way, you can control who gets access to what data and do server specific logic when you need to.

Contributing and asking for help

I'd be glad for anyone to contribute to this repository, don't hesitate to do a pull request or file an issue if you encounter any bug. You may also ask for help about Godot networking and this project.

It allows to run a custom headless server on a remote PC like a VPS and connecting to it.

Note: The headless mode for Godot doesn't work yet in 3.2.3. It's scheduled for 3.2.4. I'll try to update this repo if it gets interest. Please post an issue if you need this project in a version that isn't supported yet.

CLI Arguments

The main scene of this project is Start.tscn. It launches either the server or the client depending on CLI arguments. --server starts a headless server and --client starts the client. You can then create your own main scene from there.

If you want players to connect directly to one another, you can allow one player to host a server in-game by starting another instance of the game. For this to work, one of the players will have to configure port forwarding on their router, or use a VPN such as Tunngle or LogMeIn Hamachi (I prefer the latter).

How does this work ?

There are two autoloads : Server.tscn and Client.tscn. Each client scene (like the World.tscn example) may have a server-side script that will handle server-specific logic. Every client-side root scene should have a server-side script that will instantiate the scene on the server, as the scene tree must be the same on Client and Server.

Usage

Project

Import this project in Godot 3.2.3 and run it.

Scripts

The scripts located in scripts/ folder allow you to start multiple instances of the project without having to run the editor multiple times. They work for Windows and Linux (bash)

Prerequisite : You need to have godot as a command in your system's PATH variable.

godot-multiplayer-starter-project's People

Contributors

clorl avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.