Porting my 2.1.3 project to 3.0 pre-alpha

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ARJay
:warning: Old Version Published before Godot 3 was released.

I have spent the day porting my project to a recent pre-alpha build of godot 3.0.

Some notes I took along the way, and some questions at the end

General Notes and Observations

  1. Ran the exporter in 2.1.3 project exported besides a gridmap I had export in XML, the log showed errors in handling the xml

  2. Created a new project in godot 3

  3. Copied files generated by the export process into the new project (default_env.tres, project.godot, .import not created by exporter)

  4. Set the main scene and created the autoloader singletons (would be nice if these were translated from engine.cfg to project.godot but no biggie)

  5. Missing engine constants error: TYPE_MATRIX32, TYPE_AABB, TYPE_MATRIX3, TYPE_IMAGE
    New engine constants: TYPE_RECT2, TYPE_TRANSFORM2D, TYPE_RECT3, TYPE_BASIS

  6. Quite a few gdscript strict errors on some dodgy code that was passed by 2.1.3
    eg: variables declared more than once in a method, variables in extended classes that overrode base class properties (using position as a local var name in a control sub class)

  7. Dictionary no longer has a parse_json method replaced with global parse_json method

  8. Tween signal tween_complete renamed to tween_completed

  9. Label anchors were reset to top left

  10. ColorFrame had to be recreated with ColorRect

  11. Animations on visibility/opacity replaced with visibility/modulate

  12. Area set_enable_monitoring method changed to set_monitoring

  13. Area area_enter signal changed to area_entered

  14. All meshes with .msh extension had to be renamed in scene files and on drive to .mesh

  15. Any tweens on object position:
    tween.interpolate_property(object, "transform/translation", current_position, position, time, tween_type, easing_type)
    had to be changed to
    tween.interpolate_property(object, "translation", current_position, position, time, tween_type, easing_type)

  16. Particles - lots of options changed here had to disable my old particles for the time

  17. KinematicBody falling through floor - needed to set the trigger true and then false on the collision shape to get it to work - Posible bug

  18. AnimationPlayer 3D objects have had their properties changed eg a node path in an animation may be something like “Model/Components/torso:transform/translation”
    These need to change to “Model/Components/torso:translation” and likewise rotation from “Model/Components/upper_arm_R:transform/rotation” to “Model/Components/upper_arm_R:rotation_deg”

  19. Movement code based on the 3d kinematic_char demo no longer working due to change in slide method of Vector3 (now requires a normalised input vector) Had to swap the order of the slide and slidee


var n = get_collision_normal()

if (rad2deg(acos(n.dot(Vector3(0, 1, 0)))) < MAX_SLOPE_ANGLE):
		# If angle to the "up" vectors is < angle tolerance,
		# char is on floor
		floor_velocity = get_collider_velocity()
		on_floor = true
	
#motion = n.slide(motion) # 2.1.3 - fails with not normilized error
#vel = n.slide(vel) # 2.1.3 - fails with not normilized error

motion = motion.slide(n)
vel = vel.slide(n)

Questions

SpatialSamplePlayer does not exist, not sure what to replace this with?

Lights set_enabled method has been removed, what to change to - show() and hide()?

As 3.0 is not stable yet, your port might break at every single update.

Omicron | 2017-06-26 07:10

Yep, I’m aware I’m jumping the gun a little bit, but I wanted to see how the API has changed.

ARJay | 2017-06-26 08:11

Thanks for assembling this list. Gives kind of an impression of the amount of work required for porting. Doesn’t seem to be too bad.

Martin Eigel | 2017-06-26 15:26

The exporter used on 2.1.3 is too old, a lot of changes happened since then, I don’t think the one on 2.1.4 will be final either.

eons | 2017-06-26 20:11