Potential GiGi replacements: Godot

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
User avatar
Vezzra
Release Manager, Design
Posts: 6090
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Potential GiGi replacements: Godot

#1 Post by Vezzra »

This thread is dedicated to the discussion of the Godot engine as a potential replacement for GiGi.

Godot has been suggested repeatedly, here on the forum and in our online voice chat meetings. To investigate the capabilities of Godot and how well it might be suited for FO I made a very rudimentary prototype FO Godot client:

https://github.com/Vezzra/fo-godot-prototype

The report of my findings had been discussed at the July 29th 2020 online voice chat meeting. To quote the summary I posted on the online voice chat thread:
Vezzra wrote: Thu Jul 30, 2020 11:54 amGodot: based on the prototype FO Godot client I implemented over the past two weeks, it looks like Godot could meet all our (GUI) needs, and rewriting the FO client as a Godot app should be actually doable - the effort, while certainly considerable, should be managable with the manpower at our disposal (as far as it's possible to tell at this point).

There are however certain issues/questions that need to be addressed:
  • Godot uses SCons as build tool, C++ modules that interface with Godot will be build by Godot using SCons. The question is, to what degree is it possible to integrate building a FO Godot client into our CMake build system, so you can build FO with just calling cmake and invoke building the client from cmake, and not having to separatly build the client first.
  • How much control do we have over the main GUI loop - can we completely separate the loop handling all the networking and serialization stuff into a dedicated thread?
  • Godot sticks to the C++03 standard. How much does that impact our C++ code? Can we still use more recent C++ standards? Or, to what degree (meaning, what parts of our C++ code) would we be forced to go back to C++03? As that would be a dealbreaker right there.
The answers and discussion of these concerns/issues and other ones that might arise or been brought up shall happen here. Please post your questions, comments, opinions.

User avatar
Vezzra
Release Manager, Design
Posts: 6090
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Potential GiGi replacements: Godot

#2 Post by Vezzra »

Regarding the concerns raised about Godot sticking to C++03 and how much that will affect our C++ codebase, I think I found a satisfactory answer.

The Godot documentation provides tutorials on the topic of integrating/interfacing with C++ code, and in those tutorials they also provide a template SConstruct to build the tutorial examples. This SConstruct file contains the following line to set the C++ standard the compiler should use:

Code: Select all

    env.Append(CXXFLAGS=['-std=c++17'])
I think that strongly indicates that, at least as far as this form of using Godot with C++ modules is concerned, there are no constraints at all regarding the C++ standards we can use.

@Marcel, does that sufficiently address your concerns about the C++ standards?

User avatar
Vezzra
Release Manager, Design
Posts: 6090
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Potential GiGi replacements: Godot

#3 Post by Vezzra »

Another more specific question that had been raised was about the ability to create more sophisticated text controls. Meaning, a GUI control for displaying text that offers the possibility to format text, add images, etc., basically what we need to implement our Pedia.

Here are two links to the Godot documentation about the built-in RichTextLabel control, which should cover all our needs here:

Tutorial: https://docs.godotengine.org/en/stable/ ... label.html
Class Reference: https://docs.godotengine.org/en/stable/ ... label.html

Geoff, I hope this gives you a sufficiently comprehensive idea/answer if that control can do what we need.

User avatar
em3
Vacuum Dragon
Posts: 630
Joined: Sun Sep 25, 2011 2:51 pm

Re: Potential GiGi replacements: Godot

#4 Post by em3 »

Vezzra wrote: Fri Jul 31, 2020 1:02 pmGodot uses SCons as build tool, C++ modules that interface with Godot will be build by Godot using SCons. The question is, to what degree is it possible to integrate building a FO Godot client into our CMake build system, so you can build FO with just calling cmake and invoke building the client from cmake, and not having to separatly build the client first.
That's not really the case anymore, is it? If I recall, recently (subjectively recently, I didn't read the forums for a couple months), the CMake build chain was abandoned on Windows?

EDIT:I stand corrected. Thank you Geoff for pointing me to the relevant post.

I personally like SCons, as that's the build tool I most often use at work. I can see it as something that can be configured through CMake, I guess. CMake would need to generate a python script that sets some variables and it should be good to go.
https://github.com/mmoderau
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#5 Post by o01eg »

Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

User avatar
em3
Vacuum Dragon
Posts: 630
Joined: Sun Sep 25, 2011 2:51 pm

Re: Potential GiGi replacements: Godot

#6 Post by em3 »

o01eg wrote: Wed Aug 05, 2020 1:07 pm Looks like some games also migrates to Godot: https://github.com/unknown-horizons/godot-port and https://github.com/wesnoth/haldric
Wesnoth? Well, I'd never!
Didn't know the first one.
https://github.com/mmoderau
[...] for Man has earned his right to hold this planet against all comers, by virtue of occasionally producing someone totally batshit insane. - Randall Munroe, title text to xkcd #556

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#7 Post by o01eg »

em3 wrote: Wed Aug 05, 2020 1:16 pm
o01eg wrote: Wed Aug 05, 2020 1:07 pm Looks like some games also migrates to Godot: https://github.com/unknown-horizons/godot-port and https://github.com/wesnoth/haldric
Wesnoth? Well, I'd never!
Didn't know the first one.
Nice Anno clone written with python and fifengine.
It looks like they moved entirely not only some part of game, and wesnoth uses its own UI library like FO.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

skyace65
Space Krill
Posts: 2
Joined: Thu Apr 18, 2019 2:30 am

Re: Potential GiGi replacements: Godot

#8 Post by skyace65 »

I contribute to Godot's documentation. Were there any specific pages you found lacking that could be improved?

User avatar
Vezzra
Release Manager, Design
Posts: 6090
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Potential GiGi replacements: Godot

#9 Post by Vezzra »

skyace65 wrote: Thu Aug 20, 2020 3:21 pm I contribute to Godot's documentation. Were there any specific pages you found lacking that could be improved?
As far as I can tell, the Godot documentation is quite good. As with all open source projects in active development, there certainly is enough room for improvement.

I can't really point to a specific thing I'd found lacking of the top of my head though. When I'm stumbling accross something, I'll get back to you. :wink:

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#10 Post by o01eg »

I went other way and tried to build GDNative library in main repository: https://github.com/freeorion/freeorion/pull/3205
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#11 Post by o01eg »

skyace65 wrote: Thu Aug 20, 2020 3:21 pm I contribute to Godot's documentation. Were there any specific pages you found lacking that could be improved?
GDNative C++ is poorly documented. I have the entry object derived from Node, I have the object derived from Reference and I have no idea how to expose this Reference to the godot script without segfaults.
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#12 Post by o01eg »

Looks like some people also use Godot as GUI Engine: https://mdco2.mini.debconf.org/talks/17 ... mplex-gui/
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Ophiuchus
Programmer
Posts: 3427
Joined: Tue Sep 30, 2014 10:01 am
Location: Wall IV

Re: Potential GiGi replacements: Godot

#13 Post by Ophiuchus »

o01eg wrote: Thu Nov 12, 2020 1:01 pm Looks like some people also use Godot as GUI Engine: https://mdco2.mini.debconf.org/talks/17 ... mplex-gui/
A trello clone in godot? Love it <3
Any code or patches in anything posted here is released under the CC and GPL licences in use for the FO project.

Look, ma... four combat bouts!

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#14 Post by o01eg »

Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

o01eg
Programmer
Posts: 1998
Joined: Sat Dec 10, 2011 5:46 am

Re: Potential GiGi replacements: Godot

#15 Post by o01eg »

Created PPA for Godot client build for Ubuntu 20.04 Focal. Do we have news about snap distribution?
Gentoo Linux x64, gcc-11.2, boost-1.78.0
Ubuntu Server 22.04 x64, gcc-12, boost-1.74.0
Welcome to the slow multiplayer game at freeorion-lt.dedyn.io.Version 2024-01-30.0dd6806.
Donations're welcome:BTC:bc1q007qldm6eppqcukewtfkfcj0naut9njj7audnm

Post Reply