Is it possible to save and load layout designs from xml or json?

  • 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!

    Thanks!

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • construct.net/en/tutorials/how-to-make-savegames-313

    In particular look at the system Save, Load, and Load from Json.

    It basically loads from the state of game at that point in time, which is sort of what you are asking for.

  • 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!

    Thanks!

    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.

  • Excellent thread..!!!

  • Ok guys, thanks for answering! :)

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)