Arrays not dropping data between play sessions?

Edit: Updated this question with new information.

My map generator recently began generating 2200 extra tiles on top of the 200 it was supposed to generate. For some reason these tiles were set to the last tile placed and were relaid over every vector in the map.

I think I see how it is generating extra tiles, but I am not sure why.

Possibly related to exposing and referencing my Vector Field in other blueprints? That is when the problems started.

I noticed in the level editor that if I select my map generator asset in the Scene Outliner, then it has a tab in the Details panel that shows my Vector Field.

Instead of 200 elements, it shows 2400 elements… With a Map Size of 10, it generates 200 tiles(0-199). As you can see in the picture it starts over at 200. It generates 12 times for a total of 2400 tiles.

So essentially my ForEachLoop was running on a Vector Field that had 12 times more vectors than it was supposed to have, and after it ran through the first 200, it merely kept the last tile set and laid them out 11 deep on top.

In the Details panel, it allowed me to reset the variable to Default which cleared the 2400 elements in the vector field to 0 and allowed me to generate a map properly without using the Do N nodes to cull the generation.

I am afraid that it will happen again and fill my Vector Field with garbage vectors. Apart from setting a ClearArray node in front of my Vector Field Generator, anyone know how to stop this from happening again?

Here is a picture of my strings printing to screen. As you can see, my Object Array is keeping past play session data. Every time I hit play and the map generates, those numbers increment by the amount of relevant tiles generated in the map.

Each time I play, 200 tiles are generated so for it to hit 900 on water means it has to be storing them between play sessions.

Right now, my Vector Field Array is not keeping data between play sessions but my Object Array is.

I seem to remember this problem first occuring after I put a Switch on Enum into my generator:

Anyone ever seen this? It hasn’t come back, but I would like to know how it could…

If you intend to generate this array each time you run, you probably want to set your array to be transient. If it is a blueprint variable, you can do this in the Details window, behind the arrow-down in the advanced options.

Thanks, that is a good tip for my array that is just counting the number of tiles generated.

What about my vector array?

Ideally my Vector Array generates at the beginning of a game and does not generate again. Many other arrays are generated based on this Vector Array and are modified all throughout the game.

Do you know how it happened to gain so many extra additions?

Is it good practice to do put a Clear Array node in front of any array the first time you generate it?

I just now remembered that I had a case where I had my Add nodes completely disconnected, hit play, and somehow STILL had tiles generate based on what should be been empty arrays.