Hey folks, currently I'm trying to code a random tree generator like this: Each node represents a different occurrence like a fight, checkpoint or tressurechest The nodes are connected as shown, that's the path where the player can travel The dashed contections are shortcuts Edit: What I'm having trouble with, is the generation of the branchs. Like what are some possible rules how the branch could... split end create a shortcut to another branch And I think I need some comprehensive rules for the whole tree. So each random tree is a bit different in his structur but has around the same amount of nodes, splits, shortcuts etc. I rack my brain trying to get solution for this, but I can't get to a good result. So a bit of pseudo code would really help me out Thank you very much
It's basically just a linked list.. with "optimizations" Each node holds a reference to where he can lead. Code (CSharp): public class Node { List<Node> pathTo; } is the basic idea, or is that not what you're having a problem with?
Hey SparrowsNest thanks for the answer! Oh sorry I think I didn't descripted it clear enough^^ What I'm having trouble with, is the generation of the branchs. Like what are some possible rules how the branch could... split end create a shortcut to another branch And I think I need some comprehensive rules for the whole tree. So each random tree is a bit different in his structur but has around the same amount of nodes, splits, shortcuts etc.