Skip to content

Commit eb997f3

Browse files
authored
Upgrade to Godot 4.3 (#59)
1 parent a2d5368 commit eb997f3

File tree

201 files changed

+677
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+677
-463
lines changed

.github/workflows/build.yml

+58-38
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
arch: ['x86_64', 'aarch64']
2323
include:
2424
- platform: linux
25-
os: ubuntu-22.04
25+
os: ubuntu-24.04
2626
vendor: unknown
2727
env: -gnu
2828
lib: libnative.so
@@ -50,7 +50,7 @@ jobs:
5050
- name: checkout
5151
uses: actions/checkout@v4
5252
with:
53-
lfs: true
53+
lfs: false
5454
- name: Set up clang64
5555
if: contains(matrix.os, 'windows')
5656
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
@@ -76,40 +76,43 @@ jobs:
7676
uses: actions/upload-artifact@v4
7777
with:
7878
name: libnative-${{ matrix.platform }}-${{ matrix.arch }}
79-
path: native/target/${{ env.TARGET_TRIPLET }}/${{ inputs.release && 'release' || 'debug' }}/${{ matrix.lib }}
79+
path: native/target/${{ env.TARGET_TRIPLET }}/${{ inputs.release && 'release' || 'debug' }}/${{ matrix.lib }}
8080

8181
godot-export:
8282
strategy:
8383
matrix:
8484
profile: ['macOS', 'Windows', 'Linux']
85-
version: ['4.2.2']
85+
version: ['4.3']
8686
include:
8787
- profile: 'macOS'
8888
platform: darwin
8989
vendor: apple
90-
os: macos-14
90+
os: macos-15
9191
x86_64: true
9292
aarch64: true
9393
extension: '.dmg'
9494
lib: libnative.dylib
9595
template_dir: '$HOME/Library/Application\ Support/Godot/export_templates'
96+
godot_artefact: 'macOS.universal'
9697
- profile: 'Windows'
9798
platform: windows
9899
env: '-msvc'
99100
vendor: pc
100-
os: ubuntu-22.04
101+
os: ubuntu-24.04
101102
x86_64: true
102103
aarch64: true
103104
extension: '.exe'
104105
lib: native.dll
105106
template_dir: '$HOME/.local/share/godot/export_templates'
107+
godot_artefact: 'linux.x86_64'
106108
- profile: 'Linux'
107109
platform: 'linux'
108110
env: '-gnu'
109111
vendor: 'unknown'
110-
os: ubuntu-20.04
112+
os: ubuntu-24.04
111113
lib: libnative.so
112114
template_dir: '$HOME/.local/share/godot/export_templates'
115+
godot_artefact: 'linux.x86_64'
113116
x86_64: true
114117

115118
needs: rust-build
@@ -124,11 +127,23 @@ jobs:
124127
uses: actions/checkout@v4
125128
with:
126129
lfs: true
127-
- name: setup Godot
128-
uses: lihop/setup-godot@v2
130+
- uses: hustcer/setup-nu@main
129131
with:
130-
version: ${{ matrix.version }}
131-
export-templates: false
132+
version: "0.101.*"
133+
134+
- name: setup Godot
135+
shell: nu {0}
136+
run: |
137+
let bin_path = "${{ startsWith(matrix.os, 'ubuntu') && format('./Godot_v{0}-stable_linux.x86_64', matrix.version) || './Godot.app/Contents/MacOS/Godot' }}"
138+
mkdir .godot_bin
139+
http get "https://github.com/godotengine/godot/releases/download/${{ matrix.version }}-stable/Godot_v${{ matrix.version }}-stable_${{ matrix.godot_artefact }}.zip"
140+
| save -rf .godot_bin/godot.zip
141+
cd .godot_bin
142+
unzip godot.zip
143+
chmod +x $bin_path
144+
ln -s $bin_path "./godot"
145+
ls -a
146+
132147
- name: download Godot export template
133148
run: |
134149
mkdir -p ${{ matrix.template_dir }}/${{ matrix.version }}.stable
@@ -158,47 +173,52 @@ jobs:
158173
run: |
159174
platform_dir="${{ matrix.vendor }}-${{ matrix.platform }}"
160175
mkdir -p native/target/universal-$platform_dir/debug/
161-
lipo -create native/target/x86_64-$platform_dir/debug/${{ matrix.lib }} native/target/aarch64-$platform_dir/debug/${{ matrix.lib }} -output native/target/universal-$platform_dir/debug/${{ matrix.lib }}
176+
lipo -create native/target/x86_64-$platform_dir/debug/${{ matrix.lib }} native/target/aarch64-$platform_dir/debug/${{ matrix.lib }} -output native/target/universal-$platform_dir/debug/${{ matrix.lib }}
162177
- name: copy libs
178+
shell: nu {0}
163179
run: |
164-
set -x
165-
platform_dir="${{ matrix.vendor }}-${{ matrix.platform }}${{ matrix.env }}"
166-
x86_64="native/target/x86_64-$platform_dir"
167-
aarch64="native/target/aarch64-$platform_dir"
168-
universal="native/target/universal-$platform_dir"
180+
let platform_dir = "${{ matrix.vendor }}-${{ matrix.platform }}${{ matrix.env }}"
181+
let x86_64 = $"native/target/x86_64-($platform_dir)"
182+
let aarch64 = $"native/target/aarch64-($platform_dir)"
183+
let universal = $"native/target/universal-($platform_dir)"
169184
170-
if [[ -d "$x86_64/debug/" ]]; then
171-
mkdir -p "$x86_64/release/"
172-
cp $x86_64/debug/* "$x86_64/release/"
173-
fi
185+
if ($"($x86_64)/debug/" | path type) == "dir" {
186+
mkdir $"($x86_64)/release/"
187+
cp -v ($"($x86_64)/debug/*" | into glob) $"($x86_64)/release/"
188+
}
174189
175-
if [[ -d "$aarch64/debug/" ]]; then
176-
mkdir -p "$aarch64/release/"
177-
cp $aarch64/debug/* "$aarch64/release/"
178-
fi
190+
if ($"($aarch64)/debug/" | path type) == "dir" {
191+
mkdir $"($aarch64)/release/"
192+
cp -v ($"($aarch64)/debug/*" | into glob) $"($aarch64)/release/"
193+
}
179194
180-
if [[ -d "$universal/debug/" ]]; then
181-
mkdir -p "$universal/release/"
182-
cp $universal/debug/* "$universal/release/"
183-
fi
195+
if ($"($universal)/debug/" | path type) == "dir" {
196+
mkdir $"($universal)/release/"
197+
cp -v ($"($universal)/debug/*" | into glob) $"($universal)/release/"
198+
}
184199
- name: import godot project
200+
shell: nu {0}
185201
run: |
186-
# import assets
187-
.github/build_godot_cache.sh
188-
# restart to make sure all rust scripts are detected
189-
.github/build_godot_cache.sh
202+
$env.PATH = $env.PATH | append ("./.godot_bin" | path expand)
203+
204+
godot --headless --verbose --import
205+
190206
- name: export-debug
207+
shell: nu {0}
191208
if: ${{ !inputs.release }}
192209
run: |
193-
mkdir -p "${{ env.EXPORT_DIR }}"
194-
godot --headless --export-debug ${{ env.EXPORT_ARGS }}
195-
test $(ls -al "${{ env.EXPORT_DIR }}" | wc -l) -gt 1
210+
$env.PATH = $env.PATH | append ("./.godot_bin" | path expand)
211+
mkdir "${{ env.EXPORT_DIR }}"
212+
godot --headless --verbose --export-debug ${{ env.EXPORT_ARGS }}
213+
if (ls -a "${{ env.EXPORT_DIR }}" | length) < 1 { exit 1 }
196214
- name: export-release
215+
shell: nu {0}
197216
if: inputs.release
198217
run: |
199-
mkdir -p "${{ env.EXPORT_DIR }}"
218+
$env.PATH = $env.PATH | append ("./.godot_bin" | path expand)
219+
mkdir "${{ env.EXPORT_DIR }}"
200220
godot --headless --export-release ${{ env.EXPORT_ARGS }}
201-
test $(ls -al "${{ env.EXPORT_DIR }}" | wc -l) -gt 1
221+
if (ls -a "${{ env.EXPORT_DIR }}" | length) < 1 { exit 1 }
202222
- name: describe revision
203223
id: describe
204224
run: echo "ref=$(git describe --tags --always)" >> $GITHUB_OUTPUT

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The game uses SimCity 2000 city files to generate its maps. The original city fi
8181
- Military Missions
8282

8383
## Building From Source
84-
The game is built with the [Godot Game Engine 4.2.2](https://github.com/godotengine/godot/tree/4.2.2-stable) and new builds can be exported with the engines own editor. The game relies on a GDNative module written in Rust. The native module has to be built from source before it can be used by the engine. See the [`/native` directory](./native) for detailed instructions.
84+
The game is built with the [Godot Game Engine 4.3](https://github.com/godotengine/godot/tree/4.3-stable) and new builds can be exported with the engines own editor. The game relies on a GDExtension module written in Rust. The native module has to be built from source before it can be used by the engine. See the [`/native` directory](./native) for detailed instructions.
8585

8686
## Contributing
8787
Pull Requests should always reference existing issues. Please do not submit PRs which have no related issue. To suggest new features, not listed above, or discuss current features / implementations, please use the discussions Section of the repository.

addons/customization/VersionLocking.gd

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ static func verify(editor: EditorInterface) -> void:
1717
var version_parts := desired_version.split(".")
1818
var major := int(version_parts[0])
1919
var minor := int(version_parts[1])
20-
var patch := int(version_parts[2])
20+
var patch := int(version_parts[2] if version_parts.size() >= 3 else 0)
2121

2222
if major != engine_version.major || minor != engine_version.minor || engine_version.patch != patch:
2323
var dialog_scene: PackedScene = load("res://addons/customization/force_quit_control/force_quit_control.tscn")

addons/visual_shader_node_library/examples/3D/textures/flowmap.png.import

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://0mpah4qrs7h4"
66
path.s3tc="res://.godot/imported/flowmap.png-6bcf6f060abcefafe77d0b4b6b27c416.s3tc.ctex"
7+
path.etc2="res://.godot/imported/flowmap.png-6bcf6f060abcefafe77d0b4b6b27c416.etc2.ctex"
78
metadata={
8-
"imported_formats": ["s3tc_bptc"],
9+
"imported_formats": ["s3tc_bptc", "etc2_astc"],
910
"vram_texture": true
1011
}
1112

1213
[deps]
1314

1415
source_file="res://addons/visual_shader_node_library/examples/3D/textures/flowmap.png"
15-
dest_files=["res://.godot/imported/flowmap.png-6bcf6f060abcefafe77d0b4b6b27c416.s3tc.ctex"]
16+
dest_files=["res://.godot/imported/flowmap.png-6bcf6f060abcefafe77d0b4b6b27c416.s3tc.ctex", "res://.godot/imported/flowmap.png-6bcf6f060abcefafe77d0b4b6b27c416.etc2.ctex"]
1617

1718
[params]
1819

addons/visual_shader_node_library/examples/3D/textures/rock_metal.jpg.import

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://dmhjpggfx1f28"
66
path.s3tc="res://.godot/imported/rock_metal.jpg-72b17caa044e4bb9f0c5297808773c01.s3tc.ctex"
7+
path.etc2="res://.godot/imported/rock_metal.jpg-72b17caa044e4bb9f0c5297808773c01.etc2.ctex"
78
metadata={
8-
"imported_formats": ["s3tc_bptc"],
9+
"imported_formats": ["s3tc_bptc", "etc2_astc"],
910
"vram_texture": true
1011
}
1112

1213
[deps]
1314

1415
source_file="res://addons/visual_shader_node_library/examples/3D/textures/rock_metal.jpg"
15-
dest_files=["res://.godot/imported/rock_metal.jpg-72b17caa044e4bb9f0c5297808773c01.s3tc.ctex"]
16+
dest_files=["res://.godot/imported/rock_metal.jpg-72b17caa044e4bb9f0c5297808773c01.s3tc.ctex", "res://.godot/imported/rock_metal.jpg-72b17caa044e4bb9f0c5297808773c01.etc2.ctex"]
1617

1718
[params]
1819

addons/visual_shader_node_library/examples/3D/textures/texture_rock_albedo.png.import

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://blr0ftfqa3fcr"
66
path.s3tc="res://.godot/imported/texture_rock_albedo.png-12c53c5a753bd43dbbabd1f980ca1743.s3tc.ctex"
7+
path.etc2="res://.godot/imported/texture_rock_albedo.png-12c53c5a753bd43dbbabd1f980ca1743.etc2.ctex"
78
metadata={
8-
"imported_formats": ["s3tc_bptc"],
9+
"imported_formats": ["s3tc_bptc", "etc2_astc"],
910
"vram_texture": true
1011
}
1112

1213
[deps]
1314

1415
source_file="res://addons/visual_shader_node_library/examples/3D/textures/texture_rock_albedo.png"
15-
dest_files=["res://.godot/imported/texture_rock_albedo.png-12c53c5a753bd43dbbabd1f980ca1743.s3tc.ctex"]
16+
dest_files=["res://.godot/imported/texture_rock_albedo.png-12c53c5a753bd43dbbabd1f980ca1743.s3tc.ctex", "res://.godot/imported/texture_rock_albedo.png-12c53c5a753bd43dbbabd1f980ca1743.etc2.ctex"]
1617

1718
[params]
1819

addons/visual_shader_node_library/examples/3D/textures/texture_rock_ao.png.import

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://cp8kfxbjcty8s"
66
path.s3tc="res://.godot/imported/texture_rock_ao.png-61fb5b8e003b85d4277182e1db6ac804.s3tc.ctex"
7+
path.etc2="res://.godot/imported/texture_rock_ao.png-61fb5b8e003b85d4277182e1db6ac804.etc2.ctex"
78
metadata={
8-
"imported_formats": ["s3tc_bptc"],
9+
"imported_formats": ["s3tc_bptc", "etc2_astc"],
910
"vram_texture": true
1011
}
1112

1213
[deps]
1314

1415
source_file="res://addons/visual_shader_node_library/examples/3D/textures/texture_rock_ao.png"
15-
dest_files=["res://.godot/imported/texture_rock_ao.png-61fb5b8e003b85d4277182e1db6ac804.s3tc.ctex"]
16+
dest_files=["res://.godot/imported/texture_rock_ao.png-61fb5b8e003b85d4277182e1db6ac804.s3tc.ctex", "res://.godot/imported/texture_rock_ao.png-61fb5b8e003b85d4277182e1db6ac804.etc2.ctex"]
1617

1718
[params]
1819

addons/visual_shader_node_library/examples/3D/textures/texture_rock_depth.png.import

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://dw6a7lv1roiks"
66
path.s3tc="res://.godot/imported/texture_rock_depth.png-a47e356d82f517a80fd29b17176823ce.s3tc.ctex"
7+
path.etc2="res://.godot/imported/texture_rock_depth.png-a47e356d82f517a80fd29b17176823ce.etc2.ctex"
78
metadata={
8-
"imported_formats": ["s3tc_bptc"],
9+
"imported_formats": ["s3tc_bptc", "etc2_astc"],
910
"vram_texture": true
1011
}
1112

1213
[deps]
1314

1415
source_file="res://addons/visual_shader_node_library/examples/3D/textures/texture_rock_depth.png"
15-
dest_files=["res://.godot/imported/texture_rock_depth.png-a47e356d82f517a80fd29b17176823ce.s3tc.ctex"]
16+
dest_files=["res://.godot/imported/texture_rock_depth.png-a47e356d82f517a80fd29b17176823ce.s3tc.ctex", "res://.godot/imported/texture_rock_depth.png-a47e356d82f517a80fd29b17176823ce.etc2.ctex"]
1617

1718
[params]
1819

addons/visual_shader_node_library/examples/3D/textures/texture_rock_metal.png.import

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://d1jp505optmfd"
66
path.s3tc="res://.godot/imported/texture_rock_metal.png-c46fc417e11885c57aff7b8230ab1a0d.s3tc.ctex"
7+
path.etc2="res://.godot/imported/texture_rock_metal.png-c46fc417e11885c57aff7b8230ab1a0d.etc2.ctex"
78
metadata={
8-
"imported_formats": ["s3tc_bptc"],
9+
"imported_formats": ["s3tc_bptc", "etc2_astc"],
910
"vram_texture": true
1011
}
1112

1213
[deps]
1314

1415
source_file="res://addons/visual_shader_node_library/examples/3D/textures/texture_rock_metal.png"
15-
dest_files=["res://.godot/imported/texture_rock_metal.png-c46fc417e11885c57aff7b8230ab1a0d.s3tc.ctex"]
16+
dest_files=["res://.godot/imported/texture_rock_metal.png-c46fc417e11885c57aff7b8230ab1a0d.s3tc.ctex", "res://.godot/imported/texture_rock_metal.png-c46fc417e11885c57aff7b8230ab1a0d.etc2.ctex"]
1617

1718
[params]
1819

addons/visual_shader_node_library/examples/3D/textures/texture_rock_normal.png.import

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://c6dkhyueg08le"
66
path.s3tc="res://.godot/imported/texture_rock_normal.png-81551471a260ea195a853a6e744ac09b.s3tc.ctex"
7+
path.etc2="res://.godot/imported/texture_rock_normal.png-81551471a260ea195a853a6e744ac09b.etc2.ctex"
78
metadata={
8-
"imported_formats": ["s3tc_bptc"],
9+
"imported_formats": ["s3tc_bptc", "etc2_astc"],
910
"vram_texture": true
1011
}
1112

1213
[deps]
1314

1415
source_file="res://addons/visual_shader_node_library/examples/3D/textures/texture_rock_normal.png"
15-
dest_files=["res://.godot/imported/texture_rock_normal.png-81551471a260ea195a853a6e744ac09b.s3tc.ctex"]
16+
dest_files=["res://.godot/imported/texture_rock_normal.png-81551471a260ea195a853a6e744ac09b.s3tc.ctex", "res://.godot/imported/texture_rock_normal.png-81551471a260ea195a853a6e744ac09b.etc2.ctex"]
1617

1718
[params]
1819

addons/visual_shader_node_library/nodes.png.import

+3-2
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,16 @@ importer="texture"
44
type="CompressedTexture2D"
55
uid="uid://djuhl2rh8l5y4"
66
path.s3tc="res://.godot/imported/nodes.png-b8a42e6fa174205402b0f3d54047cfe9.s3tc.ctex"
7+
path.etc2="res://.godot/imported/nodes.png-b8a42e6fa174205402b0f3d54047cfe9.etc2.ctex"
78
metadata={
8-
"imported_formats": ["s3tc_bptc"],
9+
"imported_formats": ["s3tc_bptc", "etc2_astc"],
910
"vram_texture": true
1011
}
1112

1213
[deps]
1314

1415
source_file="res://addons/visual_shader_node_library/nodes.png"
15-
dest_files=["res://.godot/imported/nodes.png-b8a42e6fa174205402b0f3d54047cfe9.s3tc.ctex"]
16+
dest_files=["res://.godot/imported/nodes.png-b8a42e6fa174205402b0f3d54047cfe9.s3tc.ctex", "res://.godot/imported/nodes.png-b8a42e6fa174205402b0f3d54047cfe9.etc2.ctex"]
1617

1718
[params]
1819

native/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ edition = "2021"
77
crate-type = ["cdylib"]
88

99
[dependencies]
10-
godot = { version = "0.2.2", features = ["experimental-threads", "api-4-2"] }
10+
godot = { version = "0.2.2", features = ["experimental-threads", "api-4-3"] }
1111
godot-rust-script = { git = "https://github.com/titannano/godot-rust-script", rev = "46b151f558370c260fa1e79502637f128ea7bb7f" }
1212
lerp = "0.4.0"
1313
backtrace = "0.3.64"

0 commit comments

Comments
 (0)