THNK - Multiplayer made simple

Hello :wave:

You might have already seen the blog post on the GDevelop website it got, but it has not gotten properly introduced here on the forum yet. I began a few months ago THNK, a multiplayer games framework for GDevelop. It allows one to build scenes with an authoritative server-client architecture.

Those scenes can then be run normally in singleplayer, or run via an adapter extension, which allows to host a server and let clients connect to it. Currently, you can use the P2P adapter to connect players via P2P, or the Geckos adapter to connect them via the IP address of the server.

THNK’s multiplayer is optimized using a binary protocol, UDP-based networking in adapters, diff-based synchronisation, and more, to provide an experience as fast & low-latency as possible.

THNK’s multiplayer is also secure, by only having adapters that use encrypted connections, and by using the authoritative architecture which makes most forms of cheating hard or even impossible.

NOTE: THNK is still in preview phase, which means that it still lacks Core features and most likely has more thaan a few bugs. You can already play around with it and make working multiplayyer games using it, but for professional games that have a deadline and cannot tolerate having bugs, I’d advise waiting for at least the Beta release of THNK.

The Beta release will have all core features and aim at being bug-free. The reason why it would remain in beta stage is because after the core features, there remains a lot of additional features to add for the framework to be as easy & nice to use as possible.

You can learn more about it on:

And you can join the discord community for help, bugs reports, feature requests & talk with other users of THNK:

(Thanks @Midhil for the THNK logo and designs!)

13 Likes

So, this is the kind of framework we want to use to build mmo games like agar.io and such, right?
Awesome, keep up the great work. :slight_smile:

1 Like

Yep, although for something like agar.io you would need servers that are always running. I have a few projects to make that easier (and free) but they are not close enough to completion for me to say much about them yet :shushing_face:

5 Likes

I’m veeery excited for the THNK Cloud Adapter in the future :slight_smile:

2 Likes

Very interesting, thanks for making this. I have difficulty with some of the technical details so I’ll have to read up more.

Will this allow for a multiplayer game where 2 players can connect to each other automatically? So far I saw a tutorial video for an older method where player 1 generates a code which player 2 then has to enter into their client. Seemed like an outdated method to join an online game, like something out of the Napster era!

I just read about Photon too and someone on Discord said it can work through Gdevelop by using PUN but then I came to search for more info about it here on Gdevelop site and there’s no confirmation.

I believe you can store the available players’ codes in an array and pick at random if you want to connect any two people, but the manual code input is useful if you want to join a friend.

1 Like

THNK itself is a multiplayer framework - not a networking library. It allows you to build authoritative network-agnostic multiplayer-ready scenes for an arbitrary amount of players.
Connecting to a server is a different matter, that THNK addresses with separate extensions: network adapters.

Note that, at the end of the day, the internet is built so that to connect to anything or anyone, you need their IP address.
With the P2P adapter, likely what you have seen before, you connect using a simple code that allows the other peer to discover all of your IP addresses and proxies you can connect to, to connect directly (or through a proxy) to another player.
With the geckos adapter, you bind a server to your IP address and you share your IP address directly for other people to connect to.

To do “automatic connections”, you would need to pay for servers, run geckos servers on them, make players connect to a reverse proxy server’s IP, and reroute players to one of your geckos servers where they can play together.

I plan to make a THNK Cloud eventually that will do most of the hard work for you, but as of now, there is no easy (nor cheap) solution.

1 Like

Thanks, I’ll look into that some more. If it can connect to another player automatically, like a standard modern online game, that’s perfect.

This was the video I saw by The Gem Dev. Brilliant tutorial as usual, it’s just that the connection method seems quite prohibitive if you want to play against a complete stranger online. Looks like it’d only work if you gave the code to a friend.

Thanks I’ll look into that some more. I’m not up to scratch on some of the tech terms so I’ll re-read your post a few times and decipher it with some google searches. Very interesting nonetheless and appreciate the insight. :slight_smile:

Here is the information I received from someone else regarding Photon and PUN, I’m not sure if it’s misguided and inaccurate or if indeed it would work.

To add Photon and PUN (Photon Unity Networking) to GDevelop, you’ll need to download and import the Photon Unity Networking package. Here’s how you can do that:

  1. Download the Photon Unity Networking package from the Photon website (Photon Unity Networking for Unity Multiplayer Games | PUN2).
  2. In GDevelop, go to the “Extensions” menu and select “Import an extension”.
  3. In the file selector, navigate to the location where you downloaded the PUN package and select it.
  4. GDevelop will import the extension and make it available for use in your game.

Once the extension is imported, you can use the Photon and PUN classes and functions in your game. For example, you can use the PhotonNetwork.ConnectUsingSettings() function to connect to a Photon server, and the PhotonNetwork.Instantiate() function to instantiate networked objects in your game.

I don’t know who told you this, but I doubt it came from anyone with the slightest understanding of what they are talking about :skull: You most definitely cannot import a Unity package as a GDevelop extension, nor use C# code in GDevelop. GDevelop and Unity are not close to be related, and it is never going to be possible to use Photon’s Unity Networking package in GDevelop.

2 Likes
2 Likes

I’m not sure I understand this sentence. If we put our game on liluo or itch, can’t we use their servers for the multiplayer game?

Also do you have an example of a code using THNK? I read the docs on https://thnk.cloud/docs but it doesn’t show much. Or is there more docs somewhere else?

No, liluo and itch are just storage hosts. They do not provide servers to run data processing that a multiplayer server would nrequire.

3 Likes