upgrading_to_godot_4.3.rst 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  1. .. _doc_upgrading_to_godot_4.3:
  2. Upgrading from Godot 4.2 to Godot 4.3
  3. =====================================
  4. For most games and apps made with 4.2 it should be relatively safe to migrate to 4.3.
  5. This page intends to cover everything you need to pay attention to when migrating
  6. your project.
  7. Breaking changes
  8. ----------------
  9. If you are migrating from 4.2 to 4.3, the breaking changes listed here might
  10. affect you. Changes are grouped by areas/systems.
  11. This article indicates whether each breaking change affects GDScript and whether
  12. the C# breaking change is *binary compatible* or *source compatible*:
  13. - **Binary compatible** - Existing binaries will load and execute successfully without
  14. recompilation, and the run-time behavior won't change.
  15. - **Source compatible** - Source code will compile successfully without changes when
  16. upgrading Godot.
  17. GDExtension
  18. ^^^^^^^^^^^
  19. ======================================================================================================================== =================== ==================== ==================== ===========
  20. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  21. ======================================================================================================================== =================== ==================== ==================== ===========
  22. **GDExtension**
  23. Method ``close_library`` removed |❌| |❌| |❌| `GH-88418`_
  24. Method ``initialize_library`` removed |❌| |❌| |❌| `GH-88418`_
  25. Method ``open_library`` removed |❌| |❌| |❌| `GH-88418`_
  26. ======================================================================================================================== =================== ==================== ==================== ===========
  27. Since it was basically impossible to use these methods in any useful way, these methods have been removed. Use ``GDExtensionManager::load_extension`` and ``GDExtensionManager::unload_extension`` instead to correctly load and unload a GDExtension.
  28. Animation
  29. ^^^^^^^^^
  30. ======================================================================================================================== =================== ==================== ==================== ===========
  31. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  32. ======================================================================================================================== =================== ==================== ==================== ===========
  33. **Animation**
  34. Method ``position_track_interpolate`` adds a new ``backward`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-86629`_
  35. Method ``rotation_track_interpolate`` adds a new ``backward`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-86629`_
  36. Method ``scale_track_interpolate`` adds a new ``backward`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-86629`_
  37. Method ``blend_shape_track_interpolate`` adds a new ``backward`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-86629`_
  38. Method ``value_track_interpolate`` adds a new ``backward`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-86629`_
  39. Method ``track_find_key`` adds a new ``limit`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-86661`_
  40. Method ``track_find_key`` adds a new ``backward`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-92861`_
  41. **AnimationMixer**
  42. Method ``_post_process_key_value`` changes ``object`` parameter type from ``Object`` to ``uint64`` |✔️| |❌| |❌| `GH-86687`_
  43. **Skeleton3D**
  44. Method ``add_bone`` changes return type from ``void`` to ``int32`` |✔️| |❌| |✔️| `GH-88791`_
  45. Signal ``bone_pose_changed`` replaced by ``skeleton_updated`` |❌| |❌| |❌| `GH-90575`_
  46. **BoneAttachment3D**
  47. Method ``on_bone_pose_update`` replaced by ``on_skeleton_update`` |✔️| |✔️ with compat| |✔️ with compat| `GH-90575`_
  48. ======================================================================================================================== =================== ==================== ==================== ===========
  49. GUI nodes
  50. ^^^^^^^^^
  51. ======================================================================================================================== =================== ==================== ==================== ===========
  52. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  53. ======================================================================================================================== =================== ==================== ==================== ===========
  54. **AcceptDialog**
  55. Method ``register_text_enter`` changes parameter ``line_edit`` type from ``Control`` to ``LineEdit`` |✔️| |✔️ with compat| |✔️ with compat| `GH-89419`_
  56. Method ``remove_button`` changes parameter ``button`` type from ``Control`` to ``Button`` |✔️| |✔️ with compat| |✔️ with compat| `GH-89419`_
  57. ======================================================================================================================== =================== ==================== ==================== ===========
  58. Physics
  59. ^^^^^^^
  60. ======================================================================================================================== =================== ==================== ==================== ===========
  61. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  62. ======================================================================================================================== =================== ==================== ==================== ===========
  63. **PhysicsShapeQueryParameters3D**
  64. Property ``motion`` changes type from ``Vector2`` to ``Vector3`` |❌| |❌| |❌| `GH-85393`_
  65. ======================================================================================================================== =================== ==================== ==================== ===========
  66. .. note::
  67. In C#, the enum ``PhysicsServer3D.G6DofJointAxisFlag`` breaks compatibility because of the way the bindings generator
  68. detects the enum prefix. New members were added in `GH-89851`_ to the enum that caused the enum members to be renamed.
  69. Rendering
  70. ^^^^^^^^^
  71. ======================================================================================================================== =================== ==================== ==================== ===========
  72. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  73. ======================================================================================================================== =================== ==================== ==================== ===========
  74. **RenderingDevice**
  75. Enum field ``FinalAction.FINAL_ACTION_CONTINUE`` changes value from ``2`` to ``0`` |✔️| |❌| |❌| `GH-84976`_
  76. Enum field ``InitialAction.INITIAL_ACTION_CLEAR`` changes value from ``0`` to ``1`` |✔️| |❌| |❌| `GH-84976`_
  77. Enum field ``InitialAction.INITIAL_ACTION_CLEAR_REGION_CONTINUE`` changes value from ``2`` to ``1`` |✔️| |❌| |❌| `GH-84976`_
  78. Enum field ``InitialAction.INITIAL_ACTION_CONTINUE`` changes value from ``5`` to ``0`` |✔️| |❌| |❌| `GH-84976`_
  79. Enum field ``InitialAction.INITIAL_ACTION_DROP`` changes value from ``4`` to ``2`` |✔️| |❌| |❌| `GH-84976`_
  80. Enum field ``InitialAction.INITIAL_ACTION_KEEP`` changes value from ``3`` to ``0`` |✔️| |❌| |❌| `GH-84976`_
  81. Method ``buffer_clear`` removes ``post_barrier`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  82. Method ``buffer_update`` removes ``post_barrier`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  83. Method ``compute_list_begin`` removes ``allow_draw_overlap`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  84. Method ``compute_list_end`` removes ``post_barrier`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  85. Method ``draw_list_begin`` removes ``storage_textures`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  86. Method ``draw_list_end`` removes ``post_barrier`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  87. Method ``texture_clear`` removes ``post_barrier`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  88. Method ``texture_copy`` removes ``post_barrier`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  89. Method ``texture_resolve_multisample`` removes ``post_barrier`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  90. Method ``texture_update`` removes ``post_barrier`` parameter |✔️| |✔️ with compat| |✔️ with compat| `GH-84976`_
  91. **RenderingServer**
  92. Method ``environment_set_fog`` adds a new ``fog_mode`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-84792`_
  93. **RenderSceneBuffersRD**
  94. Method ``get_color_layer`` adds a new ``msaa`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-80214`_
  95. Method ``get_depth_layer`` adds a new ``msaa`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-80214`_
  96. Method ``get_velocity_layer`` adds a new ``msaa`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-80214`_
  97. Method ``get_color_texture`` adds a new ``msaa`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-80214`_
  98. Method ``get_depth_texture`` adds a new ``msaa`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-80214`_
  99. Method ``get_velocity_texture`` adds a new ``msaa`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-80214`_
  100. ======================================================================================================================== =================== ==================== ==================== ===========
  101. .. note::
  102. While the values of the enum fields in ``RenderingDevice.InitialAction`` and ``RenderingDevice.FinalAction`` changed,
  103. the only method that consumed them (``draw_list_begin``) added a compatibility method which supports the old values.
  104. So in practice it doesn't break compatibility.
  105. .. note::
  106. In C#, the enum ``RenderingDevice.DriverResource`` breaks compatibility because of the way the bindings generator
  107. detects the enum prefix. New members were added in `GH-83452`_ to the enum that caused the enum members to be
  108. renamed.
  109. Text
  110. ^^^^
  111. ======================================================================================================================== =================== ==================== ==================== ===========
  112. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  113. ======================================================================================================================== =================== ==================== ==================== ===========
  114. **Font**
  115. Method ``find_variation`` adds a new ``baseline_offset`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-87668`_
  116. **RichTextLabel**
  117. Method ``push_meta`` adds a new ``underline_mode`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-89024`_
  118. **TextServer**
  119. Method ``shaped_text_get_word_breaks`` adds a new optional ``skip_grapheme_flags`` parameter |✔️| |✔️ with compat| |✔️| `GH-90732`_
  120. **TextServerExtension**
  121. Method ``_shaped_text_get_word_breaks`` adds a new ``skip_grapheme_flags`` parameter |❌| |❌| |❌| `GH-90732`_
  122. ======================================================================================================================== =================== ==================== ==================== ===========
  123. Audio
  124. ^^^^^
  125. ======================================================================================================================== =================== ==================== ==================== ===========
  126. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  127. ======================================================================================================================== =================== ==================== ==================== ===========
  128. **AudioStreamPlaybackPolyphonic**
  129. Method ``play_stream`` adds new ``playback_type``, and ``bus`` optional parameters |✔️| |✔️ with compat| |✔️| `GH-91382`_
  130. ======================================================================================================================== =================== ==================== ==================== ===========
  131. Navigation
  132. ^^^^^^^^^^
  133. ======================================================================================================================== =================== ==================== ==================== ===========
  134. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  135. ======================================================================================================================== =================== ==================== ==================== ===========
  136. **AStar2D**
  137. Method ``get_id_path`` adds new ``allow_partial_path`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-88047`_
  138. Method ``get_point_path`` adds new ``allow_partial_path`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-88047`_
  139. **AStar3D**
  140. Method ``get_id_path`` adds new ``allow_partial_path`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-88047`_
  141. Method ``get_point_path`` adds new ``allow_partial_path`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-88047`_
  142. **AStarGrid2D**
  143. Method ``get_id_path`` adds new ``allow_partial_path`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-88047`_
  144. Method ``get_point_path`` adds new ``allow_partial_path`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-88047`_
  145. **NavigationRegion2D**
  146. Property ``avoidance_layers`` removed |❌| |❌| |❌| `GH-90747`_
  147. Property ``constrain_avoidance`` removed |❌| |❌| |❌| `GH-90747`_
  148. Method ``get_avoidance_layer_value`` removed |❌| |❌| |❌| `GH-90747`_
  149. Method ``set_avoidance_layer_value`` removed |❌| |❌| |❌| `GH-90747`_
  150. ======================================================================================================================== =================== ==================== ==================== ===========
  151. .. note::
  152. The constrain avoidance feature in ``NavigationRegion2D`` was experimental and has been discontinued with no
  153. replacement.
  154. TileMap
  155. ^^^^^^^
  156. ======================================================================================================================== =================== ==================== ==================== ===========
  157. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  158. ======================================================================================================================== =================== ==================== ==================== ===========
  159. **TileData**
  160. Method ``get_navigation_polygon`` adds new ``flip_h``, ``flip_v``, and ``transpose`` optional parameters |✔️| |✔️ with compat| |✔️| `GH-84660`_
  161. Method ``get_occluder`` adds new ``flip_h``, ``flip_v``, and ``transpose`` optional parameters |✔️| |✔️ with compat| |✔️| `GH-84660`_
  162. ======================================================================================================================== =================== ==================== ==================== ===========
  163. XR
  164. ^^
  165. ======================================================================================================================== =================== ==================== ==================== ===========
  166. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  167. ======================================================================================================================== =================== ==================== ==================== ===========
  168. **WebXRInterface**
  169. Method ``get_input_source_tracker`` changes return type from ``XRPositionalTracker`` to ``XRControllerTracker`` |✔️| |❌| |✔️| `GH-90645`_
  170. **XRServer**
  171. Method ``get_tracker`` changes return type from ``XRPositionalTracker`` to ``XRTracker`` |✔️| |❌| |❌| `GH-90645`_
  172. ======================================================================================================================== =================== ==================== ==================== ===========
  173. Editor plugins
  174. ^^^^^^^^^^^^^^
  175. ======================================================================================================================== =================== ==================== ==================== ===========
  176. Change GDScript Compatible C# Binary Compatible C# Source Compatible Introduced
  177. ======================================================================================================================== =================== ==================== ==================== ===========
  178. **EditorInspectorPlugin**
  179. Method ``add_property_editor`` adds a new ``label`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-92322`_
  180. **EditorPlugin**
  181. Method ``add_control_to_bottom_panel`` adds a new ``shortcut`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-88081`_
  182. Method ``add_control_to_dock`` adds a new ``shortcut`` optional parameter |✔️| |✔️ with compat| |✔️| `GH-88081`_
  183. **EditorSceneFormatImporterFBX**
  184. Type renamed to ``EditorSceneFormatImporterFBX2GLTF`` |❌| |❌| |❌| `GH-81746`_
  185. ======================================================================================================================== =================== ==================== ==================== ===========
  186. Behavior changes
  187. ----------------
  188. In 4.3 some behavior changes have been introduced, which might require you to adjust your project.
  189. Core
  190. ^^^^
  191. .. note::
  192. Binary serialization was modified to fix some issues with the serialization of scripted Objects and typed Arrays (`GH-78219`_).
  193. This breaks compat with script encoding/decoding.
  194. .. note::
  195. ``PackedByteArray`` is now able to use a more compact base64 encoding for storage. But the trade-off is that it breaks
  196. compatibility, meaning that older versions of Godot may not be able to open resources saved by 4.3 (`GH-89186`_).
  197. To maximize compatibility, this new storage format will only be enabled for resources and scenes that contain large
  198. PackedByteArrays for now. Support for this new format will also be added in patch updates for older versions of Godot.
  199. Once all supported Godot versions are able to read the new format, we will gradually retire the compatibility measures
  200. and have all resources and scenes use the new storage format.
  201. .. note::
  202. In C#, the ``Transform3D.InterpolateWith`` implementation was fixed to use the right order of operations, applying the rotation before the scale (`GH-89843`_).
  203. .. note::
  204. In C#, the ``Aabb.GetSupport`` implementation was fixed to properly return the support vector (`GH-88919`_).
  205. .. note::
  206. In C#, the Variant types' ``ToString`` implementation now defaults to using the ``InvariantCulture`` (`GH-89547`_)
  207. which means ``Vector2(1.2, 3.4)`` is formatted using ``.`` as the decimal separator independently of the language
  208. of the operating system that the program is running on.
  209. Animation
  210. ^^^^^^^^^
  211. .. note::
  212. ``AnimationMixer`` replaced its Capture mode with a new Capture feature that works much better than the old one,
  213. this replaces the existing cache (`GH-86715`_).
  214. .. note::
  215. ``AnimationNode`` has a reworked process for retrieving the semantic time info. This ensures that time-related
  216. behavior works as expected, but changes the blending behavior. Implementors of the ``_process`` virtual method
  217. should also note that this method is now deprecated and will be replaced by a new one in the future (`GH-87171`_).
  218. More information about the changes to Animation can be found in the
  219. `Migrating Animations from Godot 4.0 to 4.3 <https://godotengine.org/article/migrating-animations-from-godot-4-0-to-4-3>`__
  220. article.
  221. GUI nodes
  222. ^^^^^^^^^
  223. .. note::
  224. The default font outline color was changed from white to black (`GH-54641`_).
  225. .. note::
  226. The ``auto_translate`` property is deprecated in favor of the ``auto_translate_mode`` property which is now in ``Node`` (`GH-87530`_).
  227. The default value for ``auto_translate_mode`` is ``AUTO_TRANSLATE_INHERIT``, which means nodes inherit the ``auto_translate_mode`` value
  228. from their parent. This means, existing nodes with the ``auto_translate`` property set to ``true`` may no longer be translated if they
  229. are children of a node with the ``auto_translate`` property set to ``false``.
  230. Multiplayer
  231. ^^^^^^^^^^^
  232. .. note::
  233. The ``SceneMultiplayer`` caching protocol was changed to send the received ID instead of the Node path when sending a node removal confirmation packet (`GH-90027`_).
  234. This is a breaking change for the high-level multiplayer protocol making it incompatible with previous Godot versions.
  235. Upgrade both your server and client versions to Godot 4.3 to handle this change gracefully.
  236. Note that high-level multiplayer facilities are only ever meant to be compatible with server and client using the same Godot version. It is recommended to implement some kind of version checking.
  237. Rendering
  238. ^^^^^^^^^
  239. .. note::
  240. Decals now convert the modulate color from an sRGB color to a linear color, like all other inputs, to ensure proper
  241. blending (`GH-89849`_). Existing projects that were using the decal's modulate property will notice a change in
  242. their visuals.
  243. .. note::
  244. The reverse Z depth buffer technique is now implemented. This may break compatibility for some shaders.
  245. Read the `Introducing Reverse Z (AKA I'm sorry for breaking your shader) <https://godotengine.org/article/introducing-reverse-z/>`__
  246. article for more information and guidance on how to fix common scenarios.
  247. TileMap
  248. ^^^^^^^
  249. .. note::
  250. ``TileMap`` layers were moved to individual nodes (`GH-87379`_ and `GH-89179`_).
  251. Android
  252. ^^^^^^^
  253. .. note::
  254. Android permissions are no longer requested automatically because it goes against the recommended best practices (`GH-87080`_).
  255. Use the ``request_permission`` method in ``OS`` and the ``on_request_permissions_result`` signal on ``MainLoop`` to request
  256. permissions and wait for the user response.
  257. .. |❌| replace:: :abbr:`❌ (This API breaks compatibility.)`
  258. .. |✔️| replace:: :abbr:`✔️ (This API does not break compatibility.)`
  259. .. |✔️ with compat| replace:: :abbr:`✔️ (This API does not break compatibility. A compatibility method was added.)`
  260. .. _GH-54641: https://github.com/godotengine/godot/pull/54641
  261. .. _GH-78219: https://github.com/godotengine/godot/pull/78219
  262. .. _GH-80214: https://github.com/godotengine/godot/pull/80214
  263. .. _GH-81746: https://github.com/godotengine/godot/pull/81746
  264. .. _GH-83452: https://github.com/godotengine/godot/pull/83452
  265. .. _GH-84660: https://github.com/godotengine/godot/pull/84660
  266. .. _GH-84792: https://github.com/godotengine/godot/pull/84792
  267. .. _GH-84976: https://github.com/godotengine/godot/pull/84976
  268. .. _GH-85393: https://github.com/godotengine/godot/pull/85393
  269. .. _GH-86629: https://github.com/godotengine/godot/pull/86629
  270. .. _GH-86661: https://github.com/godotengine/godot/pull/86661
  271. .. _GH-86687: https://github.com/godotengine/godot/pull/86687
  272. .. _GH-86715: https://github.com/godotengine/godot/pull/86715
  273. .. _GH-87080: https://github.com/godotengine/godot/pull/87080
  274. .. _GH-87171: https://github.com/godotengine/godot/pull/87171
  275. .. _GH-87379: https://github.com/godotengine/godot/pull/87379
  276. .. _GH-87530: https://github.com/godotengine/godot/pull/87530
  277. .. _GH-87668: https://github.com/godotengine/godot/pull/87668
  278. .. _GH-87888: https://github.com/godotengine/godot/pull/87888
  279. .. _GH-88047: https://github.com/godotengine/godot/pull/88047
  280. .. _GH-88081: https://github.com/godotengine/godot/pull/88081
  281. .. _GH-88418: https://github.com/godotengine/godot/pull/88418
  282. .. _GH-88791: https://github.com/godotengine/godot/pull/88791
  283. .. _GH-88919: https://github.com/godotengine/godot/pull/88919
  284. .. _GH-89024: https://github.com/godotengine/godot/pull/89024
  285. .. _GH-89179: https://github.com/godotengine/godot/pull/89179
  286. .. _GH-89186: https://github.com/godotengine/godot/pull/89186
  287. .. _GH-89419: https://github.com/godotengine/godot/pull/89419
  288. .. _GH-89547: https://github.com/godotengine/godot/pull/89547
  289. .. _GH-89843: https://github.com/godotengine/godot/pull/89843
  290. .. _GH-89849: https://github.com/godotengine/godot/pull/89849
  291. .. _GH-89851: https://github.com/godotengine/godot/pull/89851
  292. .. _GH-90027: https://github.com/godotengine/godot/pull/90027
  293. .. _GH-90575: https://github.com/godotengine/godot/pull/90575
  294. .. _GH-90645: https://github.com/godotengine/godot/pull/90645
  295. .. _GH-90732: https://github.com/godotengine/godot/pull/90732
  296. .. _GH-90747: https://github.com/godotengine/godot/pull/90747
  297. .. _GH-91382: https://github.com/godotengine/godot/pull/91382
  298. .. _GH-92322: https://github.com/godotengine/godot/pull/92322
  299. .. _GH-92861: https://github.com/godotengine/godot/pull/92861