Home » MODDING HQ 1.13 » v1.13 Coding Talk » Path finding problems in 1.13
Path finding problems in 1.13[message #344501] Sun, 13 March 2016 10:11 Go to next message
sevenfm

 
Messages:1520
Registered:December 2012
Location: Under the Mountain
What I found is that there are some problems in path finding in 1.13.

First, AI cannot find path over the fence, so when AI decides in RED state to seek enemy and calls InternalGoAsFarAsPossibleTowards, it fails.
But when the same AI sees enemy, he calls FindBestPath in FindBestNearbyCover and it works, so he can jump over the fence and move towards closest enemy.
This can be easily checked in Wildfire landing sector, for example, will require AI decision tracing or manual calling of InternalGoAsFarAsPossibleTowards.

Second problem I found is that FindBestPath returns different AP cost for the same path than EstimatePlotPath.
For testing, in FindBestNearbyCover see
iPathCost = gubAIPathCosts[AI_PATHCOST_RADIUS + sXOffset][AI_PATHCOST_RADIUS + sYOffset];

and compare with
iPathCost = EstimatePlotPath( pSoldier, sGridNo, FALSE, FALSE, FALSE, usMovementMode, FALSE, FALSE, 0);

And when testing the path in UI mode (for player controlled merc), the EstimatePlotPath shows correct result while gubAIPathCosts shows incorrect result.

Note: this was tested on stable 7609 release but I haven't seen any related fixes for development trunk.

Can anyone comment/test/confirm/debug/fix?

EDIT: the part with jumping over fence was successfully fixed in Ja2+AI

[Updated on: Sat, 28 May 2016 12:22]




7609+fix | 7609+AI (r688) | 7609 unofficial modpack | Win8+ fix | Experimental project | Youtube
Point out what it is you are interested in.


Re: Path finding problems in 1.13[message #344521 is a reply to message #344501] Sun, 13 March 2016 22:57 Go to previous message
silversurfer

 
Messages:2279
Registered:May 2009
Calculations are different. For example "PlotPath" function which is used by "EstimatePlotPath" runs function "TerrainActionPoints" to get the points needed to cross certain tiles. Function "FindBestPath" doesn't use "TerrainActionPoints". Instead it has its own code block to calculate the terrain stuff which seems redundant to me. Maybe this could be consolidated a bit which would probably make it easier to read as well. Unfortunately I don't have time to go through the code.



Wildfire Maps Mod 6.07 on SVN: https://ja2svn.mooo.com/source/ja2/branches/Wanne/JA2%201.13%20Wildfire%206.06%20-%20Maps%20MOD

Previous Topic: [IDEA] New Magazine System
Next Topic: Roof climbing problem in 1.13
Goto Forum:
  


Current Time: Mon Apr 23 04:26:50 EEST 2018

Total time taken to generate the page: 0.01146 seconds