godot 4 transition - Poobslag/turbofat GitHub Wiki

Godot 4 tilemap limitations

I attempted to migrate Turbo Fat from Godot 3.6 to Godot 4.0 in May and June 2023. Progress was steady, however Godot 4 has [https://github.com/godotengine/godot-proposals/issues/7133](no way to implement Turbo Fat's rhomboid TileMaps).

Godot 4 rewrite Godot 3's TileMap code from scratch. This came with many helpful improvements including tilemap layers, more powerful autotiling and randomized terrain which would allow us to get rid of a lot of custom code. However, it also includes some tremendous regressions including the removal of cell_custom_transform support, which means all tilemaps must one of three predefined shapes (squares, diamonds or hexagons). No other shapes are supported, such as the slanted squares used for Turbo Fat's indoor scenes.

Until Godot proposal #7133 is implemented or a suitable workaround is conceived, the project cannot be migrated to Godot 4.0.

Partially migrated code

The partially implemented Godot 4.0 code remains available on the godot-4 and godot-4-unsquished branches. The accompanying todo.txt file enumerates the remaining work to complete the migration:

  • Game should run
    • tilemap updates
    • localization
    • restore tool scripts
    • regression test
    • fix all demos (20/37 complete)
    • ensure it runs on Windows
    • ensure it runs on HTML5
    • ensure it runs on Linux
    • ensure it runs on Android
  • Game should export
    • Restore export presets for all targets
    • Fix export packaging script
    • Regression test exported versions
  • Gold plating
    • Document new Godot 4 conventions in Wiki
    • GDScript style changes
    • Additional "code smell detection" code in delint.sh

Godot 4.0 issue list

The following issues were scheduled as a part of the Godot 4.0 migration, and have been closed because the migration is infeasible.

Godot 4.0 refactoring list

  • Carrot smoke's angular_velocity only ranges from 0-360 because of limitations in Godot 3, but now we can make it go in both directions if it looks better. This also applies to all other angular_velocity particles
  • Resolve "Blend File Format" warning introduced in Godot 4
  • Our Godot 4 upgrade introduced some weird PuzzleState 'tutorial_section_finish_emitted' signals and methods; this might not be a naming antipattern as much as a behavior antipattern
  • Money font 'outline of 3, etc' stuff used to be centralized in money-font.tres. Find a way to centralize this again so we don't repeat it everywhere
  • Avoid @warning_ignore("native_method_override")
  • Avoid Callable(self, "_foo"), use _foo instead. It's much shorter.
  • During our Godot 4 upgrade, our RegionSelectButton.grab_focus() method was renamed to avoid overriding, but a different design might be better
  • Remove 'Array of...' from comments. The type tells you its an array, this is almost always redundant.
  • Instead of having a bunch of themes for each font size, we can have one theme; font size and underlinedness can be set on each label. (Is that better?)
  • Our Godot 4 upgrade introduced some if not... else statements which we might reconsider.