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

Issue67 godot4 upgrade #68

Merged
merged 20 commits into from
Jun 16, 2023

Conversation

RoddieKieley
Copy link
Contributor

As per comments in #67 the code in this PR should be usable at this point, i.e. should represent a working server project that can be utilized in Godot 4.0.1 instead of 3.5.z.

Needs review to see what might have been missed or requires further tweaking. Also will need squash on commit as not done externally.

Copy link
Contributor

@thoraxe thoraxe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the in-line comments about export and spacing.

Server.cs Outdated Show resolved Hide resolved
Server.cs Outdated Show resolved Hide resolved
@RoddieKieley
Copy link
Contributor Author

@thoraxe This should be significantly cleaner with regards to spacing and the [Export] issue has been resolved. I tested here against the current client and that worked well and I saw the new lag reporting log messages. I noted an issue where the starfield ring didn't have the right scale and thus couldn't be seen and fixed that.

This should be good for another check to see if there is anything that can't be resolved post-squash-merge.

@thoraxe
Copy link
Contributor

thoraxe commented May 8, 2023

The Convert statements throw cast errors for me. The following block worked in LoadConfig:

      PlayerDefaultThrust = (float)serverConfig.GetValue("player", "thrust");
      PlayerDefaultMaxSpeed = (float)serverConfig.GetValue("player", "max_speed");
      PlayerDefaultRotationThrust = (float)serverConfig.GetValue("player", "rotation_thrust");
      PlayerDefaultHitPoints = (int)serverConfig.GetValue("player", "hit_points");
      PlayerDefaultMissileSpeed = (int)serverConfig.GetValue("player", "missile_speed");
      PlayerDefaultMissileLife = (float)serverConfig.GetValue("player", "missile_life");
      PlayerDefaultMissileDamage = (int)serverConfig.GetValue("player", "missile_damage");
      PlayerDefaultMissileReloadTime = (int)serverConfig.GetValue("player", "missile_reload");
      DesiredLogLevel = (int)serverConfig.GetValue("game", "log_level");

@thoraxe
Copy link
Contributor

thoraxe commented May 8, 2023

The FocusPlayer buttons don't appear to work. I'm trying to figure out why.

@thoraxe
Copy link
Contributor

thoraxe commented May 8, 2023

ERROR: Node not found: "PlayerShip/Camera2D" (relative to "/root/Server/Players/ShipThings/PlayerShip").
   at: get_node (scene/main/node.cpp:1364)
Exception thrown: 'System.NullReferenceException' in srt-godot-test
ERROR: System.NullReferenceException: Object reference not set to an instance of an object.
   at Server._on_FocusAPlayer_pressed() in /home/thoraxe/Red_Hat/openshift/srt-godot-server/Server.cs:line 921
   at Server.InvokeGodotClassMethod(godot_string_name& method, NativeVariantPtrArgs args, godot_variant& ret) in /home/thoraxe/Red_Hat/openshift/srt-godot-server/Godot.SourceGenerators/Godot.SourceGenerators.ScriptMethodsGenerator/Server_ScriptMethods.generated.cs:line 164
   at Godot.Bridge.CSharpInstanceBridge.Call(IntPtr godotObjectGCHandle, godot_string_name* method, godot_variant** args, Int32 argCount, godot_variant_call_error* refCallError, godot_variant* ret) in /root/godot/modules/mono/glue/GodotSharp/GodotSharp/Core/Bridge/CSharpInstanceBridge.cs:line 24
   at: godotsharp_pusherror (modules/mono/glue/runtime_interop.cpp:1303)

@thoraxe
Copy link
Contributor

thoraxe commented May 8, 2023

Not sure why it changed, but in the _on_FocusAPlayer_Pressed() function, the relative root node is now the PlayerShip:

      Camera2D playerCamera = playerForCamera.GetNode<Camera2D>("Camera2D");

@thoraxe
Copy link
Contributor

thoraxe commented May 8, 2023

    // connect the ship thing input signal so that we can catch when a ship was clicked in the debug UI
    newPlayer.Connect("input_event", new Callable(this, "_on_ShipThings_input_event"), 0);

This connection no longer appears to work. Clicking on the ship in the debug UI doesn't do anything. It's not clear if this is related to #68 (comment) or something else. But it's definitely broken and requires investigation.

thoraxe and others added 5 commits May 9, 2023 17:22
* cast issues
* change signal connection syntax
* restore old playerShipThing behavior
The clickbox was not being kept "centered" on the sprite
@thoraxe thoraxe merged commit 8b0c514 into redhat-gamedev:main Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants