godot-demo-projects
godot-demo-projects copied to clipboard
Update 3D Platformer for 4.0
I've ported the 3D Platformer demo to 4.0.
I brought the player, enemy, and tiles into Blender for a cleanup. All of the binary data has been extracted out of the .tres and .tscn files.
Cleaning up the MeshLibrary for the GridMap was a nightmare. I needed it saved as text so I could change the order of the tiles to what they were before, otherwise they were scrambled. So I had to extract out the screenshots and set up the meshes and collision shapes manually, then edit the .tres file by hand to put them back in the right order. I ended up using an import script on the tiles to save the collision shapes generated during import, and used those. I also ran into an issue where the save_to_file importer option stopped working, so I saved the meshes using the import script too. I'll look into that further and open an issue later. I'm also going to write up a proposal for improving the GridMap workflow because that shouldn't have been so difficult. I don't like that I had to use an import script, especially for a demo.
I cleaned up the code a bit while updating it. It could still use more but it's better.
Finally I did some aesthetic changes to make it look nicer, like adjusting the sun direction, environment settings, and materials. I also removed the reverb effects since they weren't working and IMO they didn't really add anything when they were working.
Finally got around to opening the issues I mentioned. There's the proposal linked above, also godotengine/godot#65552 and godotengine/godot#65553. Also, when I originally created the MeshLibrary, it didn't include the collision shapes. I thought that just wasn't a feature of the MeshLibrary export, but later I exported again and it did include them. I think that was another bug, but I haven't been able to replicate it again since.
Since it seems those issues might not get addressed in time for the 4.0 release, I've removed the tile import script and un-gitignored the meshes and collision shapes for now. We can change it with another PR later.
I also extracted the GridMap from the stage into its own binary .scn file since the tile data isn't really in a readable format.
Can you add screenshots? Or a video demo?
Yeah, this PR updates the screenshots included with the project. They were taken before I made some adjustments to the lighting and they looked grainy, so I've just retaken them. Screenshot 1 Screenshot 2
Note that https://github.com/godotengine/godot-demo-projects/pull/782 also updates this demo, with a different visual rework (closer to how it looked in 3.x, but still better-looking than previously). I didn't need to change anything to the import structure either.
However, I haven't updated the demo's scripts yet, so the demo doesn't run. If you don't mind, I can borrow the code changes to this PR while crediting you as a co-author :slightly_smiling_face:
As I mentioned, I went back and removed the import script. The only models still being imported are two .glbs, one for the player and one for the enemy. They contain working animations. The tiles are in .res files, and the coin and bullet are now primitives. The reason I made these changes is so that there's no mesh data stored in text format, and it also fixed the octahedral mesh compression and rotation tracks.
I believe I already gave up ownership of this by opening a PR and that you don't need my permission to take from it, but I don't really see why you'd want to just take the scripts. I'm not even 100% sure the enemy script was updated correctly, they walk off ledges occasionally.
What's the reason you want to? If there's something you dislike here I can make changes.
Thanks!