Porting to Godot - a few beginner's questions

Porting to Godot - a few beginner's questions

Postby forum » 05 Aug 2020, 14:54

Hello,

I run Windows 10 Pro 64bit with 8 GM RAM (and also Debian and Ubuntu as VMs on a Synology DS918+).
I have no experience with Godot (or other programming/coding), but would like to help as far as I can.
I know (with a little help) how to compile stuff on Linux, have TurtoiseSVN and svn/git stuff ready in Windows and Linux.
So I was able to build SuperTuxKart (also here on FreeGameDev) for Linux and even Android.

Which Godot version shall I use for Unknown Horizons? (well, actually for first playing around a bit with Godot) The latest 3.2.2?
Shall I use the Standard version or the Mono version (C# support)?
Godot 32 or 64bit?


By the way, the link for the Wiki...
https://github.com/unknown-horizons/godot-port/wiki

... goes back to the main project page:
https://github.com/unknown-horizons/godot-port/

So is the Wiki at this point in time not yet setup/empty, or am I missing something?

What exactly is the task of a design document writer?

Thank you!
Best regards, 7wells
forum
 
Posts: 148
Joined: 04 May 2020, 12:29

Re: Porting to Godot - a few beginner's questions

Postby forum » 05 Aug 2020, 15:37

I start a new post for ease of commenting. ;)

From build.sh
{l Code}: {l Select All Code}
# Look for the Godot binary.
if [ -f "$GODOT" ]; then
    : # Do nothing. It's already a valid path.
elif [ -f "$HOME/.local/share/Godot/$GODOT/Godot" ]; then
    GODOT="$HOME/.local/share/Godot/$GODOT/Godot"
elif [ -f "$HOME/.local/bin/Godot/$GODOT/Godot" ]; then
    GODOT="$HOME/.local/bin/Godot/$GODOT/Godot"
elif [ -f "$HOME/Documents/Godot/$GODOT/Godot" ]; then
    GODOT="$HOME/Documents/Godot/$GODOT/Godot"
I understand that the Godot executable should be in one of these locations. Are there any further steps to do, e.g. setting some environment variables?
Best regards, 7wells
forum
 
Posts: 148
Joined: 04 May 2020, 12:29

Re: Porting to Godot - a few beginner's questions

Postby forum » 05 Aug 2020, 15:50

I changed the Godot version in build.sh to the latest 3.2.2 (did not touch anything else in that script):
{l Code}: {l Select All Code}
#!/bin/sh

# Change to the project's name.
PROJECTNAME="UnknownHorizons"
# Godot version or path.
GODOT="3.2.2"

# Note: This script expects the export presets to be called "windows" and "linux".

# Look for the Godot binary.
if [ -f "$GODOT" ]; then
    : # Do nothing. It's already a valid path.
elif [ -f "$HOME/.local/share/Godot/$GODOT/Godot" ]; then
    GODOT="$HOME/.local/share/Godot/$GODOT/Godot"
elif [ -f "$HOME/.local/bin/Godot/$GODOT/Godot" ]; then
    GODOT="$HOME/.local/bin/Godot/$GODOT/Godot"
elif [ -f "$HOME/Documents/Godot/$GODOT/Godot" ]; then
    GODOT="$HOME/Documents/Godot/$GODOT/Godot"
# Godot snaps use the "binary-v1-v2" name form
elif [ -f "/snap/bin/godot-${GODOT%%.*}-${GODOT##*.}" ]; then
    GODOT="/snap/bin/godot-${GODOT%%.*}-${GODOT##*.}"
# Godot on macos
elif [ -f "/Applications/Godot.app/Contents/MacOS/Godot" ]; then
    GODOT="/Applications/Godot.app/Contents/MacOS/Godot"
else
    echo "Error: Can't find the Godot editor. Can't build. "
    exit 1
fi

# Is this a Godot project?
if [ ! -f "project.godot" ]; then
    echo "Error: This isn't the directory of a Godot project. Can't build. "
    exit 2
fi
if [ ! -f "export_presets.cfg" ]; then
    echo "Error: There isn't an export presets file. Can't build. "
    exit 3
fi

# Ensure folder structure exists.
mkdir -p "Builds/Desktop"

# Builds.

echo "Exporting Linux binary... "
$GODOT --path . --export linux "Builds/Desktop/$PROJECTNAME.x86_64"
echo "Exporting Windows binary... "
$GODOT --path . --export windows "Builds/Desktop/$PROJECTNAME.exe"

if [ "$(uname -s)" == "Darwin" ]; then
    echo "Exporting macOS binary... "
    $GODOT --path . --export mac "Builds/Desktop/$PROJECTNAME.dmg"
else
    echo "Not building on macOS, export of dmg file skipped. "
fi

# Make everything executable.
chmod -R +x Builds/*

# Check if the files exist, if not, throw an error.
if [ ! -f "Builds/Desktop/$PROJECTNAME.x86_64" ] || [ ! -f "Builds/Desktop/$PROJECTNAME.exe" ]; then
    echo
    echo "Error: Building failed! Please see the Godot log for more information. "
    echo
    exit 4
fi

echo
echo "SUCCESS building the project! "
echo


... and moved the executable there:
{l Code}: {l Select All Code}
user@ubuntu:~/.local/share/Godot/3.2.2$

-rwxr-xr-x 1 user user 72122933 Jun 26 11:27 Godot

I can execute ./Godot and the GUI opens.

Then I git cloned godot-port there:
{l Code}: {l Select All Code}
user@ubuntu:~/godot-port$

drwxrwxr-x  6 user user    4096 Aug  5 16:06 Assets
-rw-rw-r--  1 user user 1796373 Aug  5 16:06 boot_splash.png
-rw-rw-r--  1 user user     661 Aug  5 16:06 boot_splash.png.import
-rwxrwxr-x  1 user user    2134 Aug  5 16:35 build.sh
-rw-rw-r--  1 user user     437 Aug  5 16:06 default_bus_layout.tres
-rw-rw-r--  1 user user     122 Aug  5 16:06 default_env.tres
-rw-rw-r--  1 user user    2084 Aug  5 16:06 export_presets.cfg
drwxrwxr-x  3 user user    4096 Aug  5 16:06 External
-rwxrwxr-x  1 user user    1172 Aug  5 16:06 format.sh
drwxrwxr-x  8 user user    4096 Aug  5 16:06 .git
drwxrwxr-x  4 user user    4096 Aug  5 16:06 .github
-rw-rw-r--  1 user user     234 Aug  5 16:06 .gitignore
-rw-rw-r--  1 user user   89115 Aug  5 16:06 icon.ico
-rw-rw-r--  1 user user   18708 Aug  5 16:06 icon.png
-rw-rw-r--  1 user user     844 Aug  5 16:06 icon.png.import
-rw-rw-r--  1 user user   17879 Aug  5 16:06 LICENSE.md
-rw-rw-r--  1 user user   20627 Aug  5 16:06 project.godot
-rw-rw-r--  1 user user    1619 Aug  5 16:06 README.md
-rwxrwxr-x  1 user user    1221 Aug  5 16:06 run.sh


When I execute build.sh...
{l Code}: {l Select All Code}
user@ubuntu:~/godot-port$ ./build.sh


... the Godot GUI opens with the logo of Unknown Horizons.
Last edited by forum on 05 Aug 2020, 16:16, edited 1 time in total.
Best regards, 7wells
forum
 
Posts: 148
Joined: 04 May 2020, 12:29

Re: Porting to Godot - a few beginner's questions

Postby forum » 05 Aug 2020, 16:15

In the terminal, I see this, and the build process fails after a while:
{l Code}: {l Select All Code}
user@ubuntu:~/godot-port$ ./build.sh
Exporting Linux binary...
Godot Engine v3.2.2.stable.official - https://godotengine.org
OpenGL ES 2.0 Renderer: llvmpipe (LLVM 9.0, 128 bits)
OpenGL ES 2.0 Batching: ON

ERROR: _load_data: Condition "!f" is true. Returned: ERR_CANT_OPEN
   At: scene/resources/texture.cpp:502.
ERROR: _load: Failed loading resource: res://.import/001.png-8360382a92fe71a3393c2e74b81b093a.stex.
   At: core/io/resource_loader.cpp:278.
ERROR: _load: Failed loading resource: res://Assets/UI/Icons/Resources/32/001.png.
   At: core/io/resource_loader.cpp:278.
SCRIPT ERROR: GDScript::reload: Parse Error: Can't preload resource at path: res://Assets/UI/Icons/Resources/32/001.png
   At: res://Assets/World/Global.gd:128.
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
   At: modules/gdscript/gdscript.cpp:599.
ERROR: _create_autoload: Script does not inherit a Node: res://Assets/World/Global.gd.
   At: editor/editor_autoload_settings.cpp:357.
ERROR: load_interactive: Cannot open file 'res://.import/lose.ogg-33cdb2f37004a36570f7c44dfc6d8b9d.oggstr'.
   At: core/io/resource_format_binary.cpp:998.
ERROR: _load: Failed loading resource: res://.import/lose.ogg-33cdb2f37004a36570f7c44dfc6d8b9d.oggstr.
   At: core/io/resource_loader.cpp:278.
ERROR: _load: Failed loading resource: res://Assets/Audio/Sounds/Events/Scenario/lose.ogg.
   At: core/io/resource_loader.cpp:278.
SCRIPT ERROR: GDScript::reload: Parse Error: Can't preload resource at path: res://Assets/Audio/Sounds/Events/Scenario/lose.ogg
   At: res://Assets/World/Audio.gd:8.
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
   At: modules/gdscript/gdscript.cpp:599.
ERROR: _create_autoload: Script does not inherit a Node: res://Assets/World/Audio.gd.
   At: editor/editor_autoload_settings.cpp:357.
reimport: begin: Importiere Nutzerinhalte erneut steps: 765
        reimport: step 0: dummy_40_u.png
        reimport: step 1: inventory_a.png
        reimport: step 2: inventory_d.png
        reimport: step 3: inventory_h.png
        reimport: step 4: inventory_u.png

<... cut out more of these lines ...>
{l Code}: {l Select All Code}
ERROR: _fs_changed: Cannot export project with preset 'linux' due to configuration errors:
Keine Exportvorlagen am erwarteten Pfad gefunden:
/home/user/.local/share/godot/templates/3.2.2.stable/linux_x11_64_debug
Keine Exportvorlagen am erwarteten Pfad gefunden:
/home/user/.local/share/godot/templates/3.2.2.stable/linux_x11_64_release

   At: editor/editor_node.cpp:615.
ERROR: _fs_changed: Project export failed for preset 'linux', the export template appears to be missing.
   At: editor/editor_node.cpp:638.
reimport: end
Exporting Windows binary...
Godot Engine v3.2.2.stable.official - https://godotengine.org
OpenGL ES 2.0 Renderer: llvmpipe (LLVM 9.0, 128 bits)
OpenGL ES 2.0 Batching: ON

ERROR: _fs_changed: Cannot export project with preset 'windows' due to configuration errors:
Keine Exportvorlagen am erwarteten Pfad gefunden:
/home/user/.local/share/godot/templates/3.2.2.stable/windows_64_debug.exe
Keine Exportvorlagen am erwarteten Pfad gefunden:
/home/user/.local/share/godot/templates/3.2.2.stable/windows_64_release.exe

   At: editor/editor_node.cpp:615.
ERROR: _fs_changed: Project export failed for preset 'windows', the export template appears to be missing.
   At: editor/editor_node.cpp:638.
./build.sh: 50: [: Linux: unexpected operator
Not building on macOS, export of dmg file skipped.

Error: Building failed! Please see the Godot log for more information.


So this does not yet seem to work, but I understand that this project is at the very beginning. If I have misunderstood something, please accept my apologies - I am a beginner. ;)


PS:
Do you have some hints how to build under Windows? I can run Godot on Windows, and I have the code checked out with TurtoiseSVN. But I do not understand how to invoke Godot under WIndows to build from that checked out code. Thanks once more!
Best regards, 7wells
forum
 
Posts: 148
Joined: 04 May 2020, 12:29

Re: Porting to Godot - a few beginner's questions

Postby forum » 06 Aug 2020, 18:11

So I continue my monologue here. ;)

No export templates were found in the expected path:
{l Code}: {l Select All Code}
/home/user/.local/share/godot/templates/3.2.2.stable/linux_x11_64_debug
/home/user/.local/share/godot/templates/3.2.2.stable/linux_x11_64_release


Ok, I need to download them from there:
https://downloads.tuxfamily.org/godoten ... plates.tpz

Oh, well, this can be done from within Godot:
https://docs.godotengine.org/en/stable/ ... jects.html

Sorry, my Godot appears in German:
Godot.png


At the end, I get a test.zip file (I gave it this name and extension) and unzipped it. Its content is this:
{l Code}: {l Select All Code}
drwxr-xr-x 6 user user      4096 Aug  6 19:33 Assets
-rw-r--r-- 1 user user   1796373 Dez 31  1979 boot_splash.png
-rw-r--r-- 1 user user       676 Aug  6 19:34 boot_splash.png.import
-rw-r--r-- 1 user user       437 Dez 31  1979 default_bus_layout.tres
-rw-r--r-- 1 user user       122 Dez 31  1979 default_env.tres
drwxr-xr-x 3 user user      4096 Aug  6 19:33 External
-rw-r--r-- 1 user user     89115 Dez 31  1979 icon.ico
-rw-r--r-- 1 user user     18708 Dez 31  1979 icon.png
-rw-r--r-- 1 user user       859 Aug  6 19:34 icon.png.import
drwxr-xr-x 2 user user    118784 Aug  6 19:33 .import
-rw-r--r-- 1 user user     27323 Dez 31  1979 project.binary
-rw-r--r-- 1 user user 115213229 Aug  6 19:28 test.zip


Maybe many of you wonder what I am doing/posting here. Well, I am not yet sure, either, but willing to learn - by doing. ;)
Best regards, 7wells
forum
 
Posts: 148
Joined: 04 May 2020, 12:29

Re: Porting to Godot - a few beginner's questions

Postby Julius » 06 Aug 2020, 18:42

How about making an issue on Github, linking to this post? I am not sure anyone involved in the Godot port is regularly reading this forum.
“Reality is that which, when you stop believing in it, doesn’t go away.” - Philip K. Dick
User avatar
Julius
Community Moderator
 
Posts: 2952
Joined: 06 Dec 2009, 14:02

Re: Porting to Godot - a few beginner's questions

Postby forum » 06 Aug 2020, 19:00

Best regards, 7wells
forum
 
Posts: 148
Joined: 04 May 2020, 12:29

Re: Porting to Godot - a few beginner's questions

Postby forum » 07 Aug 2020, 10:40

I was told to rather ask these questions on Discord (where I have joined meanwhile), but my questions have been kindly answered already on my comment on GitHub. In order to save other interested people to first go to GitHub, here are the answers to my questions:

Q: Which Godot version shall I use for Unknown Horizons? (well, actually for first playing around a bit with Godot) The latest 3.2.2?

A: Yes, 3.2.2.

Q: Shall I use the Standard version or the Mono version (C# support)?

A: This project does not use C#, so both versions will open the project just fine. If you want to run C# projects later, download the Mono version of Godot (and install Mono itself too!), otherwise just download the standard version.

Q: Godot 32 or 64bit?

A: Always 64-bit.

Q: I understand that the Godot executable should be in one of these locations. Are there any further steps to do, e.g. setting some environment variables?

A: Well, those are some locations the build script looks in, but you can put Godot anywhere you want, and also, the built script isn't necessary to build the game, it's just to assist with exporting for all platforms at once (so you don't need it). No extra environment variables are necessary (the script does expect you have standard ones such as `$HOME`).

Q: In the terminal, I see this, and the build process fails after a while: ...

A: You need to open the project once in the Godot editor to generate the necessary files before the build script would work (but again, you probably don't need the build script).

Q: No export templates were found in the expected path:

A: Export templates can be installed from inside the Godot editor.

HTH :)
Best regards, 7wells
forum
 
Posts: 148
Joined: 04 May 2020, 12:29

Re: Porting to Godot - a few beginner's questions

Postby forum » 08 Aug 2020, 11:45

So here I am back after I was told on Discord to go to this forum. ;)

Please allow me to repeat my last post there over here:

I am (still) on Windows 10 Pro 64bit and use the desktop app of GitHub (changed from TurtoiseSVN, if that matters at all. I checked out https://github.com/unknown-horizons/godot-port.git and then imported project.godot in Godot. The UH splash logo (ship) appears but in the other (console/ log) window, I see error messages:

{l Code}: {l Select All Code}
Godot Engine v3.2.2.stable.official - https://godotengine.org/
OpenGL ES 2.0 Renderer: Intel(R) HD Graphics 620
OpenGL ES 2.0 Batching: ON

ERROR: _load_data: Condition "!f" is true. Returned: ERR_CANT_OPEN
   At: scene/resources/texture.cpp:502
ERROR: Failed loading resource: res://.import/001.png-8360382a92fe71a3393c2e74b81b093a.stex.
   At: core/io/resource_loader.cpp:278
ERROR: Failed loading resource: res://Assets/UI/Icons/Resources/32/001.png.
   At: core/io/resource_loader.cpp:278
SCRIPT ERROR: GDScript::reload: Parse Error: Can't preload resource at path: res://Assets/UI/Icons/Resources/32/001.png
          At: res://Assets/World/Global.gd:128
ERROR: reload: Method failed. Returning: ERR_PARSE_ERROR
   At: modules/gdscript/gdscript.cpp:599
ERROR: Script does not inherit a Node: res://Assets/World/Global.gd.
   At: editor/editor_autoload_settings.cpp:357
ERROR: Cannot open file 'res://.import/lose.ogg-33cdb2f37004a36570f7c44dfc6d8b9d.oggstr'.
   At: core/io/resource_format_binary.cpp:998
ERROR: Failed loading resource: res://.import/lose.ogg-33cdb2f37004a36570f7c44dfc6d8b9d.oggstr.
   At: core/io/resource_loader.cpp:278
ERROR: Failed loading resource: res://Assets/Audio/Sounds/Events/Scenario/lose.ogg.
   At: core/io/resource_loader.cpp:278
SCRIPT ERROR: GDScript::reload: Parse Error: Can't preload resource at path: res://Assets/Audio/Sounds
...


I stop here, but there are more. In the main Godot window, meanwhile the logo with the settings (steering wheel) appeared.

My question is:
Do I first have to resolve the source of these errors before playing further around with Godot? Do you have any hints for me about these errors? Thank you!
Best regards, 7wells
forum
 
Posts: 148
Joined: 04 May 2020, 12:29

Who is online

Users browsing this forum: No registered users and 1 guest