Skip to content

Mostly complete conversion to 4.2.1 #188

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

Open
wants to merge 14 commits into
base: godot4-conversion
Choose a base branch
from

Conversation

menaechmi
Copy link

@menaechmi menaechmi commented Mar 13, 2024

The previous PR #182 for this matter was lacking quite a bit of work.

This conversion fixes all of the compile-time errors, and a significant portion of run-time errors. From this, I think you should be able to make a working version of your own card game. It might work on earlier versions, but I'm only using stable for now.

Here's what still needs to be done, broken down into categories:

GUT

  • GUT GUI needs to be updated. GUT now expects you to use the gut tab in the editor, instead of a scene.
  • Many GUT tests fail on the Demo and in general. Without the GUI working, it is hard to tell which ones.
  • yield_for and yield_to are now deprecated and should be changed to wait_for_signal wait_seconds.
  • Maybe GUT should be a submodule?

DEMO / BASE SCENES

  • Main menu title text is wrong size
  • Library card and deck builder don't work as intended. Part of the issue is that PopUpPanels are no longer Controls but Windows.
  • Demo does not show cards. They're properly loaded into cfc.deck but never make it to the Scene Tree. They work properly in GUT tests.

REWRITES

  • Font handling (mostly in cardfront.gd) has changed. Instead of a font file copy for each use (which provides font.size that can be changed) Godot now uses a single FontFile with theme_fonts (and theme_override_font_size). Some if it is started.
  • super._ready() Many issues stemmed from the fact that lifecycle functions no longer call their super version of those functions. The fix for this means that every derived class needs to use super._ready() as the first line in their _ready(), which also means that users will need to do that in their derived classes. Some way to rewrite these classes to prevent that would be nice for the end user.
  • ViewPortCardFocus.gd:155:180 $VBC/Focus is a PopUpPanel node. This node used to be a Control but is now a Window - which means there is no 'modulate' property. If we want to continue the soft fade in/out either a way using Window should be done, or it should be changed to a different node type. It might need a re-write with the change. Also note the effect on test_piles.gd:95
  • Script.get_global_name will be exposed in 4.3 which should allow us to get the class_name of a script object. I think it would be able to simplify logic in a few places.
  • I mostly just wrote the tween logic to replace what already existed, but they could definitely use a re-write all over the place to take advantage of their new lightweight run and forget attitude and being scope-specific.
  • Godot 4 does not allow overriding build-in functions (neither did 3, but 4 is more specific about it). Overridden functions should be re-named and any calls to them also to make it clearer what the call is trying to do. Off the top of my head Pile.gd:add_child() but I know there are more

SPECIFIC

These may or may not address other listed items

  • pile.gd pre_sorted_order is never given a value
  • CardTemplate.gd:359 the logic is not neat (is not and is ! are not allowed in syntax). It can be fixed when 4.3 is released
  • test_facedown.gd:55 _previously_focused_cards does not seem to work in the test only. It works in other places (have not gotten to test demo yet).

OTHER

  • Github actions uses godot 3.4.4, so no builds will be able to pass until that is fixed
  • I'm not sure if breakpoints are carried over - if so, they should be deleted. They're to mark all of the code I touched
  • Lots of unused variables left over and their warnings.
  • Tweens are mostly handled correctly, but there are a few that don't work properly. Some are just added to the scene tree without tweeners (normally @onready var _tween = create_tween() not being in a function)
  • Documentation might need to be updated

There may be more things.

My intention is to keep working on it, but I wanted to share the "working" version for feedback and collaboration.

markp3rry and others added 14 commits February 18, 2024 12:01
Made some edits based on experience of following this tutorial in v3.5.1 of Godot. I was able to complete the tutorial from start to finish, and end up with a working version of the sandbox with a deck containing the two custom cards that I could draw from.
Small change to say updated for 3.5.3 rather than 3.5.1 as originally stated.
not yet 100%. see pull request for details
fix from godot-tester issue 36
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.

3 participants