I’m working on migrating my Bomberman-like game to 4.12 and in doing so, I’m re-factoring everything again. I’ve decided to re-create my grid generator using an entirely different approach to make generation and performance a lot better - but in doing so, I’ve run into some obstacles.
Currently, every grid is an ISM instead of previously being a separate actor. This made things considerably faster, but in return made it more convoluted as well. I’m now using line traces since they very conveniently provide me with the Hit Item integer which works wonderfully for ISM’s.
However, it’s not so wonderful when removing instances as the array for all the instances seem to get shuffled randomly in doing so*(despite it saying the order is maintained)*. Currently it’s setup like this;
Very simple, I do a trace in every direction - if it collides, I check if the Hit Actor is BP_GridGenerator, if true, I check if the Hit Component is ISM_Boxes - if true, I get the Hit Item integer and store it in an array. I then loop through this array of integers to remove those instances.
This is where I’m currently stuck at. The first instance is always removed successfully, the others however are very, very unreliable. Sometimes they are, sometime they are not. Seeing as how the tooltip says the array “may shrink”, I tried a simple solution of subtracting the integer by 1 after the first index - but it’s hard to tell if it actually did any difference as it’s still very, very unreliable.
Anyone out there that has a clue as to what’s going on and if there’s a way to fix it?