Quikiki0
(Quikiki0)
June 9, 2023, 8:36pm
1
I’m working on world gen for my 2d game and I need a way to select groups of ‘touching’ actors. Heres what it looks like currently:
Each set of circled actors needs to be grouped into seperate groups. each square is its owner actor placed on a grid.
I want the sets of actors to be placed into an arrays so i can modified them later.
any help is appreciated, if you need more explanation i’d be glad to tell you.
L1z4rD89
(L1z4rD89)
June 10, 2023, 12:16am
2
Hey @Quikiki0
here is one example. It is not fast but maybe can give you an idea:
UE52_GroupActors.zip (85.1 KB)
Quikiki0
(Quikiki0)
June 10, 2023, 8:23am
3
This is a great solution for smaller projects but my world is 100 x 100 with potentially 5k+ actors to check and your example crashes with a 20x20 on my computer.
Thanks for spending the time to demonstrate though I appreciate it!
L1z4rD89
(L1z4rD89)
June 11, 2023, 12:58pm
4
A faster approach, still without C++:
UE52_GroupActorsV2.zip (163.2 KB)
Otherwise look into clustering like K-means and the silhouette method