• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Pathstart "Teleportation"?

Y

YCCCM7

Guest
Didn't think I'd be asking around here for help again so soon, but hey, such is life.

So this is kind of an odd and specific question. Working on an RTS. It has a grid for terrain and the like, walls, rocks that slow down workers, etc. But I can't help but notice that when simply using mp_paths to move my men, on rare occassions they "teleport" outside the map and towards impossible coordinates.

This isn't a slight deviation either, we're talking going from 950 Y to -120 in a single frame. Other times, they'll jump straight into walls a few hundred units X-wise... walls that the grid is specifically told to avoid at all costs.

These are ALSO numbers I can say definitively aren't being referenced in the code. Just doubled checked this with some logging to make triple sure. Interestingly, if rebounded back to place within 1 frame, the bug is invisible and will not repeat itself again for the remainder of the path's travel.

I just ran some tests with NOT editing path_speed, as I am doing that dynamically for slowing over obstructive terrain blocks and such, but even then the teleportation persists.

For now I've got an abs(LastX - x) > 12 and similar check in place, and it's solving the problem surprisingly well. But suffice to say, I largely would prefer to be able to stomp out the bug altogether at the source. I can get some code snippets, but it's hard to say what could be invoking these random jumps with path_start code.

Sound like a known bug or familiar error? If not, I can live with this, but thanks for your time either way.

Gamemaker v1.4 for Windows, obtained through Steam.
 
R

renex

Guest
Maybe you're using the absolute option wrong. Are you editing the path after it is generated?
 
Y

YCCCM7

Guest
I AM doing absolute false, which I just double checked, SHOULD be relative to current position according to the documentation. The path may very well be being edited in relation to terrain destruction. Lots of terrain destruction is actively occurring during my stress tests, meaning the MP Grid's no-no zones are being redefined mid-travel. I ASSUME that's not a huge issue?
 
R

renex

Guest
You probably want to recalculate the path everytime the obstruction map changes.

Also make sure you don't have any code trying to get a position from a path that ceases to exist.
 
Top