godotengine / godotengine/godot-docs

feedback from an upgrade to godot 4

Open
#6,736 3 comments 2 reactions 0 assignees View on GitHub
area:manual enhancement
Dominant language
reStructuredText
Stars
5.7k
Forks
3.8k
Avg merge
1d 20h
Merged PRs (30d)
25

Description

**Your Godot version:**
Godot 3.5.1 & 4.0.beta17

**Issue description:**
Here's a list, a bit messy, of things I would have liked to know when converting my project to godot 4.0. Maybe it can give some enhancement for "[Upgrading from Godot 3 to Godot 4](https://docs.godotengine.org/en/4.0/tutorials/migrating/upgrading_to_godot_4.html)" documentation page.

GDScript:
- Registering named classes changes from [`class_name Name, "res://path/to/optional/icon.svg"`](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdscript/gdscript_basics.html#registering-named-classes) to
[`@icon("res://path/to/optional/icon.svg") ; class_name Name`](https://docs.godotengine.org/en/4.0/tutorials/scripting/gdscript/gdscript_basics.html#registering-named-classes) and the new order imposed by [this PR](https://github.com/godotengine/godot/pull/67774)
- setters and getters : [`setget setget_function`](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdscript/gdscript_basics.html#setters-getters) is now [`: set set_function, get get_function`](https://docs.godotengine.org/en/4.0/tutorials/scripting/gdscript/gdscript_basics.html#properties-setters-and-getters)
- export variables : the all-purpose word [`export`](https://docs.godotengine.org/en/3.5/tutorials/scripting/gdscript/gdscript_exports.html#doc-gdscript-exports) now has many variations for advanced uses ([`@export`, `@export_enum`, `@export_flags`, `@export_file`...](https://docs.godotengine.org/en/4.0/tutorials/scripting/gdscript/gdscript_exports.html#doc-gdscript-exports))

TileMap:
- TileMap's property [`Vector2 cell_size`](https://docs.godotengine.org/en/3.5/classes/class_tilemap.html?highlight=cell_size#class-tilemap-property-cell-size) no longer exists
- TileMap now has layers, so many properties and methods must use them and have been changed (`set_cell`, `get_used_cells`....)
- `set_cell` now takes 3 parameters which by default will erased the cell [(`source_id`, `atlas_coords`, `alternative_tile`)](https://docs.godotengine.org/en/4.0/classes/class_tilemap.html#class-tilemap-method-set-cell) (it is very well explained in the specific documentation but as the change does not cause an error or a crash, it may take a long time to notice)

Window:
- [`fileDialog.mode`](https://docs.godotengine.org/en/3.5/classes/class_filedialog.html#class-filedialog-property-mode) --> [`fileDialog.file_mode`](https://docs.godotengine.org/en/4.0/classes/class_filedialog.html#class-filedialog-property-file-mode) (the getter and setter methods changes are already noted in the upgrade page.) And by extension the enumeration changes (`enum Mode` -> `enum FileMode` : `MODE_OPEN_FILE` -> `FILE_MODE_OPEN_FILE`, `MODE_OPEN_DIR` -> `FILE_MODE_OPEN_DIR`...
- the way to retrieve the window close signal by pressing the escape key seems to have changed from [`modal_closed()`](https://docs.godotengine.org/en/3.5/classes/class_control.html?highlight=modal_closed#class-control-signal-modal-closed) to [`close_requested()`](https://docs.godotengine.org/en/4.0/classes/class_window.html#class-window-signal-close-requested)
- [`WindowDialog.resizable = false`](https://docs.godotengine.org/en/3.5/classes/class_windowdialog.html#class-windowdialog-property-resizable) and [`EditorFileDialog.resizable = true`](https://docs.godotengine.org/en/3.5/classes/class_editorfiledialog.html?highlight=resizable#properties) --> [`Window.unresizable = false`](https://docs.godotengine.org/en/4.0/classes/class_window.html#class-window-property-unresizable) and [`Popup.unresizable = true`](https://docs.godotengine.org/en/4.0/classes/class_popup.html#properties)

Other:
- KinematicCollision2D [properties](https://docs.godotengine.org/en/4.0/classes/class_kinematiccollision2d.html#kinematiccollision2d) now are only accessible by [methods](https://docs.godotengine.org/en/4.0/classes/class_kinematiccollision2d.html#methods) (but I think this is not the only object that has been modified in this way)
- `add_sibling( Node node, Node sibling )` (which I cannot find in the 3.x documentation) is now [`node.add_sibling( Node sibling )`](https://docs.godotengine.org/en/4.0/classes/class_node.html#class-node-method-add-sibling)
- [`close()`](https://docs.godotengine.org/en/3.5/classes/class_file.html?highlight=file%20close%20open#class-file-method-close) --> ["There is no method to close a file in order to free it from use."](https://docs.godotengine.org/en/4.0/classes/class_fileaccess.html#class-fileaccess)
- Theme overrides properties path `custom_.../` (`custom_colors/`, `custom_constants/`, `custom_fonts/`, `custom_styles`) is now `theme_override_.../` (`theme_override_colors/`, `theme_override_constants/`, `theme_override_fonts/`, `theme_override_styles`) and we can override font size without override all the font with `theme_override_font_sizes/font_size`
- [`property_list_changed_notify()`](https://docs.godotengine.org/en/3.5/classes/class_object.html#class-object-method-property-list-changed-notify) --> [`notify_property_list_changed()`](https://docs.godotengine.org/en/4.0/classes/class_object.html#class-object-method-notify-property-list-changed)

Inheritance :
- `_ready()` in inheritance is now overrided by new `_ready()`. let me explain with this

example

```
# Base.gd
class_name Base
func _ready():
print("base")
```
```
# inherited.gd
extends Base
func _ready():
print("inherited")
```

- in godot 3.5 output:

```
base
inherited
```

- in godot 4.0 beta output:

```
inherited
```

**URL to the documentation page (if already existing):**
https://docs.godotengine.org/en/4.0/tutorials/migrating/upgrading_to_godot_4.html

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.