What I saw when looking into infinite scroller was that you could instead of spawning objeects design specific regions to come next. You could hardcode these regions and implement their path without having a dynamic or self aware calc. For a selfaware calculation you could use rays and detect wether something is "in front" and thereafter turn.
Viewing post in Trust Fall Summit jam comments
Yeah, this is actually really interesting. I tried using an array for the spawn regions, but when I was testing it I wasn’t really getting good results, so I ended up going with the dynamic spawning approach.
I’m curious about how you would structure the region/path system though. Would each region basically have a set of predetermined obstacles/enemies and their paths, then the game just moves through those regions as the player progresses? I’d definitely be interested in picking your brain on it!
Yeah that's what the tutorial said, but one should always go from there. When scaling I'd differentiate between moveable and non moveable objects and in which layer they would be (e.g. skier ->moveable + collision with other objects ->calculation necessary, tree -> static + collision)
You could also build the it semi static into individual regions and put them together like tetris blocks when generating the next spawn. You would have a set variety, but through variation and orientation changes you could do this well (needs playtesting).
If going full dynamic you would need to either track and recalc the routes, or set a ray of length [e.g. 1m]. You could also evaluate each collision and on collision turn the skier around. You would need to differentiate the individual collisions and maybe work with different collision layers.
At least that's my non-professional-developer view. It also depends on how your game is currently implemented. Godot also has Path-Nodes, but I haven't used them yet.