Skip to content
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

The Boot Splash slow in Godot 4 beta12 #71350

Open
sgervais333 opened this issue Jan 13, 2023 · 9 comments · May be fixed by #73579
Open

The Boot Splash slow in Godot 4 beta12 #71350

sgervais333 opened this issue Jan 13, 2023 · 9 comments · May be fixed by #73579

Comments

@sgervais333
Copy link

Godot version

4.0beta12

System information

Windows 11, Vulkan API 1.3.224 - Vulkan NVIDIA GeForce RTX 3080 Ti

Issue description

The Boot Splash image is very slow on Godot 4.

Here what I mean.
Godot 4:
Animation3

Godot 3.5.1:
Animation4

In the 2 projects. I put a Image to show + the pink color for the purpose of demonstration.

In Godot 3.5.1, the image show really fast (the pink color is not event visible) vs Godot 4 beta 12 where we can see the pink color during 0.25sec.

Steps to reproduce

  1. Put a Image in Boot Splash
  2. Change the color of BG Color

Minimal reproduction project

TestProject.zip

@Zireael07
Copy link
Contributor

What happens if you open script tab in editor before opening the game? What happens if the scene open in editor does NOT have particles in it? (Just to rule out rendering both game&editor and particles as being the cause)

@Calinou
Copy link
Member

Calinou commented Jan 13, 2023

Try switching to the Compatibility rendering method in the advanced Project Settings. The Vulkan rendering backends are more complex and require more time to start.

@adamscott
Copy link
Member

adamscott commented Jan 13, 2023

The Vulkan rendering backends are more complex and require more time to start.

Is this possible to delay showing the window only once Vulkan rendering backends are ready?

@Calinou
Copy link
Member

Calinou commented Jan 13, 2023

Is this possible to delay showing the window only once Vulkan rendering backends are ready?

See godotengine/godot-proposals#3145 and godotengine/godot-proposals#1175.

@sgervais333
Copy link
Author

Try switching to the Compatibility rendering method in the advanced Project Settings. The Vulkan rendering backends are more complex and require more time to start.

Ahh, interesting, it make sense. Thanks for the response!

@clayjohn
Copy link
Member

One thing I would like to do to combat the slow boot splash is to display the boot splash image using the windowing system instead of using the GPU. As far as I know all windowing libraries let you pass an image (or at least an array of pixels) to display, we could give it the boot splash so that it displays even before the GPU is initialized. This would remove the awkward flicker before the boot splash shows but it won't help with the extra loading time.

@adamscott
Copy link
Member

I don't think the "extra loading time" would be an issue, as it already exists: it shows an undefined empty frame.

@sakrel
Copy link
Contributor

sakrel commented Jan 14, 2023

I launched godot with --rendering-driver vulkan -e -w -v --path project and set a breakpoint in RenderingServerDefault::set_boot_image. These are all the shaders the mobile renderer loads before set_boot_image is called:

Shader 'CanvasSdfShaderRD' SHA256: 1ba49c527385245b29e55388e91f863f93edaafb0cac27303467d8c0d314ad7a
Shader 'SkeletonShaderRD' SHA256: 84a5f55252643fbb79fdb6635cecfc5777af53c478d0f86e6c44ab7419356e1b
Shader 'ParticlesShaderRD' SHA256: e7dd0a07ef9861f47ba19bb21c76cd88f0846c54f3fea1d1a99b702348fdca70
Shader 'ParticlesCopyShaderRD' SHA256: 2ab781b563fe79a4aaf0858d47dea71d86c1820e460fb7cd4da9e837dac9551e
Shader 'CanvasShaderRD' SHA256: 12282e7731421173eb27d94f3746de8945730048532e01349d71af0d5fb0ba11
Shader 'CanvasOcclusionShaderRD' SHA256: 13ee527ffe2667e9653077dc240102303de521d36c3144084a98146d07d08107
Shader 'SceneForwardMobileShaderRD' SHA256: f4406079f46d27b90680e549aafa234e2bb57da9260411450a0810d6fa9c38e7
Shader 'SkyShaderRD' SHA256: 9d5eb2cb07953c07a80ba27d662bdb6f75063ffa219b0fe527c5b75630c23d77
Shader 'BokehDofRasterShaderRD' SHA256: f55df5d9cb58ffa42daf8b492b113a3ed2e416ec148b68cd976e29e73ddc8e9e
Shader 'BlurRasterShaderRD' SHA256: d9d0d3d5cfd4381ea3e5e338c1f504db620a8a9ffaf79c585868cb998187bc23
Shader 'CopyToFbShaderRD' SHA256: e1c2e0dc008f6d7888da917ae193d6bdbdb39da551490a5f4824dcd47d0df6d8
Shader 'CubeToDpShaderRD' SHA256: 0b6283aebe633b69bf827fe29229e412c77f5f0a35f20c6dfc71198f4bd1671d
Shader 'CubemapDownsamplerRasterShaderRD' SHA256: 636fa84ca83568210d2e7875c51380c7246ad33508462f33d0bbc56de3094b90
Shader 'CubemapFilterRasterShaderRD' SHA256: 5211a81fdd470e4c753f999385c88cc59b4a42f2672123afc0a97db96b092150
Shader 'CubemapRoughnessRasterShaderRD' SHA256: 93144c0a62759b1aeaaa3ab173ad8c058d4bc7cc7ab0e672bf2666dcc310f400
Shader 'SpecularMergeShaderRD' SHA256: 4a7c2c6cd9454dc58a803362977bf2fee65bf17e5eca2d9ac9cdd370cb76a1e8
Shader 'LuminanceReduceRasterShaderRD' SHA256: 8d0fe7bbe1438d25357fedb330e45c8f37d42dd7b170d33c637369ef3c8d4c78
Shader 'TonemapShaderRD' SHA256: e0aff8ac187473fd62f6f8d3571357c8821e66bce81cce15d6d7e49e830ea49b
Shader 'SortShaderRD' SHA256: 96a25c5a05c3b07a9d4044fffbdceb5e5ae98d0b47a39279315d52c00895a122
Shader 'BlitShaderRD' SHA256: d2a16d270d940afce94c948456d35ee7dfc240e976c1d42058450662fbad133c

the forward+ renderer loads even more shaders:

Shader 'CanvasSdfShaderRD' SHA256: 1ba49c527385245b29e55388e91f863f93edaafb0cac27303467d8c0d314ad7a
Shader 'SkeletonShaderRD' SHA256: 84a5f55252643fbb79fdb6635cecfc5777af53c478d0f86e6c44ab7419356e1b
Shader 'ParticlesShaderRD' SHA256: e7dd0a07ef9861f47ba19bb21c76cd88f0846c54f3fea1d1a99b702348fdca70
Shader 'ParticlesCopyShaderRD' SHA256: 2ab781b563fe79a4aaf0858d47dea71d86c1820e460fb7cd4da9e837dac9551e
Shader 'CanvasShaderRD' SHA256: 12282e7731421173eb27d94f3746de8945730048532e01349d71af0d5fb0ba11
Shader 'CanvasOcclusionShaderRD' SHA256: 13ee527ffe2667e9653077dc240102303de521d36c3144084a98146d07d08107
Shader 'ClusterRenderShaderRD' SHA256: 80222f423a0af888fcda11e0f1f7cc6805cc65c7d584ba23c74ca8978235b1dd
Shader 'ClusterStoreShaderRD' SHA256: 7216554baa21d4e3c0b01b9d47fecfa907a6eb429cb5fe2f0d24d9311fa40674
Shader 'ClusterDebugShaderRD' SHA256: 591fb694d24753591a46f41868791505890d51ef69f7e66ce9bfe4c1383c8823
Shader 'SceneForwardClusteredShaderRD' SHA256: 69f3e62d6d1d247fb1a475ae71003d541542753ca7eb593a6771f675c3abfec5
Shader 'ResolveShaderRD' SHA256: 41e04918d9bd8759cd6b0ecea019643837e60d2dcf46ee0c6ffd366fc87e428c
Shader 'TaaResolveShaderRD' SHA256: 9e6941257d9a8c8cefb8f2552601d202ce471216a8f1ddedcbb54890fded5192
Shader 'SsEffectsDownsampleShaderRD' SHA256: 5368a645c6fef2b3cefc7565bf7d1cdafd55390ca4c43c2fdaee64d5ba23c4b4
Shader 'SsilShaderRD' SHA256: d4e09d04cf2579f09db1e21b8f5171d211c9f03eef95778d378b63e2e97c279f
Shader 'SsilImportanceMapShaderRD' SHA256: 11797f01f5e6cdd418d6e58729874df4ac1ad8a22c063927e40d34ce895edd5c
Shader 'SsilBlurShaderRD' SHA256: 415616bff5ba2fa4b3a2a2408ae95a0b32aa3ca67beaff90184d3f6f862dab1b
Shader 'SsilInterleaveShaderRD' SHA256: 570b8197744b9a05fa4f95be6edf9bafac07560dff884d6644e93b3dd292c207
Shader 'SsaoShaderRD' SHA256: eb13558bb53e743432c6824160b31fa70ec67610f1ccd86f061eb3fa50130819
Shader 'SsaoImportanceMapShaderRD' SHA256: 16a899d2fca1c9ba00449dca0ee4f615954306233c2421203024c2ded40fad1c
Shader 'SsaoBlurShaderRD' SHA256: ff16502b31dce4a588897936ed7ce6f50c6449a255a1ab7fb912d0548b484e54
Shader 'SsaoInterleaveShaderRD' SHA256: 5bc4a42057922784d3f56347b02ca0f6a88e491a57f64825d376a1a11cd7838d
Shader 'ScreenSpaceReflectionScaleShaderRD' SHA256: a78958d8393046e7978be2106846e5b90e12b417dbc1331e9c901192fe808de2
Shader 'ScreenSpaceReflectionShaderRD' SHA256: ca538c513a0630090c08bd55720fbe3b691eb306297935722dde6ec39f88a2e6
Shader 'ScreenSpaceReflectionFilterShaderRD' SHA256: a5554b1626bdaad14923c530694b851ccc0edb3ebb16e35269959daa08751b98
Shader 'SubsurfaceScatteringShaderRD' SHA256: e2e94bd9da17579dec4de74215ab2487672fd4b403945c462f75cbab9c723b14
Shader 'SkyShaderRD' SHA256: 9d5eb2cb07953c07a80ba27d662bdb6f75063ffa219b0fe527c5b75630c23d77
Shader 'VoxelGiShaderRD' SHA256: 2509160691ec507e650a92fd5a7465f746b26365d5685eca2a7b1359bcb6d3a1
Shader 'VoxelGiDebugShaderRD' SHA256: 0283db1efe1dd0dea16994f2718d247da17ab54675ba687d0f64c9a9b7e68078
Shader 'SdfgiPreprocessShaderRD' SHA256: 48fe05ca435aa25d2ef286a30c23a1e7d26225953fefe035666f46ffd562e554
Shader 'SdfgiDirectLightShaderRD' SHA256: b068a41a8252598b47f2d4533b6f7aa52c4dd8aa486546d0dae5afa3a77b0709
Shader 'SdfgiIntegrateShaderRD' SHA256: a5b381cfdd621f3518546a530914e4b882e452642a2be1cbc8764fd48707654c
Shader 'GiShaderRD' SHA256: 27243554cd229a0cc21e4e185856c25b74b2886a8e50d3d049e1328f57d74f50
Shader 'SdfgiDebugShaderRD' SHA256: 64879ee6cdb95cdad2745a08b29f1a2af4b4f40d2624a627077f99de7f4a79fd
Shader 'SdfgiDebugProbesShaderRD' SHA256: d76cadfb8e49f3b77bb5b5ec2aca87f3c19afcc4ed0ca94df15a64071736818b
Shader 'VolumetricFogShaderRD' SHA256: dced527cd5f2a76a476db0d44fc85ae4d4a1df0d6b0b3513df4ba064c6a871aa
Shader 'VolumetricFogProcessShaderRD' SHA256: 50598b3a095feda30e6eae7dd08e8e1aef7f989ebf26d1902d1d6eab601ece54
Shader 'BokehDofShaderRD' SHA256: 6fbce0af9940f9cef5447dd204bcfdf94123e6ac429ace387606d2788f8c6bf6
Shader 'CopyShaderRD' SHA256: 7607d7e5bbb1e0864b746f1b5c262e3127c20c8227b11d7a4434e1f40be4ce1e
Shader 'CopyToFbShaderRD' SHA256: e1c2e0dc008f6d7888da917ae193d6bdbdb39da551490a5f4824dcd47d0df6d8
Shader 'CubeToDpShaderRD' SHA256: 0b6283aebe633b69bf827fe29229e412c77f5f0a35f20c6dfc71198f4bd1671d
Shader 'CubemapDownsamplerShaderRD' SHA256: e8d8f7526ac738915089ae52f8b8044198706291adc7e41811ec948c9b96ee58
Shader 'CubemapFilterShaderRD' SHA256: 28303681bc61d790fd3154d384b0c83742d1ed53d983f859b93d0f0890a3643e
Shader 'CubemapRoughnessShaderRD' SHA256: 02d08adfe65ce862653471a678dc7c286a7b47cd8d85c6691ae765ff322456f8
Shader 'SpecularMergeShaderRD' SHA256: 4a7c2c6cd9454dc58a803362977bf2fee65bf17e5eca2d9ac9cdd370cb76a1e8
Shader 'LuminanceReduceShaderRD' SHA256: 2d4aad0ce106c88f78003bdd1aa0ba504107948f389d706c2a624222b42040ed
Shader 'TonemapShaderRD' SHA256: e0aff8ac187473fd62f6f8d3571357c8821e66bce81cce15d6d7e49e830ea49b
Shader 'FsrUpscaleShaderRD' SHA256: 2cffee6cc087f28e03835a0620c8f3079450735dbc07d9fe2b9a9c8cbd917ef5
Shader 'RoughnessLimiterShaderRD' SHA256: 58ea1a16ec871ffe2c7ee6690a3c1ed86e366150fa1405be1ff21acd08631840
Shader 'SortShaderRD' SHA256: 96a25c5a05c3b07a9d4044fffbdceb5e5ae98d0b47a39279315d52c00895a122
Shader 'BlitShaderRD' SHA256: d2a16d270d940afce94c948456d35ee7dfc240e976c1d42058450662fbad133c

It's not obvious to me why all these shaders need to be loaded before the boot image is drawn, maybe it's possible to refactor the init process so set_boot_image gets called earlier?

@zoeesilcock
Copy link
Contributor

I did some experimenting with moving the set_boot_image() call earlier, but in my naive attempts that block of code didn't work much earlier in the process as it relies on other things being in place.

A different approach that worked was to wait with showing the main window until the splash is ready, instead of showing it in the DisplayServer constructor. That way the window is never shown until the boot splash is in place. It looks better to me, but it also means more time between launching the game/editor and actually seeing something. In non-debug builds the extra time should be pretty short, as long as the background color is displayed in the original post.

While digging into this I also realized that the "Minimum display time" setting for the boot splash includes time before the splash has been displayed. This means that the speed of the computer affects how long the splash is shown since any time spent before the splash is counted as showing the splash. Perhaps not very noticeable in final builds, but very obvious in debug builds and slower machines. I solved this by taking note of the time elapsed when the boot splash is actually shown and then taking that into account when deciding how long to wait before going from the splash to the game.

Changing when the main window is displayed feels like a major change so I thought I would ask about it here before providing a PR. Does this sound like a good approach? If so I can extend my experiment so it covers all platforms and make a PR.

@zoeesilcock zoeesilcock linked a pull request Feb 19, 2023 that will close this issue
zoeesilcock added a commit to zoeesilcock/godot that referenced this issue Feb 24, 2023
* Wait with displaying the main window until the splash screen is ready to be displayed to avoid showing the window without the splash (godotengine#71350).
* Fix how the "Minimum display time" setting is implemented by taking the time before the splash was first displayed into account.
Poobslag added a commit to Poobslag/frog-finder that referenced this issue Jun 1, 2023
Workaround for Godot #71350. The Vulkan rendering backends are complex
and require a long time to start (about 10 seconds). The resulting
graphical enhancements are worth it, but during development I prefer the
faster loading times of the Compatibility renderer.

godotengine/godot#71350
Poobslag added a commit to Poobslag/turbofat that referenced this issue Jun 1, 2023
Workaround for Godot #71350. The Vulkan rendering backends are complex and require a long time to start (about 10 seconds). The resulting graphical enhancements are worth it, but during development I prefer the faster loading times of the Compatibility renderer.

godotengine/godot#71350
Poobslag added a commit to Poobslag/turbofat that referenced this issue Jun 2, 2023
Workaround for Godot #71350. The Vulkan rendering backends are complex and require a long time to start (about 10 seconds). The resulting graphical enhancements are worth it, but during development I prefer the faster loading times of the Compatibility renderer.

godotengine/godot#71350
Poobslag added a commit to Poobslag/turbofat that referenced this issue Jun 14, 2023
Workaround for Godot #71350. The Vulkan rendering backends are complex and require a long time to start (about 10 seconds). The resulting graphical enhancements are worth it, but during development I prefer the faster loading times of the Compatibility renderer.

godotengine/godot#71350
Poobslag added a commit to Poobslag/turbofat that referenced this issue Jun 21, 2023
Added project/.godot to .gitignore

Fixed compilation errors introduced by the automated tool, such as
nonsensical 'super' calls, 'PackedStringArray' references, local
variable renames like 'bbcode_text'.

Fixed untyped export annotations

Fixed enums typed as ints. Godot 4 introduces an enum type, and enums
and ints are no longer interchangeable.

TileMap.clear() overrode a parent function, result in an error in Godot
4. Its functionality of updating the corner map has been extracted into
TileMap.refresh().

Updated 'a := max(b, c)' calls to explicitly specify float type. This
avoids a Godot 4 error, 'The variable type is being inferred from
a Variant value, so it will be typed as Variant. (Warning treated as
error.)'

Removed non-static JSON, File, DirAccess calls. The conversion tool uses
a verbose syntax for parsing JSON, but there are simple static method
calls which suffice.

Fixed signal/method/field name conflicts. Godot 3.x let you have signals
with the same names as fields, but Godot 4.x is more strict. Some
signals like 'show' and 'hide' were renamed to 'shown' and 'hidden';
other fields like 'finish_triggered' were renamed to an absurdly verbose
and confusing 'finish_trigger_emitted', which I hope to fix on
refactoring day if I can think of a better name.

Godot 4 returns errors if you have methods like 'show()' with the same
name as signals like 'show'. While Godot 4 is inconsistent about its
naming, only a few places use present tense signals like 'Popup.popup_hide' and
most scripts use past tense signals like 'CanvasItem.hidden'.

Fixed overridden/redefined methods and fields. Some methods such as 'play',
'stop', 'show', 'hide' and 'grab_focus' were overridden deliberately, but we now
achieve this functionality differently. Other fields like 'PI' and 'TAU' were
overridden by accident, because those fields didn't exist in Godot 3.x.

Fixed code which executed boolean logic using strings, arrays,
dictionaries, etc. I fixed some of these before the Godot 4.x upgrade,
but there were still many remaining.

Updated draw_polygon calls. Polygon antialiasing is disabled; this used to be
specified as a parameter to draw_colored_polygon but 'Normal maps are now
specified as part of the CanvasTexture rather than specifying them on the
Canvasitem itself' godotengine/godot#59683

Updated TileMap API references. Some methods like TileMap.get_cellv and
TileMap.get_cell_autotile_coord have Godot 4 replacements, others kept
the same name but introduced a new 'layer' parameter. Replaced Vector2/Rect2
references with Vector2i/Rect2i where appropriate

Various Godot 4 API renames: scancode -> keycode, pressed -> button_pressed,
constant -> theme_constant, autowrap -> autowrap_mode, Array.remove ->
remove_at, Array.invert -> reverse, FuncRef -> Callable,
OS.has_touchscreen_ui_hint -> DisplayServer.is_touchscreen_available,
update -> queue_redraw

Updated signal.connect(), signal.disconnect(), signal.is_connected() calls. The
automated process changed a lot of these but changed them in an unnecessarily
verbose way. I shortened them using nicer syntax, and fixed the ones it didn't
touch.

Compilation errors for tests

Updated Array.slice() calls.

Array.slice is now exclusive, not inclusive.

idle_frame -> process_frame

All tests pass. argb -> rgba; Joystick button mapping.

Replaced ARGB colors with RGBA; Godot 4.0 uses RGBA strings instead of Godot
3.x's ARGB.

Fixed KeybindManager's joystick button mapping. The old
get_joy_button_mapping() method returned an incredibly verbose and
unhelpful string, so I created a lookup table adapted from Godot 3.x.

Changed 'DPAD' references to 'D-Pad'. Despite Godot 3.x returning 'DPAD'
from its 'get_joy_button_string' method, I couldn't find it in its
source code, and Godot 4.x calls it a 'D-Pad' as well.

ReleaseToolkit fixes; stretch, theme, autowrap, align

Updated window stretch mode to 'canvas_items'

Added default font sizes to .theme files.

Fixed ReleaseToolkit's output label settings: autowrap_mode,
horizontal_alignment

Globally fixed align, valign, autowrap properties

'loop' -> 'loop_mode'

Updated 'extract keycode strings' logic

The keycode ranges for keys like 'Escape' and 'Tab' changed in Godot 4.
Additionally, Godot now logs a console error if you call
get_keycode_string with an invalid keycode, so I've created a skip list

scancodes -> keycodes

Godot 4 seems to have replaced the 'scancode' terminology with
'keycode', so I'm following their example. A player on an AZERTY
keyboard doesn't care that they pressed the key corresponding to the 'Q' key's
position, they care that they pressed the 'A' key.

Replaced #warning-ignore comments with annotations

Removed Utils.randi_range(); randi_range() is now a native function

Resolved some 'int instead of enum' warnings

Added Creatures.Orientation.NONE; some code was assigning orientation enums a
value of '-1' but there was no way to represent that state with an enum.

Minor comment delinting

Parameters

Resolving warnings

Added workarounds for static method calls. Self static method calls are
discouraged in Godot 4.x and result in a warning, due to Godot #69282
(godotengine/godot#69282)

There are many workarounds to avoid these warnings, but they all carry
severe drawbacks. Suppressing the warnings is the most sensible option,
but results in 300% more source code - transforming formerly readable
code into bloated festering piles of unnecessary comments and annotations. (See
test-level-history.gd for the most egregious example.) Prefixing the
static method calls is another option, but is gross for unnamed scripts,
and impossible for autoload singletons.

shader_param -> shader_parameter

Resolved all warnings from running unit tests.

Fixed anti-aliasing for landmark lines

Re-saved fonts/themes to avoid warnings.

Updated FontFitLabel references to use font_sizes property

Split up fonts and sizes. Created FontFitButtonDemo.

Created FontFitButtonDemo.

Scenes no longer use sized fonts like 'blogger-sans-bold-18.tres', but
instead use a regular font like 'blogger-sans-bold' with a font size
like '18'.

Removed redundant sized font files

Font files no longer store information on sizes.

Disabled @tool scripts.

I'm encountering crashes opening complex scenes like Puzzle.tscn and
PuzzleTileMap.tscn -- while I know the tilemaps are a mess, I also think
these kinds of tool scripts could be causing problems.

Disabled blend file import to avoid warning

Fixed invalid atlas size in PuzzleTileMap.tscn

Started rewriting puzzle tileset from scratch

NightPuzzleMap atlas, add_sibling

Updated NightPuzzleMap atlas texture sizes to fix out of bounds errors.

Fixed errant 'add_sibling' call.

Fixed bad atlas data for night playfield

Resolve some warnings/errors related to puzzles

Increased size of 'empty-8' resource.

Puzzle.tscn errors. Puzzle.tscn no longer crashes.

Puzzle scene no longer crashes editor.

Fixed FryingPansUi

icon-outline.shader now includes a modulate property. In Godot 4.x,
shaders no longer apply the 'modulate' property so we need to implement it
ourselves.

Experimenting with PlayfieldDemo

rv

PlayfieldDemo doesn't crash on startup

Recreating PuzzleTileMap from scratch

Godot's tilemap converter created literally thousands of 'Tile
Alternatives' for each tilemap. This results in .tscn files which, if
saved, balloon from ~5 kb to ~5 mb. The Godot editor can technically
open them, but there is no way to remove the Tile Alternatives except
right clicking each one.

Compatibility renderer.

Workaround for Godot #71350. The Vulkan rendering backends are complex and require a long time to start (about 10 seconds). The resulting graphical enhancements are worth it, but during development I prefer the faster loading times of the Compatibility renderer.

godotengine/godot#71350

Created alternative-tile-remover.gd EditorScript

alternative-tile-remover.gd works around a peculiarity of the Godot 4
upgrade process where it assumes all tilesets are 16x16, and then
creates a set of 8 tile alternatives for each tile. This means a
5000x5000 texture will have 780,000 (!) tile alternatives defined.

Experimenting with EditorScript

Experimented with making all tilesets 16x16 pixels

Restored TileMap cell sizes, atlas regions

Removed 'OldPuzzleTileSet' stuff. Removed next_alternative_id

I originally branched 'OldPuzzleTileSet' thinking I'd need to rewrite
the TileMaps and TileSets from scratch because they were crashing Godot,
but I found a better workaround.

Removed unnecessary 'next_alternative_id' properties.

Fixed PuzzleTileSet tile size

todo

Fixed playfield shadow positioning

Unset 'flip_v' for viewport textures

Something changed between Godot 3 and Godot 4 where flip_v is no longer
important.

Experimenting with PlayfieldFx alternative tiles

create_alternative_tile is having seemingly no effect

Added alternative tile tool script

This script proves that our approach to creating alternative tiles
works; something else is wrong

Fixed playfield lights not appearing.

Colors no longer function for dictionary indexes, so I'm now indexing
the dictionary by the color's hex representation

Regular playfield fx lights work, rainbow lights don't

removed next_alternative_id

cleanup/delint

PlayfieldDemo mostly works.

Playfield still appears a little strange in the editor, and various
ViewportTextures are visible in the editor even though their
corresponding viewports are empty. This seems related to Godot #77207.

godotengine/godot#77207

Fixed chalkboard stretching

Fixed ProgressBoardDemo, ProgressBoardTrailDemo

Particles lost a lot of important properties, including their initial
velocity and scale. "Baked point" calculations no longer work the same
way, because baked points are not equidistant.

Globally fixed Particles2D properties: initial_velocity, scale

Replaced 'initial_velocity', 'initial_velocity_random' with
'initial_velocity_min', 'initial_velocity_max'. Replaced 'scale',
'scale_random' with 'scale_min', 'scale_max'.

Globally fixed tilemap method references.

get_cellv -> get_cell_source_id
get_cell -> get_cell_source_id
cell_size -> tile_set.tile_size
clear -> clear_layer
set_cell calls must include fourth parameter 'Vector2.ZERO'
tile_set.tile_get_texture(id) -> tile_set.get_source(id).texture
tile_set.tile_get_material(id) -> tile_set.get_source(id).get_tile_data(Vector2i.ZERO, 0).material

Fixed ChatFrameDemo.

Fixed ChatFrame layout; restored anchors.

RectFitLabel's get_height() call was not passing in the font height, so
it was getting back an incorrect result.

Enabled 'repeat_enable' for chat shader texture.

Updated 'visible_characters_behavior' to 'characters_after_shaping' to
allow RectFitLabel's get_line_count() to return an accurate count and
reshape itself.

Globally tweaked 'visible_characters_behavior', 'repeat_enable'

Enabled VisibleCharactersBehavior -> VC_CHARS_AFTER_SHAPING for labels
which respond to line count.

Added repeat_enable flag for textures which need it.

Fixed rect_rotation math. Removed Godot #21789 workaround.

The Godot 4 upgrade process replaces 'rect_rotation' with 'rotation',
but rect_rotation is in degrees and rotation is in radians, and the
upgrader does not convert them. I've converted the values.

Removed Godot #21789 workaround to force 'get_class' to return a
specific value. This was implemented because 'if (field is MyClass)' did not
work in Godot 3, but it works in Godot 4 so the workaround is not
necessary.

Investigating buggy input

Scancode fixes. InputMapDemo improvements.

Converted stored scancodes from Godot 3 scancodes like '16777231' to
Godot 4 scancodes like '4194319'.

Experimenting with ChatChoices

Added debug stufff to chat choices

Improved 'swallow chat input' code

In Godot 4, the signal order appears to have changed. The old code to
swallow the player's input during chat prompts was also preventing chat
prompts from being selected at all -- the button wasn't even being pressed.

Starting to fix creatures, moods

Fixed creature 'tool scripts'

DnaLoader.load_dna() seems to work? maybe?

Prevent more CreatureVisuals warnings/errors

Fixed DNA not being unloaded

rotation_degrees, process_mode

Changed rotation_degrees to rotation. Godot's AnimationPlayer will still
animate a 'rotation_degrees' property but just treats it as radians, so all
objects rotate about 60x further than they're supposed to. I've manually
(ugh) converted all degree values to radians.

Updated process_mode=2 to process_mode=3. Godot 3 did not have
process_mode but had pause_mode, but Godot 4 converts this value
incorrectly: process_mode=2 is not 'always process', it is 'process when
paused'

Fixed stream ids

Fixed cubic interpolation glitch with animations

Godot 4 changed how cubic interpolation works; for values like [0, 16,
12] the interpolation used to gradually shift the value from 0 to 16 and
back down to 12. In Godot 4, it now swings the value radically from 0 to
40, and then back down to 12. I worked around this bug by adding a
second redundant point along the curve. It still doesn't look identical
to Godot 3, but it looks similar.

Fixed MusicPlayerDemo

Restored creature limbs moving as they fatten

The 'fat players' in Godot 3 used to preserve sprite positions even when
stop() was called, but in Godot 4 the sprite positions are reset unless
we explicitly call 'stop(true)' which preserves them.

Restored default creature visuals.

Without these creature visuals, MoodDemo looks really strange when it
first pops up.

Restored 'y_sort_enabled'. Updated RichTextLabel clear fix.

Enabled 'y_sort_enabled' property for YSort nodes from Godot 3.5.

Updated RichTextLabel clear fix -- updating the 'text' field to empty
clears the tag stack.

edit creature off

Fixed carrot particle effects.

Global particle fixes: disable_z, color_ramp, etc

The initial_velocity and scale properties had already been updated, but
I updated the remaining properties:
  flag_disable_z -> particle_flag_disable_z
  orbit_velocity -> orbit_velocity_min/max
  anim_offset -> anim_offset_min/max
  mission_shape = 2 -> 3 (box)
  angle -> angle_min/max
  damping -> damping_min_max

Additionally, particle gradients have changed from 'GradientTexture2D'
to 'GradientTexture1D'.

I restored some missing particle properties for scenes such as
NightPlayfield, CreatureVisuals and PieceManager. Godot 4 removed these
particle properties automatically upon saving the scene for the first
time.

CHanged onion reset to 'discrete'

Changed Onion AnimationPlayer's blend modes to 'discrete' to avoid a
warning, 'Value track: Onion:frame with different update modes are
blended. Blending prioritizes Discrete mode, so other update mode tracks
will not be blended. (User)'

Onion state machine advance_mode.

Updated onion state machine 'advance_mode' to auto. Godot 3 defaults to
auto, but Godot 4 defaults to 'enabled' which prevents the state machine
from doing everything. (Not sure why they did this.)

Fixed PuzzleTileMap corners. Fixed shark warnings.

PuzzleTileMap corners were using the wrong tile size.

Removed unused puzzle-corner-tile-set-g4.tres.

Fixed 'shadowed field name' warning.

Fixed LevelRankDemo appearance, signals

FileDialog, AcceptDialog are no longer controls, and instead have a
'size' attribute. I've set the size to be sensible.

Dialogs no longer include a 'popup_hide' signal and there is seemingly
no replacement. I've added a PopupHideSignalEmitter node which hooks
into 'visibility_changed'.

Dialog sizes, modes.

In Godot 3, dialogs were Controls and used a layout manager. In Godot 4,
dialogs must have their size set explicitly.

Applied 'popup_hide' kludge throughout project

Refactored 'internal field' workaround

Unlike setget in previous Godot versions, the properties setter and getter are
always called, even when accessed inside the same class (with or without
prefixing with self.). This makes the behavior consistent. Godot's official
guidance is to use another variable for direct access and make the property
code use that name.

We now override the getters to return the internal value as well. This
avoids an edge case where the internal value was set, but the external
value still returned the old value.

Fixed some warnings from PuzzleCritterDemo

Fixed crashes when launching PuzzleCritterDemo

PuzzleCritterDemo warnings/errors. Locales.

Updated MilestoneHud ProgressBar styles for Godot 4.

Fixed compile errors in food-items.gd

Removed unused field from overworld-exit.gd.

Added missing 'en' 'es' locales to project settings.

Cosmetic SettingsMenu changes

Overrode default 'line_spacing' value for labels. This was making the
volume sliders taller than they used to be and making the UI less
efficient where fewer rows were visible.

Fixed 'delete save slot' button to be square again.

Dialog backdrops, confirm close buttons

Fixed dialog backdrops; with Godot 4's anchor changes, these backdrops
were all zero size in the upper left corner. They're now fullscreen
again.

Restored close button events for confirm dialogs. There is no longer a
`get_close_button` method and signals are instead added to the `close`
event.

Added missing super() calls.

Godot 3 automatically called native parent methods such as _ready() and
_physics_process() but Godot 4 does not. I've added these explicit
parent method calls. I think these are only necessary when extending
custom types such as 'RectFitLabel' and 'OverworldObstacle', not
built-in types such as 'AnimationPlayer'

Fixed ProgressBars.

show_as_percent -> show_percentage, custom_styles/fg ->
theme_override_styles/fill, custom_styles/bg ->
theme_override_styles/background

Creature orientations. Removed super(). Puzzle UI.

Updated creature orientations; .tscn files do not use the constants
defined in 'creatures.gd' so they were all off by one.

Removed unnecessary 'super()' calls; calling 'super()' when no parent
method is defined results in an error.

Updated label spacing for labels in Puzzle.gd.

Updated settings menu close button size.

Unset stretch_shrink, replaced Light2D masks

Unset 'stretch_shrink' mode for RestaurantView, this was making the
camera very very zoomed out.

Replaced Light2Ds using clip mode with Sprite2Ds using clip_children.
Godot 4 removed the 'clip mode' for Light2D.

Camera3D -> Camera2D
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants