Procedural Generation: Build Infinite Game Levels using Godot?

I there there’s a Unity Procedural Generation: Build Infinite Game Levels course, I wonder how can I do the same in Godot?
if not, how can I use Unity and Godot simultaneously? as in using Unity to build infinite game levels, and then run it using Godot engine.

I’m going to assume you’re thinking of GDScript and not C#. I’m actually doing this as a side project, largely out of curiosity to see what I can translate from the course, and what I have to rebuild from the ground up due to engine/language differences.

Following a course in a different engine and language is difficult, but not impossible. The general approach you need to take is to abstract the methodologies that are taught to you and reapply them to your target engine. Sometimes you can just translate the syntax, and sometimes you have to design [your own implementations of those methodologies] from scratch where capability does not exist in your target engine, or is simply different. For example, there is no concept of private or protected variables in GDScript; everything is public, and therefore the way getters are implemented in the course needs to be accounted for. No static classes either - if you’ve looked into the course a little already, I implemented the HallwayDirection enum as a direct member of the Hallway class (and I might refactor this again later, since the most direct translation would be to make an Autoload out of it). Treat it like a game jam: expect to have to do a fair bit of research on your own to work out the stuff you don’t already know how to do, and with enough perseverance, you’ll get there most of the time!

I think I see where you’re going with that: use Unity to produce and save the generated levels as assets, which you then load into a Godot project and run as if you made them in Blender or something. This could certainly work if you saved the assets in a concrete way (because the alternative is to have Godot regenerate the assets from a saved seed, in which case you don’t need Unity in the first place). A quick search does suggest that Unity can save dynamically-generated meshes as .fbx files, which you probably know Godot can import now. Even if it needs a little massaging on the Godot side of things (material assignment, etc.), it looks like that’s an option =)

hey, sorry for the late reply. I didn’t receive any notifications that someone replied, so I didn’t check it until now.
what I was think was actually much simpler. so there’s a course “Unity Procedural Generation: Build Infinite Game Levels”, which I haven’t done yet, but I assume its a course that unity as an engine to procedural generation infinite game levels, just as the name of the course suggested.

so what I was think / wanting to achieve was, if I follow that course and made a procedural generated platformer game, its there a easy or straightforward way to port that part to Godot, and then I add other components and/or further develop the game in Godot, using GDscript.

what I’m actually thinking when I made this post was, currently Generative AI and LLM are very popular, and it sounds like its highly correlated with procedural generated games / assets. So I’m thinking if I could work something out to bridge generative AI and LLM into game dev.

by the way, you mentioned in C#?? can I build a game in Godot using C#?

Yup, that’s the course I’m referring to.

If you can use Unity to export something as an .fbx, Godot can import that. I don’t know enough about Unity to tell you if bits and pieces will get lost in translation, such as material assignments, but it’s nothing you can’t fix in Godot itself. You could also clean it up in Blender first (recommended), which then gives you the option to import to Godot using .gltf, or even .blend, both of which are preferred over .fbx. Then it just becomes an engine-independent game asset like any other, and all the code that works around it would be written with Godot.

What I was getting at before was, it wouldn’t make sense to save the assets such that they would need to be procedurally regenerated (which is how the course shows saving ProcGen assets you make), since you would then need code to do that in Godot. You can create that code, but then you don’t need Unity in the picture at all anymore, hence why you would export the Unity-created result to an .fbx instead and process it that way.

Yes, Godot supports both, but it’s worth pointing out that there are still a lot of engine-specific differences between Unity C# and Godot C#. You can’t just dump Unity scripts into a Godot project without significant refactoring and fixing 2000 errors, but once you’re familiar enough with C# in Godot, it would definitely be less of a translation effort than converting Unity C# to GDScript.

GameDev.tv does have one Godot course in C#:
Godot 4 C# Action Adventure: Build your own 2.5D RPG | GameDev.tv

There are certainly similarities, and GenAI would definitely fall under the broad umbrella of ProcGen content, but the first thing you’ll see in the Unity course is that the scope of the definition of ProcGen is absolutely nebulous, plus it’s existed in one form or another for decades already and has been in wide use since then. I don’t think the course even mentions AI at all in fact. It’s not a bad plan, I just don’t want to give you false expectations about what you’ll find in there =)

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.