Server platform on Java and client on Godot?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By FinFan

Greetings developers! Salute you!
If I create server platform on java (or another programming languege), and write client on GDScript it will work? Like Lineage 2 writed on UE2Script and private servers created on Java.

Thank you for attention and answer!

Ps> Sorry for my bad english!

:bust_in_silhouette: Reply From: Armynator

In theory it should work, maybe even by using the default StreamPeerTCP class. The better question is if this is a good idea, as this usually makes things unnecessarily complicated.

Whats your exact plan with this? From your interest in using Java as server I assume that you want a simple, lightweight console application without a lot of physics or math involved. In that case you also could use a simple C# console application as server instead, as Godot has (experimental) C# support already. You could easily create a shared library for server and client then to decrease your development time. C# and Java syntax are really similar anyways.

If you want an authoritative dedicated server with a full physics engine instead, it would make sense to use the same (or a new, secondary) Godot project for the server. That way you shouldn’t run into any compatibility issues if you are using GDScript (or C#) for both.

And if you are even talking about a more advanced MMO setup, further investigation is required first. In that case there are many things to consider, and multiple possible setups to choose from. But even in such a case I’d highly recommend to stay on the same language for all applications where possible. Not only to maintain compatibility between the projects, but also to avoid a lot of unnecessary work like converting primitive types, objects and classes between different languages.

Ok, I’ve got it.
Another question is: If I’ve start do it on Java i must create a network library using native? right? I mean, i cant do it on GDScript only, I shall use the native?

FinFan | 2019-11-25 16:34