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

Convert physics test projects to 4.0 #638

Merged

Conversation

pouleyKetchoupp
Copy link
Contributor

@pouleyKetchoupp pouleyKetchoupp commented Aug 4, 2021

Everything seems to work except for a few specific issues.
I'm listing all the changes I've made in case it helps for future conversions and for keeping track of possible issues for users.

General changes:

  • Control nodes: margin_* renamed to offset_*
  • Annotations: @export, @export_range, @tool, @onready
  • Some export variables need to be static typed since export annotations don't include a type anymore
  • Signal connections using Callable
  • Variable setters and getters using set/get functions instead of setget keyword
  • Some variable setters need to be changed to avoid a stack overflow
  • Renamed 3D classes referenced in gdscript
  • Using await instead of yield, no more completed signal
  • Using super calls in built-on functions to call the parent script when needed
  • Uppercase color constants
  • Renamed empty() to is_empty() in several classes
  • Manual conversion from StringName to String
  • Renamed pause_mode to process_mode
  • Can't set material_override in GeometryInstance3D, need to use set_surface_override_material() in MeshInstance3D instead
  • Replace ImmediateGeometry node with MeshInstance3D node and ImmediateMesh resource
  • Renamed BUTTON_* to MOUSE_BUTTON_*
  • Renamed scancode to keycode
  • Renamed OS.get_ticks_usec() to Time.get_ticks_usec()
  • Renamed instance() to instantiate()
  • Use DisplayServer.window_get_mode() and DisplayServer.window_set_mode() instead of OS.window_fullscreen
  • Project setting window/stretch/mode: canvas_item instead of 2d
  • Project input mapping has to be set again by hand, all keys are missing
  • Can't make a custom script that extends Slider anymore, need to use HSlider or VSlider
  • TileMap collisions were offseted and cell size was reset

Physics specific changes:

  • RectangleShape2D node: extents renamed to size and values doubled
  • KinematicBody -> CharacterBody for character controllers
  • KinematicBody -> StaticBody with kinematic_motion for moving platforms
  • Renamed physics classes with 2D and 3D suffix in gdscript
  • Renamed GodotPhysics engine string to GodotPhysics2D and GodotPhyics3D
  • Renamed MODE_RIGID to MODE_DYNAMIC in RigidBody
  • Properties instead of arguments in move_and_slide()
  • 3D capsule is up by default
  • One directional collision layers require new setup in some cases
  • Adjustments for RigidBody2D due to increased default gravity
  • RayShape2D/RayShape3D have been removed

Notes:

  • Regression in "Character - TileMap": one-way collision are not working at the moment (PR: Fix one-way collision in Tilemap godot#51259).
    edit: fix is merged
  • Regression in "Character - Pixels": test case "floor detection with motion changes" fails.
    edit: just made a typo when updating a rectangle size, fixed now.
  • Rendering issue in "Character - Pixels": it was previously using a Viewport node with lower resolution. It's all blurry now and I didn't find how to properly set pixelated rendering in 4.0.
    edit: fixed by setting size_2d_override and size_2d_override_stretch in SubViewport

@pouleyKetchoupp pouleyKetchoupp added this to the 4.0 milestone Aug 4, 2021
@pouleyKetchoupp pouleyKetchoupp marked this pull request as draft August 5, 2021 15:43
@pouleyKetchoupp
Copy link
Contributor Author

Switched to draft because I noticed a couple things I can still fix before merging.

@pouleyKetchoupp pouleyKetchoupp force-pushed the physics-tests-4.0-conversion branch from cbc1578 to 67d1682 Compare August 6, 2021 00:20
@pouleyKetchoupp pouleyKetchoupp marked this pull request as ready for review August 6, 2021 00:24
@pouleyKetchoupp pouleyKetchoupp force-pushed the physics-tests-4.0-conversion branch from 67d1682 to d5c8091 Compare August 6, 2021 00:37
@pouleyKetchoupp
Copy link
Contributor Author

Everything should be ready now, I've fixed the last remaining issues.

@pouleyKetchoupp pouleyKetchoupp force-pushed the physics-tests-4.0-conversion branch from d5c8091 to e7e6f97 Compare August 10, 2021 17:36
@pouleyKetchoupp
Copy link
Contributor Author

I've just updated the 2D character tests with needed changes from godotengine/godot#51027 and also replaced references to Kinematic Body to Character Body in the scripts and UI.

@pouleyKetchoupp pouleyKetchoupp force-pushed the physics-tests-4.0-conversion branch from e7e6f97 to 90ae5cc Compare August 11, 2021 16:06
@pouleyKetchoupp
Copy link
Contributor Author

Updated with changes from godotengine/godot#51490: no more ray shapes and added new CharacterBody parameters instead.

@pouleyKetchoupp pouleyKetchoupp force-pushed the physics-tests-4.0-conversion branch from bf045e6 to 52f5b2e Compare December 7, 2021 16:19
@pouleyKetchoupp pouleyKetchoupp merged commit f30f16b into godotengine:4.0-dev Dec 7, 2021
@pouleyKetchoupp pouleyKetchoupp deleted the physics-tests-4.0-conversion branch December 7, 2021 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants