Trying to make an endless game that can load the next randomly selected "section" of the layout with the use of xml or json?
If anyone has done this before or know how to do this I would like to know.
Any help would be breatly appreciated!
Yeah im doing an endless game which was generating levels on-the-fly like you see in a lot of examples. I decided to pre-generate and store level/section data because I wanted seeded level generation so players could all play the exact same level as a 'daily challenge'. Theres also other level generating tasks that having the data stored can benefit from.
Advanced Random is great, but its global and only allows a single stream of numbers. It would be great if the RNG had some kind of tagging system like a lot of other Construct behaviours.
You could just store a bank of numbers that you can reference for generation, but I preferred to make a generator that stores objects to spawn using a queue. Its just a JSON array containing a list of JSON objects in each element. Each array element is read every x pixels and the code goes through the corresponding list and spawns anything it needs to.
It works. I tried other methods like wide layouts and spawning all the objects at the start but it ran into 100's of objects and you get the bloat of checking to see if they are on-screen and other triggering issues.