Godot 3.5 to 4 Conversion C#

I've started the process of converting my C# godot 3.5 proj to 4.0 since Godot just hit RC 1 for Godot 4.

I decided it'd be worth it for the efficiency gains but I was also pleased to see the extremely simplified move and slide method as well as the grounded and constant velocity additions to the CharacterBody3D class. I figured given the amount of time it takes to bake a simple lightmap I should probably just upgrade to 4 first.

I ran the auto converter which seems a tad buggy and changes a few things it shouldn't but it seems mostly ok.

Major things to note are:

Luckily I haven't really gotten far in actually making maps so all i have are prototype maps that would've been tossed out anyways. Most of the work has been on the characters, so rebuilding them should get me most of my progress back. I'll probably have to reanimate the particle effects, luckily I didn't have very many. On top of that my old file structure was a mess so this gives me a chance to reorganize anyways.

C# properties are now capitalized properly so they go from lowercase to uppercase now. This includes things like Vector3.x > Vector3.X. GlobalTransform.origin -> GlobalTransform.Origin

In C#, all physicsprocess and process functions are now double instead of float...but Vector3 operators still operate on floats, which is just a bit annoying.

Signals must now all have EventHandler as a suffix.

GPUParticles3D should be GpuParticles3D.

RID is Rid despite docs referring to it as RID, same as the GPUParticles thing.

No bind method for callables yet, apparently it'll be fixed sometime.

IntersectRay went from taking a bunch of parameters to a single query (that uses the same parameters)

File class > FileAccess

JSON is now Json and has to have a Json object created to parse the string.

GetViewport().Size property is gone, now its GetWindow().Size

GetWorld3d().GetNavigationMap does not exist in C# at least, use the NavigationMap property 

This didn't seem to be documented but collision layers and masks start from 1 instead of 0 now. This had me confused on a strange bug for at least a couple of days.

Another weird thing was if your gravity is too high and move on slopes is constant, you cannot move up slanted platforms (depending on how slanted it is). For my game I don't want any slow down or slipping when on a slope. It doesn't matter even if you set the wall angle to very high, it won't move. Weird issue but workable.

I don't know if this class was available in Godot 3, but ShapeCast3D is more suited for immediate interactions and area3D is stated to have a lag of a few frames, so I'm replacing my attack area with it.

I'll keep updating until my project is fully working again. As of March 25th, most things are working, save for minor collision issues and remade particle effects.

Comments

Popular posts from this blog

First Post

March 17 update

July 16 Update