UID for C# is terrible. Just use the built-in features

Godot Version

4.4.1 Mono
^^ This is a misnomer because it doesn’t use Mono anymore. Mono should be taken out of the name.

I thought I would post this here before opening a more formal issue on GitHub.

Tutorial

The way UID is currently implemented is terrible. The dotnet compiler already crawls your file system and has a unique name for every type.

namespace Garden;

public partial class Main : Control
{
    public override void _Ready()
    {
        GD.Print(typeof(Main).FullName);

        // use the built-in hash algorithm, or Godot's for consistency
        GD.Print(typeof(Main).GetHashCode().ToString("X"));
        GD.Print(typeof(Main).FullName.GetHashCode().ToString("X"));
    }
}

result:

Garden.Main
1F550A4
9E148E97

The engine already uses reflection to populate the inspector with [Export] properties while you’re editing a scene. Just make it hash your scripts into a table when it builds. Replace all the extra files with 1, or get rid of them altogether.

The Godot team is wasting donation money on bad homebrew instead of using the features that are already there. There are multiple problems with the C# integration.

You might be interested to read what they say about C# in the latest release news.

This is quite the comment about an open source project where most of the people contributing are volunteers. It sounds like you’re very knowledgeable about C#. It seems likely they could benefit from that knowledge in addressing these things.

7 Likes

Don’t use the contributors to deflect responsibility. That’s analogous to a terrorist group using human shields.

The paid team are the ones who decide on the direction of the project, and who’s hard work to reject. If something goes wrong, it’s the paid team’s fault. If a volunteer has their time wasted, it’s the paid team’s fault.

It’s like how Tom Sawyer tricked all these lads into giving him donations. He mismanaged the time and money because the thought it was “free” instead of valuable. The fence fell down because he didn’t respect the people who cared so much about the project.