Regenerating backdrops after loading frame state

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • **BIG EDIT**

    So I noticed, that ALL of my scoping methods work when setting values to the objects, but not when printing a backdrop (it also works on initial generation, just not on load), go figure. I will probably at some point use this to make something that works, but for now I'm going to go sulk in the "I can not believe that I again came up with 8 different ways of scoping my logic, all which seemed correct but of course were not AGAIN, as it tends to go"-corner. And before you ask, yes I did meticulously go through the "Delete all", and "Delete created" in find all, several times. I am not deleting the backdrops.

    **BIG EDIT**

    Hello!

    Do you know how to best regenerate the backdrops lost when saving frame state?
    Here's my problem; I generate random levels, and they are so large that I can not use objects, but I print several layers of backgrounds on top of each other during level generation. When I use save frame state (which I have to do, due to the nature of the game, arrays are not an option, I need to save everything), I lose the backdrops. I try to recreate them, by saving a parallell array during initial generation, and pulling from that when regenerating the graphics upon loading. My problem is that I have now tried 3 or 4 different ways of regenerating the level, including eaching objects, and nesting fastloops with a tile printer object, and comparing against the array. But something is weird, I can not get this to work. Either I am misunderstanding why I can't pull the data from my graphics data array, something with the Z index I think. Basically I have tried, comparing against the array, with object position using both comparing two general values, or inside an expression of the printer object. I have tried eaching several objects, and moving a printer object, in both of these array comparison manners. Nothing seems to work. There is something I am doing wrong, where I can not read the array. I only use 2d arrays, when initially generating the level, so maybe it's something with the 3d array. I don't know, but I am misunderstanding something that is not obvious.

    Does anyone know a good resource for regenerating tiled levels, when using load frame state? There must be a "correct way" to do this, am I right?

    ------------------------------------

    This code does not paste into background anything. I am 100% the array information exists, as I have checked with a custom debugger + I previously on a separate Z index use this exact way to paste into background. The only difference here is that there are several array values to check for (altough I only posted 1), and that the Z layer is different. I must be misunderstanding something.

    * Loading of Master Map = "gen gap tiling"
    Master Map : Set Loading to "regenerating gap tiling"
    Terrain Regenerator : Move to layer Ground Layer( "Master Map" )
    Special : Start loop "gen gap tilin X" Frame Width / 32 times

    * On loop "gen gap tilin X"
    Terrain Regenerator : Set X position to LoopIndex("gen gap tilin X") * 32
    Special : Start loop "gen gap tilin Y" Frame Height / 32 times

    * On loop "gen gap tilin Y"
    Terrain Regenerator : Set Y position to LoopIndex("gen gap tilin Y") * 32

    * On loop "gen gap tilin Y"
    + ValueAtXYZ( "Graphics Array", LoopIndex("gen gap tilin X"), LoopIndex("gen gap tilin Y"), 1 ) = 1
    Terrain Regenerator : Change animation sequence to Stopped
    Terrain Regenerator : Force animation frame to 19
    Terrain Regenerator : Paste into background

    -------------------------------------------

    Once more, putting an "End the application" action in the * On loop "gep gap tilin Y" code, ends the application. But putting one in the array reading section does not. Meaning the conditions are supposedly not met, even though I know with 100% certainty that they are. I even removed all other code from the array except the one nested loop performed previously. The first one executes, and this is somehow never true, even though it is always true. My mind is blown.

    ----------------------------------------------

    Update, this does not work either:

    * Loading of Master Map = "gen gap tiling"
    + Run this event once
    Graphics Array : Set Z dimension index to 1
    Master Map : Set Loading to "regenerating gap tiling"
    Terrain Regenerator : Move to layer Ground Layer( "Master Map" )
    Special : Start loop "gen gap tilin X" Frame Width / 32 times

    * On loop "gen gap tilin X"
    Graphics Array : Set X dimension index to LoopIndex("gen gap tilin X")
    Terrain Regenerator : Set X position to LoopIndex("gen gap tilin X") * 32
    Special : Start loop "gen gap tilin Y" Frame Height / 32 times

    * On loop "gen gap tilin Y"
    Graphics Array : Set Y dimension index to LoopIndex("gen gap tilin Y")
    Terrain Regenerator : Set Y position to LoopIndex("gen gap tilin Y") * 32

    * On loop "gen gap tilin Y"
    + ValueAtXYZ( "Graphics Array", index x( "Graphics Array" ), index y( "Graphics Array" ), index z( "Graphics Array" ) ) = 1
    Terrain Regenerator : Change animation sequence to Stopped
    Terrain Regenerator : Force animation frame to 19
    Terrain Regenerator : Paste into background

    -----------------------------------


    Here's another approach I tried:

    I first generate terrain objects on each cell, instead of moving a printer, and then perform this code:

    * Loading of Master Map = "gen ground tiling"
    Master Map : Set Loading to "regenerating gap tiling"
    Start loop for each one of Terrain, loop name "gen ground tiles"

    * On each one of Terrain, loop name "gen ground tiles"

    + Terrain: ValueAtXYZ( "Graphics Array", CellX( "Terrain" ), CellY( "Terrain" ), 1 ) = 1
    Terrain : Change animation sequence to Stopped
    Terrain : Force animation frame to 19
    Terrain : Paste into background

    ---------------------------------------------

    This does not work, and I compare Value at XYZ inside a "compare expression to value" for each object here, it does not work when doing it with "compare two general" values either. I am quite frankly out of ideas. Furthermore, the weird thing is that when I first generate the levels I use all of these techniques in 2d arrays, here and there and they all work. Only after loading the frame state, and comparing against the parallell graphics array does it fail. Prompting me to think it is either something with the 3rd dimension in the array, or something entirely different like fusion disabling generated backdrops altogether after loading frame state or something along those lines.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!