Forums » Bugs

Path Finding broken :-)

Jan 19, 2005 Agonizer link
Hi!

After the update i went to an Artemis-Collectors-Only Sector in Dantia to pickup some scrap metal and queen coords. I've seen an Artemis Collector stuck in an Asteroid, perhaps he was trying to fly to the other side but couldnt because the roid was concav there. I spent a Jackhammer to get its attention :-)

Seems to me that pathfinding needs to be fixed again?

Perhaps the pathfinding code should try a 'reverse order', rather then a direct way. I.e. there are some kind of riddles/puzzles in which you have to find the right way (in form of a mouse hole and 8 'ropes' A to H, question is 'which way for the mouse to reach the safe hole before the bad cat gets here'. Of course its easier if you start at the end of the hole and follow the rope back to its starting point, rather than trying all 8 ways).

I hope you understand what i mean.

THE FOLLOWING WILL LOOK READABLE ONLY WITH A MONOSPACED FONT!

It seems current way for pathfinding is this:
| __
| 1. 2./ \ 7.
|[NPC] -----> -----> -----> | |6.-- * Destination
| | \__/ /
| 3.\ /
| 4.---- 5.

at position 2. it bumps into the roid and may not find its way to the destination if it needs actually to move in the opposite direction.

Better would be (IMHO) this:
| __
| 4.* -,,. / \ 1.
|[NPC] ``--,. | | * Destination
| ``--,. \__/ /
| `-,. /
| 3.*----*2.

Well i'm not an graphics artist :)

1. is the destination waypoint and the first waypoint in calculation! Waypoint code needs to calculate back a way to the NPC's current location. While the bot travels on its path from WP4 to WP3, the code should check and could adjust/finetune the next waypoints it also should be able to add additional or remove unneeded waypoints.

It would also be a nice idea if you had some kind of aggressive and defensive waypoint code. i.e. if you fly into an big asteroid cluster, one of the bots may follow you (with the normal speed of 50-65m/s) into the roid cluster, the other could calculate a way around the roid cluster and then attack from the other side.

Perhaps move this to suggestion?
Jan 19, 2005 Agonizer link
No, it looks like shit because the forum code removes 'unneeded' spaces... thanks forum. Grrr..... Ok, its actually STORED in the DB, i can view it when editing, but the forum display code removes such formatting.... however.
Jan 19, 2005 raybondo link
heh, it's the web browser that is removing extra spaces because we don't use <pre>.
View the source to this page and it looks right in a text editor. Well, looks better anyways.
Jan 19, 2005 roguelazer link
Replace all spaces with the non-breaking space escape code (& nbsp ; )
Jan 19, 2005 a1k0n link
Yeah, somewhere along the line I forgot to commit the code which saves out the roadmaps. The path planning code dynamically maps out the sector as paths need planning, and this information is lost when a sector goes inactive. Oops. That'll be fixed today, and the sector maps should steadily improve over time, so the bot in question would know how to get around the asteroid in question every time.

Even so, yeah, the pathfinding sucks. It's a crappy solution overall. If our game were 2D or a walk-on-the-ground type deal, a complete solution would be much, much easier.

And yes, any HTML renderer removes extra whitespace characters.
Jan 19, 2005 roguelazer link
You could always put some code in the forum which does something akin to this (PHP, so bear with me):

ereg_replace(" ", "&nbsp;");