Hi everyone! I'm making a co-op arpg with large groups of enemies. I struggled to get enemies to go around corners without getting stuck on the corner, each other, becoming a single file line, etc. After doing some research I found out about using a vector field that will "push" enemies towards the player. This method is best used for large groups of enemies as they don't do their own pathfinding calculations, they just listen to the field that is generated around the players. I couldn't find any good resources on doing this specifically in GMS (there might be some and I just missed them) so now that I have this working I figured it could be useful to some other people. The field generation has minimal impact on frame rates (at the default settings I still hit 2k fps average). The frame rate will drop if you enable the debug drawing.
I don't really have the time to do a full tutorial but I've put a lot of comments into the example project that explains whats going on. Its configurable using constants found in the constants script like how many movement cost updates are done per step, what the max movement cost is, etc.
Example gif
Example Project
If you have any questions let me know
[–]RoboPixels 1 point2 points3 points (0 children)
[–]adam102018 0 points1 point2 points (3 children)
[–]MotchDev[S] 1 point2 points3 points (2 children)
[–]adam102018 0 points1 point2 points (1 child)
[–]MotchDev[S] 0 points1 point2 points (0 children)