Endless runner spawn mechanics

I’m generating tiles for my 3 Lane endless runner and I was looking for some input/options when it comes to spawn mechanics.

The below code is a snippet of the kind of system I’m implementing but I’m wondering how to implement my spawn logic. For example, my spawnable object prefabs will be various things such as obstacles, enemies, power-ups, currency etc. I wouldn’t want a power-up to appear too often so was thinking maybe have a timer on each object for how often it can spawn. That’s simple enough, and I could do something similar with all my spawnables.

My main worry is creating situations where it is impossible for the user to navigate a path through the obstacles/enemies that are generated and I’m unsure how to manage my logic to avoid this kind of thing. Obstacles can cover single or multiple lanes, and require the user to jump, slide, or strafe left/right to avoid them. Can anyone offer some insight? I haven’t gotten too far ahead with my spawning system so thought it was best to get some advice sooner rather than later.

public class TileObject : ScriptableObject
{
public GameObject prefab;
public int weight;
public List<Spawner> spawners;
public bool spawnersActive;
}

public class TileGenerator : Monobehaviour
{
public List<TileObject> tiles;
}

public class SpawnableObject : ScriptableObject
{
public GameObject prefab;
public int weight;
}

public class Spawner
{
public List<SpawnableObject> spawnables;

public void Spawn()
{
}
}

You could have a scoring system to count to a max criteria score. So that if adding an object would make the difficulty score for a spawning event higher then the max number then you don’t spawn that object.

Thanks for the reply. I already planned to use this kind of thing in my system to spawn enemies of higher difficulty etc.

My main concern really is implementing logic to avoid impossible situations. I thought of maybe adding spawn locations on each of my tile object prefabs, and then I could store these in an array and perform my logic that way. I can just see that kind of things getting complicated very quickly though and wondered how I might better define and separate the spawning logic. For example: if spawn point A contains spawnable object X, spawn point B can’t contain spawnable object y etc. etc.

Could just use a bool array. Let’s say there is three lanes and they default to false and set to true when impassable assigned. When impassable object is trying to be added to one you check the others and if both are true then you don’t do it.