mp_potential step spinning circles

J

Jesser

Guest
Hello, i am using a mp_potential_step command to move to a destination (x and y coördinate) avoiding solid objects. However, sometimes my object starts spinning in circles and i don't know why. Is there any way to fix this and maybe with avoiding a object, not all solid objects. I saw some things about steering behaviour, but i dont understand how to do that. Can anybody help me?
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
This happens if no path is found and can be configured via mp_potential_settings. Giving objects a collision mask and not setting image_angle to direction can help with them not getting stuck in walls at random.
 
J

Jesser

Guest
This does not solve the problem, i have no image angle set to direction and i made a collision mask. Sometimes there is a way it can go, but it will just spin around in circles and dont go there, but this happens only one in 5 times or so. sometimes after 15 spins it will stop and go. Anybody know how to solve?
 

TheWaffle

Member
I had a frustrating issue with this too... but it was caused by the object colliding with controller objects and sometimes if maxrot is set to too small a number the object would fail to turn on command. As to the "write a a* ...." not helpful if you just want a quick project.
 
GMS has an A* implementation via the mp_grid_* functions.

It's possible to have an A* path-finding system up and running in minutes.
 

TheWaffle

Member
Yes, GM has many built in cool path-finding options. A bit lacking in examples on each concept, but there. I did code my own many times, just so I would have full control of the AI process. But, we need to stay on topic about mp_potential_settings ;)
 
Top