godot-demo-projects icon indicating copy to clipboard operation
godot-demo-projects copied to clipboard

[TRACKER] Porting the demos to Godot 4

Open aaronfranke opened this issue 2 years ago • 76 comments

This issue tracks the progress of porting the Godot demo projects to Godot 4.0. This list is in alphabetical order by folder path.

  • ✅ and a checked box means that the demo is fully ported and working.
  • 🚧 means that the demo still needs to be ported manually.
  • 🐛 means that there are engine (not project) bugs that show up in this project. Projects that have bugs but the cause is unknown don't get 🐛.
  • 🐞 means that there are minor bugs such as errors printing in the console.
  • 🌋 means that there is a bug with rendering (possibly a problem with the project).
  • 📜 means that there is a bug with scripting (can be GDScript/C#/VisualScript).
  • 🖽 means that this project uses TileMap. 3.x tile data doesn't work in master.
  • 💥 means that opening the editor with this project causes the engine to crash.
  • [x] ✅ Bullet Shower
  • [x] ✅ Dodge the Creeps
  • [x] ✅ Hierarchical Finite State Machine
  • [x] ✅ GD Paint
  • [x] ✅ HDR for 2D (renamed to Glow in 2D due to https://github.com/godotengine/godot/issues/54122)
  • [x] ✅ Hexagonal Game
  • [x] ✅ Scene Instancing Demo
  • [x] ✅ Isometric Game
  • [x] ✅ Kinematic Character 2D
  • [x] ✅ 2D Lights as Mask
  • [x] ✅ 2D Lights and Shadows
  • [x] ✅ Navigation Polygon 2D https://github.com/godotengine/godot-demo-projects/pull/955
  • [x] ✅ Grid-based Pathfinding with Astar
  • [x] ✅ 2D Particles
  • [x] ✅ Physics-Based Platformer 2D
  • [x] ✅ 2D Physics Tests https://github.com/godotengine/godot-demo-projects/pull/962
  • [x] ✅ Platformer 2D
  • [x] ✅ Pong with GDScript
  • [x] ✅ JRPG Demo https://github.com/godotengine/godot-demo-projects/pull/922
  • [x] ✅ Screen Space Shaders
  • [x] ✅ Skeleton2D Demo
  • [x] ✅ 2D Shaders for Sprites
  • [x] ✅ Tween Demo
  • [x] ✅ 3D Global Illumination
  • [ ] 📜 3D Inverse Kinematics
  • [x] ✅ Kinematic Character 3D
  • [x] ✅ Material Testers
  • [x] ✅ 3D Navigation Mesh
  • [x] ✅ 3D Physics Tests
  • [x] ✅ Platformer 3D
  • [x] ✅ RigidBody Character 3D
  • [x] ✅ Truck Town
  • [x] ✅ Volumetric Fog
  • [x] ✅ Voxel Game https://github.com/godotengine/godot-demo-projects/pull/965
  • [x] ✅ 3D Waypoints
  • [x] ✅ BPM Sync Demo
  • [x] ✅ Audio Device Changer Demo
  • [x] ✅ Audio Generator Demo
  • [x] ✅ Audio Mic Record Demo
  • [x] ✅ Audio MIDI Piano Demo
  • [x] ✅ Audio Spectrum Demo
  • [x] ✅ BIDI and Font Features
  • [x] ✅ Control Gallery
  • [x] ✅ Drag and Drop (GUI)
  • [x] ✅ Input Mapping GUI https://github.com/godotengine/godot-demo-projects/pull/1024
  • [x] ✅ Multiple Resolutions
  • [x] ✅ Pseudolocalization Demo (should use canvas_items stretch mode)
  • [x] ✅ RegEx (Regular Expressions)
  • [x] ✅ Rich Text Label with BBCode
  • [x] ✅ Signed Distance Field Font (renamed to Multi-channel Signed Distance Field font) https://github.com/godotengine/godot-demo-projects/pull/1024
  • [x] ✅ GUI Theming Override Demo
  • [x] ✅ Translation Demo ~~https://github.com/godotengine/godot-demo-projects/pull/930~~ https://github.com/godotengine/godot-demo-projects/pull/1024
  • [ ] 🚧 UI Mirroring Demo https://github.com/godotengine/godot-demo-projects/pull/974
  • [x] ✅ Autoload (Singletons)
  • [x] ✅ Background Thread Loading Demo
  • [x] ✅ Multiple threads loading
  • [x] ✅ Scene Changer
  • [x] ✅ Saving and Loading (Serialization)
  • [x] ✅ Loading in a Thread
  • [x] ✅ 2.5D Demo with GDScript
  • [x] ✅ Joypads Demo
  • [x] ✅ Matrix Transform https://github.com/godotengine/godot-demo-projects/pull/978
  • [x] ✅ OpenSimplexNoise Viewer (renamed to Noise Viewer as 4.0 uses FastNoiseLite)
  • [x] ✅ Operating System Testing
  • [x] ✅ Pause Demo https://github.com/godotengine/godot-demo-projects/pull/1024
  • [x] ✅ Window Management
  • [x] ✅ Android In-App Purchases https://github.com/godotengine/godot-demo-projects/pull/1024
  • [x] ✅ Interactive Cubes
  • [x] ✅ Multitouch View
  • [x] ✅ Accelerometer, Magnetometer and Gyro Demo
  • [ ] 🚧 2.5D Demo with C#
  • [x] ✅ Android in-app purchases with C# https://github.com/godotengine/godot-demo-projects/pull/1104
  • [ ] 🚧 Dodge the Creeps with C# https://github.com/godotengine/godot-demo-projects/pull/1000
  • [ ] 🚧 Pong Multiplayer with C#
  • [x] ✅ Pong with C# https://github.com/godotengine/godot-demo-projects/pull/966
  • [x] ✅ Multiplayer Bomber https://github.com/godotengine/godot-demo-projects/pull/987
  • [x] ✅ Pong Multiplayer
  • [ ] 🚧 WebRTC Minimal Connection
  • [ ] 🚧 WebRTC Signaling Example
  • [x] ✅ WebSocket Chat Demo
  • [x] ✅ WebSocket Minimal Demo
  • [x] ✅ WebSocket Multiplayer Demo
  • [x] ✅ Plugin Demos https://github.com/godotengine/godot-demo-projects/pull/1024
  • [x] ✅ 2D in 3D Demo
  • [x] ✅ 3D in 2D Demo
  • [x] ✅ 3D Viewport Scaling https://github.com/godotengine/godot-demo-projects/pull/891
  • [x] ✅ Dynamic Split Screen
  • [x] ✅ GUI in 3D Demo
  • [x] ✅ Screen Capture

aaronfranke avatar Mar 28 '22 06:03 aaronfranke

I have an ongoing 4.0 port of the 3D Global Illumination demo: https://github.com/Calinou/godot-demo-projects/tree/add-global-illumination-demo-2-4.0

Edit: Pull request opened: https://github.com/godotengine/godot-demo-projects/pull/718

Calinou avatar Mar 28 '22 13:03 Calinou

I have fixed the Pause demo with pull request #701 And I checked the Autoload(Singletons) demo in pull request #702 I hope I'm helping in finishing off all these tasks. I'm pretty now to contributing so please tell me when I'm doing things wrong!

Edit: Had some more time so decided to fix the Translation demo as well with pull request #704 The Control Gallery Demo also got fixed/adjusted so the layout is correct again with previous version. This is done in pull request #705

voylin avatar Mar 31 '22 00:03 voylin

@Calinou I wonder if it makes sense to discuss here what to do with the Godot4 c# demo examples. Should there be discussions among Godot4 mono users or we wait until Godot4 dotnet6 is merged into the master?

@voylin Do you do Godot4 c#? Thank you for volunteering.

GeorgeS2019 avatar May 02 '22 14:05 GeorgeS2019

@GeorgeS2019 Porting C# demos will have to wait until the .NET 6 work is merged in master. Until this happens, the API is too unstable for porting to be worth it.

Calinou avatar May 02 '22 14:05 Calinou

@GeorgeS2019 That's a good point, I added a new emoji to this tracker to reflect this status ❌.

aaronfranke avatar May 02 '22 16:05 aaronfranke

I've been trying to get some of the demo's fixed but 2D Lights as Mask and 2D Lights and Shadows are not possible yet. There are some rendering issues with light2D which make the demo's not work.

voylin avatar May 03 '22 02:05 voylin

I've been trying to get some of the demo's fixed but 2D Lights as Mask and 2D Lights and Shadows are not possible yet. There are some rendering issues with light2D which make the demo's not work.

Indeed, see https://github.com/godotengine/godot/issues/55806.

Calinou avatar May 03 '22 16:05 Calinou

I just tested the voxel game and it seems to work without problems (no debugger errors nor anything seemingly wrong rendering wise) on alpha 7

alex9099 avatar May 03 '22 19:05 alex9099

@voylin Do you do Godot4 c#? Thank you for volunteering.

@GeorgeS2019 Sorry for the late reply, hadn't seen the message. I am willing to test the c# stuff as well, but we will have to wait until the beta I guess. Like Calinou said, .NET 6 stuff should first be merged.

voylin avatar May 04 '22 05:05 voylin

2D Physics Test demo is having a bug which is occurring because of find_children. Issue godotengine/godot#54939 has to be solved first. That demo should also have the tilemap icon as one of the tests uses the Tilemap.

voylin avatar May 04 '22 09:05 voylin

I just tested the voxel game and it seems to work without problems (no debugger errors nor anything seemingly wrong rendering wise) on alpha 7

@alex9099 The voxel demo still has some rendering bugs. @aaronfranke worked on this demo in #694 But when testing it I found rendering issues especially when breaking blocks in the flat space, not all the faces on the sides don't get updated. This demo will probably need to wait until the beta releases before it can be checked of the list.

voylin avatar May 04 '22 10:05 voylin

All these need to be rechecked with Godot 4 beta or newer. Probably most of them are broken again now.

Tried Bullet Shower(tagged ✅) on master build and got: Line 59:Function "update()" not found in base self. Built-in 3to4 Converter didn't help either.

Anutrix avatar Oct 06 '22 20:10 Anutrix

I'm going through the 4.0-dev demos to update them as we speak.

This one-liner (run in the repository root) makes it easy to go through all demos in the editor one-by-one:

for demo in **/*.godot; do godot $demo; done

Calinou avatar Oct 06 '22 21:10 Calinou

Multiplayer Pong: Ported to godot 4 beta 5 -> https://github.com/godotengine/godot-demo-projects/pull/792

scriptsengineer avatar Nov 22 '22 18:11 scriptsengineer

I have noticed that simply opening and running the demo projects on Godot 4.0b10 causes diffs in some scenes. It can be simple stuff like certain attributes have changed place or bigger stuff like removed attributes. Should these changes be committed as we find them or is there a plan to go through and commit all these scene-diffs caused by Godot 4.0 at one time later on?

zoeesilcock avatar Jan 08 '23 13:01 zoeesilcock

I have noticed that simply opening and running the demo projects on Godot 4.0b10 causes diffs in some scenes. It can be simple stuff like certain attributes have changed place or bigger stuff like removed attributes. Should these changes be committed as we find them or is there a plan to go through and commit all these scene-diffs caused by Godot 4.0 at one time later on?

I think we can do this once 4.0 gets closer to release, as some bug fixes may still cause changes to occur in scene files.

Calinou avatar Jan 08 '23 17:01 Calinou

I tried to run Platformer 2D and it failed immediately due to API change in Game.gd. I could fix the pure script errors but the project is buggy after that (incorrect behavior). I suppose it's worth doing a first PR just for the scripting error fixing, but since I haven't forked the repo yet I'll just drop my notes here for now:

OS.window_fullscreen = not OS.window_fullscreen becomes toggle_fullscreen() where the function is defined as:

func toggle_fullscreen():
	if DisplayServer.window_get_mode() not in \
			[DisplayServer.WINDOW_MODE_FULLSCREEN, DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN]:
		DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN)
	else:
		DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_WINDOWED)

get_tree().set_input_as_handled() becomes get_viewport().set_input_as_handled()

However, I noticed that both are mentioned in https://github.com/godotengine/godot/blob/master/editor/project_converter_3_to_4.cpp (with the subtlety that fullscreen has two variants and the converter only cares about exclusive fullscreen, so user would need a bit of manual work after the auto-conversion to get the exact behavior they want), which is itself used by command godot4 --convert-3to4.

I suspect that because only the gist converted script https://gist.github.com/aaronfranke/79b424226475d277d0035b7835b09c5f was run, the newest changes in project_converter_3_to_4.cpp have not been taken into account. So before I start forking the project and converting things manually, maybe we should try to run the latest --convert-3to4 on the projects that still need it to see how far we can automatically update things?

I think this is also a good idea to spot what --convert-3to4 can do and what it can't, and for anything that it didn't convert, we should decide if: a. the missed conversion is simple enough to be integrated into project_converter_3_to_4.cpp b. the missed conversion requires human interaction to decide subtle edge case and wanted behavior, in which case it should be added to some migration guide (like https://gist.github.com/WolfgangSenff/168cb0cbd486c8c9cd507f232165b976 but I think this one is unofficial, so we could do the same with an official one; on a personal note, this gist receives a lot of comments and seems to be a good basis to work from)

At the end, we would have a compilation of all the manual things we did to upgrade the demo projects that would contribute to this migration guide.

hsandt avatar Jan 24 '23 14:01 hsandt

@hsandt You are welcome to convert with any of these means, and submit any improvements you'd like to the converter. Just make sure that the final PR you submit has been hand-checked to have only good changes.

aaronfranke avatar Jan 24 '23 21:01 aaronfranke

For 2D demos using the tilemap:

In Platformer 2D, I noticed this tilemap break:

image

due to Rendering Texture Origin being by default (0, 0) which means centered, causing tiles with Texture Region Size not matching TileSet Tile Size to have a representative area (with orange borders inside the green rectangle) to be misaligned.

I'm gonna fix the Texture Origin to some value so that the orange box matches the top of the tile, but it would be easier with some Texture Origin anchor direction I think (an enum with values: Center (current), Top-left, Top-middle, Top-right, Middle-left, Middle-right, Bottom-left, Bottom-middle, Bottom-right).

Or maybe the better way of doing this is to just split the big 32x64 tile into two parts of 32x32? I'm doing this in this in my own project (and also using auto-tile even with slopes, see https://github.com/godotengine/godot-proposals/discussions/6157).

For now I'll just fix the offset for minimal change, but I'd like to know the purpose of the demo to know better how I should use Godot 4's new features. Basically, are we demonstrating the tilemap too and trying to do things nicely in this demo, or are we just demonstrationg platforming, leaving TileSet demonstration to some other future TileMap demo?

hsandt avatar Feb 17 '23 17:02 hsandt

I opened a new branch for Demo Platformer 2D porting: https://github.com/hsandt/godot-demo-projects/tree/4.0-dev-platformer

I will send a PR when I get something decent to play. Unless you prefer that I regularly send small PR as long as there is some visible improvement?

hsandt avatar Feb 17 '23 20:02 hsandt

For now I'll just fix the offset for minimal change, but I'd like to know the purpose of the demo to know better how I should use Godot 4's new features. Basically, are we demonstrating the tilemap too and trying to do things nicely in this demo, or are we just demonstrationg platforming, leaving TileSet demonstration to some other future TileMap demo?

I'd say the demo should mostly be about platforming. Correct TileSet configuration is nice, but not essential for this kind of demo. Eventually, we should have a separate demo showcasing procedural 2D level generation with TileSets + TileMaps (most likely with a top-down/three-quarter view).

I opened a new branch for Demo Platformer 2D porting: hsandt/godot-demo-projects@4.0-dev-platformer

I will send a PR when I get something decent to play. Unless you prefer that I regularly send small PR as long as there is some visible improvement?

You could open a draft PR now, or wait later and open a full PR directly. I personally prefer opening a draft PR as soon as I have something workable, so someone else can continue the work in case I no longer have time to complete it.

Calinou avatar Feb 17 '23 21:02 Calinou

Maybe a good idea to remove the visual scripting ones as the folder has already been deleted from the branch and the visual scripting has been removed from the engine in 4.0

  • Multitouch View with VisualScript
  • Pong with VisualScript

Will this script be updated again once 4.0 is released? I will have some spare time at the end of this month and would be able to go over some of these projects to see if I can check/fix the demo projects for 4.0, would be helpful to see here which ones aren't finished yet.(probably quite some work to keep this list up to date but just asking to check)

voylin avatar Feb 19 '23 05:02 voylin

You could open a draft PR now, or wait later and open a full PR directly. I personally prefer opening a draft PR as soon as I have something workable, so someone else can continue the work in case I no longer have time to complete it.

Here you go. BTW should I prefix all my commits with [4.0] instead of [3to4] ? I changed convention between my commits and my PR title (maybe it doesn't matter if you squash the whole thing, but it will if you preserve the full commit history).

hsandt avatar Feb 24 '23 18:02 hsandt

If you have trouble with the camera being too zoomed out in your demo, mind that the Zoom factor convention has been reversed: it now zooms in when the value increases, zooms out when the value decreases. So you have to reverse the value: in the case of 2D platformer, I changed (0.5, 0.5) -> (2.0, 2.0).

Godot 3 demo

image

Godot 4 demo before change

image

Godot 4 demo after change

Still wrong offset, but proper zoom

EDIT: offset is now fixed, it was a bad local change to position that kept restoring even after git revert + Reload scene in Godot. I should probably report this as an editor bug, in fact.

image


EDIT: OK, I just found out it was in the offical guide: https://docs.godotengine.org/en/latest/tutorials/migrating/upgrading_to_godot_4.html

I'll make sure to read the rest, it could help me a lot on other features to upgrade.


OLD remark below:

I suppose it could be added to --convert-3to4, but since the property name is not changing, it is particularly difficult to decide what to do, unless you are certain that you are actually converting a Godot 3 project. Basically, since the change is about reversing values, it is not idempotent, so you cannot use --convert-3to4 multiple times, guaranteeing no further changes.

I suppose we could add an option --force-convert-3to4 or something that will convert values this way (maybe only if project is actually using Godot 3; this won't work for people who started converting their project with an older version of the converter, unfortunately).

Or we could just show a warning when Camera zoom values != (1, 1) are detected (in scene or in script; in script, we could even add a comment above).

But if it's too complicated, we could add this to some upgrading guides so developer can just do it manually. For now I'll just comment on the two unofficial guides I know (https://gist.github.com/WolfgangSenff/168cb0cbd486c8c9cd507f232165b976 and https://www.reddit.com/r/godot/comments/tsxgnj/migrating_from_3x_to_40/).

hsandt avatar Feb 24 '23 20:02 hsandt

3D/MaterialTesters with 4.0 RC6 on my computer give me this:

godot-4rc6-3D-mattesters-issue

importing assets (sand_rough.jpg) stuck à 94%, CPU is 100% use (the decrease in CPU graph comes from a change of affinity from all to only 2/8 cores), then I decide to kill Godot.

Trying to reimport it directly from project list makes Godot stuck at "park.hdr" 0%, still 100% CPU usage, then finally project is loaded after several minutes: godot-4rc6-3D-mattesters-issue2

I don't call this working actually.

For the record, it's on an Asus G750 JH with a core i7 and a GeForce GTX 780M, I know it's far from being the best available these day, still it's not yet a low-end computer. (tool used is System Informer)

InfiniteProductions avatar Feb 27 '23 21:02 InfiniteProductions

Trying to reimport it directly from project list makes Godot stuck at "park.hdr" 0%, still 100% CPU usage, then finally project is loaded after several minutes:

This could be due to https://github.com/godotengine/godot/issues/61948. That said, all *.hdr.import files in the demo already have compress/mode=0, which indicates they're using lossless compression and not VRAM compression. This can be seen in the Import dock:

image

I've tried removing the .godot/ folder then reimporting the demo locally, it successfully imports in less than 10 seconds with 4.0.rc 8208060c2. Are you using a self-compiled editor build? If so, make sure it was built with optimizations.

I don't call this working actually.

I have to remind you that we have a Code of Conduct. Please stay constructive.

Calinou avatar Feb 28 '23 00:02 Calinou

I've checked all the import settings after the project is reopened in the editor, all are using VRAM compression, including HDR backgrounds, except one.

Only sand_shine.jpg texture use lossless mode, it's 1024x1024 RGB8 texture, no mipmap using ~3MB memory, I don't believe it could be responsible for the import delay alone. And I don't know also if settings has been somehow modified automatically by the editor as I did not change anything not delete the .godot folder inside the project.

By the way, opening the project again is as quick as it is expected. And to answer your question, no, I'm using official 64bits build (v4.0.rc6.official [0cd148313]).

InfiniteProductions avatar Feb 28 '23 13:02 InfiniteProductions

I've done more testing on RC6 build:

platformer 3D failed (it looks like there is a regression), I just run the project, then I get this error right away, with a sounds looping while the debugger is running: godot-4rc6-3D-platformer-issue

physicsTest (3D) also have at least one case of failure:

with tests/functional tests/collision pairs using collider type "capsule" and shape type "capsule": godot-4rc+-physicsTest-issue

godot-4rc+-physicsTest-issue2

To reproduce the error, run the project, select the test "functional tests/collision pairs", select "test options" menu, click on "collider type" "capsule (3)" then "shape type" capsule checkbox => error occurred. (it's happened for pretty much every choices, I use box, sphere, convex/concave polygon) In fact, selecting the second option trigger the issue.

and there are a lot's of errors: godot-4rc+-physicsTest-errors-output

InfiniteProductions avatar Mar 01 '23 10:03 InfiniteProductions

So, how do we publish the demos already ported to Godot 4.0, now that it's out? I'm thinking in particular about 2D platformer which recently reached a decent state thanks to https://github.com/godotengine/godot-demo-projects/pull/851

hsandt avatar Mar 01 '23 18:03 hsandt

Only sand_shine.jpg texture use lossless mode, it's 1024x1024 RGB8 texture, no mipmap using ~3MB memory, I don't believe it could be responsible for the import delay alone. And I don't know also if settings has been somehow modified automatically by the editor as I did not change anything not delete the .godot folder inside the project.

That texture isn't used anywhere in the project. It could be removed at this point: https://github.com/godotengine/godot-demo-projects/pull/869

Calinou avatar Mar 01 '23 19:03 Calinou