Is there a way to procedurally generate with entry and exit points?

Godot Version

4.2.2

Question

Consider an endless runner game, but the procedural generation has rules, such that if the exit point of a modular level is at the left side, one of any modular level which has a entry point on the left side is considered for genneration. This goes on endlessly, till player. Is there a way to do this? I am new to godot and don’t know what kind of nodes to use in this scenario.( I dont need collisions for the endless generation)

Yeah, of course this can be done. Dunno that you need any specific nodes, it’s more a coding question.

What I would do is create a custom resource type for the modules, which would store a PackedScene (the actual module that should be instantiated) and a boolean for each entry and exit point.

Then, whenever you wanna generate a new module, you take your list of module resources and filter out any that don’t have the correct entry points (see the filter method of the Array class).

1 Like

Thank you, I will look into that.

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