-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build GDNative client library #3205
Conversation
@geoffthemedio Is something should be done here? |
@o01eg I don't know... What's the point of this pull request? The GDNative library isn't used for anything as far as I know? |
2976ca3
to
11ae4b3
Compare
@o01eg, I'm on vacation now, so I have some time to look into this. Currently doing so, but it will take me some time to wrap my head around the code. Did you run into any issues so far? |
@Vezzra I don't have a big issues, but it would be nice to have a Maybe also some API guidance which functions, properties or signals to implement. |
Could you elaborate on what you mean by that? What API? What sort of "functions"? For what purpose would they be implemented or prioritized for implementing? |
Yes, which FreeOrion internal should be exposed via Godot API. Function are something to allow Godot code call some FreeOrion code. Currently OptionsDB exposed with functions. |
The UI needs to query and populate itself based on the gamestate, so it needs ways to look up UniverseObjects, Empires, Techs, BuildingTypes, Species, etc. It also needs to be able to issue orders, end the turn, send chat messages, request combat logs, and send various other network messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally got the time to try to use your GDNative client library with my FO Godot prototype.
It took me some time and fiddling to get it working, but I got there. I only did a first very basic test by adding a GDFreeOrion
node. This successfully initializes the basic app objects, reads and parses the content files, giving me an actually correctly initialized FO Godot client. 👍
There was only one issue with the GodotClientApp
object being initialized too late, see my comment on that line.
So, looks good so far, further tests should build on that. What we need next is exposing the ObjectMap
and the universe objects so we can test if we can create, insert and retrieve universe objects into the FO object map from Godot.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, works so far. Logging system is now initialized in time.
BTW, being experimental/used for testing purposes this PR should be set to draft, as it isn't meant to be actually merged.
I'm not entirely sure what you mean - do you mean you want these windows/dialogs in the prototype FO Godot client app? Are you asking me to provide them? What exactly do you need them to provide/do? |
I want to try Godot Android support so I need some UI to enter server address because I cannot start server on the "localhost" of Android phone. It's not crucial to move forward because I just can launch server with the game in "slow" mode and work with GAME_START message.
Do we have some minimal criteria? |
Added GAME_START message processing. |
Implemented launch single-player game. |
What do you mean? Minimal criteria for what? |
@Vezzra For merging it. Also I implemented access to systems but not sure how to draw them correctly. I suppose I should place camera somewhere. |
I want to suggest to move this branch to the main/upstream repository (freeorion/freeorion), for better collaboration. Rebasing should only happen rarely then, and only after giving a proper anouncement and enough time for collaborators to prepare (always working on top of the most recent master isn't necessary anyway for this prototype). I want to incorporate the Godot prototype app into the source tree and adjust the build scripts so work on this can proceed more smoothly. The PR will need to be adjusted of course, by switching the base branch. If that isn't possible, it will have to be closed and a new one opened. Would that be ok with you? |
Um, this is just work on an experimental prototype. We haven't even decided if we really want to switch to Godot, this prototype project is supposed to check if that is even possible/feasible.
Are you already working on your own Godot app? If you do, and reused mine as base, you shouldn't have to place a camera, my app already has that (of course, otherwise you wouldn't see anything). If you implemented your own scene for the galaxy map, then yes, you need to place a camera. And if you already made your own Godot app, shall we integrate yours into the source tree, or use mine? |
No, I opened PR in yours Vezzra/fo-godot-prototype#1
Yes, I moved camera back a lot until I see systems. |
Yes. |
Oh, oops, I completely missed that! Well, good, I guess I'll incorporate that version into the source tree, as it already integrates and uses your GDNative library.
Well, the scale of maps created by FO is very different to the scale I used in my prototype. Which means the values used for the camera need to be adjusted. Ok, if you're fine with moving the branch to the main repo, can you do that and adjust/reset the PR (or make a new one if necessary)? Also, push the most recent version of the Godot prototype you extended to your PR branch. I will then try to incorporate that into the branch you moved to the main repo. |
@o01eg, give me a short notification here when you're done. |
Yes, I cannot change source branch so I'll recreate PR. |
Superseded by #3235 |
Additional option to build GDNative library to use in Godot.
Adds option
BUILD_CLIENT_GODOT
(default OFF) andGODOT_CPP_ROOT
to point atgodot-cpp
repository.Exposes property
optionsDB
with methods to access FreeOrion's OptionsDB.Exposes property
networking
with methods to connect to the server. Incoming messages are emitsping
signal.Exposes some incoming network messages as signals on main node include
game_start
message.To test add
into
auth.txt
config file and start the server with./freeoriond --hostless -q --log-file /proc/self/fd/1 --setup.ai.player.count 0 --network.server.conn-human-empire-players.min 0 --network.server.unconn-human-empire-players.max 0
. This will start the game on the server and the only thing client need to do is to connect to the server.To test single player game place client binary into the same folder as freeoriond binary.
C++ sources of it got from https://github.com/Vezzra/fo-godot-prototype
Forum thread: https://freeorion.org/forum/viewtopic.php?f=9&t=11744