Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | jarek |
Hi, I’m new to Godot, and after few days of browsing through networking examples, it still confusing.
I’m thinking of a game, that will require a Godot client with GUI, and a server that processes the logic and stores user data.
It’s not going to be very interactive, users don’t need to communicate with each other a lot, they can do through the server, so no p2p between users. Network traffic also not going to be very heavy for each user. I was thinking of exchanging json formatted messages between client a server.
Once the game gets popular, though, the server must be able to support many clients (lots! hopefully :))
Because the server uses no GUI, and should be conservative on resources to handle many clients, I was considering to use c++ implemented server, but it’s not a must. I realize it makes impossible to use mid/high level networking APIs from Godot. But it lets me more easily implement complex logic, stay efficient and easily store many users’ data locally with fine controlled memory management etc. I’m proficient in C++ so I’m not worried it’s gonna be all easy to me.
I just wonder, what’s gonna be more difficult:
A) Godot server and then handling server side optimizations for heavy load, much data, saving it and serving to clients, plus processing game logic.
B) Optimized c++ server, but more complex network that must be implemented on lower level also on the user side.
C) Use Godot server for network with Native logic…?
Thanks in advance for any hints and ideas to consider.
It seems that your server doesn’t need to be done in Godot. Why not use a classic server language. Maybe combined with a database? (I.e. MariaDB / MySql)
It would be easier to scale such a server up or move it on some rented space / cloud service.
Languages could be PHP or RUST and many other (i.e. Node.js, Java (JSP), even Python).
All those should deal well with json data structures via http requests.
wombatstampede | 2020-01-16 07:23
From my point of view c++ or java doesn’t make much difference (I have tons of professional c++ experience, making games for fun in free time). C++ gives me much better control of resources consumed…
PHP or Node.js or even Python - would that be any different from Godot based server in terms of resource consumption? If not, I can just use Godot, right?..
jarek | 2020-01-16 21:07
For Godot, there’s a “headless” export template for linux’es. Which is usually the OS of choice for web servers.
While i.e. PHP + Nginx (+ maybe MariaDB) might be a convenient, flexible & robust start for servers (often such software come preloadable/preinstalled). C++ will actually be more effective on the performance side. But an own C++ server would be a more proprietary way (Godot as well) which might (or might not) pose problems when porting to other servers/cloud services.
wombatstampede | 2020-01-17 08:03