Automatic PathFinder WIP

Cralant - Custom level - from Windows
PlayEdit13 players liked this.Log in to like this level.

A work in progress, uses query to build a tiled map to detect items to collide in, has the ability to have an ignore entities from a table as well.
Also a routefinder, currently works off random values to navigate to the goal, a sort of bad implentation of a pathfinding algorithm, but the best I can do at the moment.
The script doesnt allow the the alogrithm to double back on its previous steps, this causes issues with the script getting stuck in corners. I will eventually implement a stuck function so when stuck the feature is overided.

This may take a few tries to work properly, just hit restart and eventually it should work.

Any suggestions or if anyone feels like scripting me an A* principia compatible algorithm for a much better pathfinder bot. Dont be afraid to comment.

This is a sort of alpha for a self aware drone to navigate through maps.

Should be updating this regularly so check back for updates.

Views: 1375 Downloads: 435 Unique objects: 3 Total objects: 34

Discuss this level

Log in to comment on this level.
  • JOELwindows7: Awesome.
  • Cralant: @zardOz: sure if you need a hand I don't mind explaining stuff or going over some code if you want.
  • zardOz2: Man I suck at understanding functions, I have a method of tracking grid positions but I never got around to using it for battleship. Its very hard to explain, maybe I can make a simplish example
  • zardOz2: Ahh good, thanks Cralent... I'm not crazy then! I shall continue ignoring them
  • Cralant: @TechZ: thanks TZ ;)
  • Cralant: @zardOz: at the moment this literally picks a random direction out of 8 possible and tests is there is a collision of if it has been previously visited if no to both then it moves there. So it is a bit limited in that sense. Traditionally pathfinding like this uses multiple instances and compares them to find the shortest route out of the possible ones but my attempts with this were not very friendly to Principia and caused a bunch of lag. I could go around this by possibly optimizing some of the other features but it doesn't look promising. Also to be honest I have found no reason to use those either.

    @sdac: thanks sdac. I attempted raycasts but found for each tile it was to much work as I would have to raycast diagonally and each side to make sure I found every possible entity within the tile. But to query the whole board seems like a much simpler and accurate option then my current.
  • TechZ2124: Awesome ! Really great research work
  • sdac: Looks very promising, great work. Love the debug rendering of the tiles. ;) As you can see the query function is very approximate, you can use raycasts if you need exact collision information from one point to another. Another approach for more exact collision information would be to query to whole board once to find all entities, and then loop through them and use their width, height, angle and position to calculate the intersection with each tile, that would essentially limit the data to the resolution of the tile map.
  • zardOz2: Question cralent, Ive been avoiding many commands for awhile but from what I'm reading I can't seem to find any reason to use while/do and repeat/until that can't be done with if/then, what am I missing?
  • zardOz2: Hmm interesting... It's locked by the way. It doesnt seem to recognise the shorter path from it's options, perhaps it could check tthe hypotenuse length to target of each available space.

LEVEL ID: 5312