Endless platform generation with c++

Hello, i am a newbie when it comes to unreal engine, but i have a bit of knowledge when it comes to c++. My question is how would i approach making a script for generating endless platforms for a endless runner type of game?

Hello,

Are you talking conceptually or actual coding? I’m no C++ guru, but I’ve been using UE4 for a while and could probably handle this in Blueprints.However, I do have a few suggestions on how to approach this.

I would approach this by spawning procedural generated platform segments. Create an actor class that has multiple static mesh components. Use some kind of algorithm to make the platforms navigable (turn pieces before the direction changes, only x amount of gap pieces in a row, etc). At the end of the last mesh on each segment I would put a trigger volume that spawns a new platform segment. Alternatively, because it’s a endless runner and you can more or less predict the time the player spends on each segment, you could spawn them after x amount of time.

Store each segment actor in an array so you can destroy the segments that the player has already passed, you’ll also need data from the last segment to determine the transform of the newly spawned segment.

I would created lots of variables to drive the logic behind how the platform segment actor chose meshes, like a percentage chance to spawn more difficult to navigate meshes as the player progresses. You could drive these percentages based on time or run a function that adjusts them every time the player passes through the trigger volume at the end of a platform segment.

Sorry I don’t have more specific, code-oriented answers for you. I hope this answer at least gets the gears spinning.

Good Luck!
-Trevor

It sure clarified some things, i will try and look up some tutorials about the c++ specifics. Thank you