From 33a8211a69204e7a78a8b965076ac0e7e9b59337 Mon Sep 17 00:00:00 2001 From: Tim Felgentreff Date: Tue, 10 Jan 2023 17:01:52 +0100 Subject: [PATCH] a little docs on astar debugging --- src/pathfinder/astar.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/pathfinder/astar.cpp b/src/pathfinder/astar.cpp index 57520ba48..799c2af99 100644 --- a/src/pathfinder/astar.cpp +++ b/src/pathfinder/astar.cpp @@ -28,6 +28,19 @@ // 02111-1307, USA. // +// timfel: How to debug the pathfinder. +// In debug builds, there is a lua function "DumpNextAStar". The way I use this +// is to enter a game with stdout redirected to a file (that's the default on +// Windows), make sure nothing is moving, then hit "Return/Enter" to write a +// cheat code, and then type "eval DumpNextAStar()". Then send a unit somewhere. +// Next, open the stdout file using "less -R -z64 stdout.txt". Replace the "64" +// with the height of your map. The entire map will have been dumped using RGB colors +// to stdout. I use the arrow keys to position the first line of the first A* +// iteration at the top of my terminal, and then hit "Space" repeatedly. If the +// "-z64" argument used the correct map height and the terminal is wide enough, +// each time I hit space, it will scroll exactly far enough to have the next A* +// iteration first line at the top of my terminal, giving a sort of poor animation. + //@{ /*----------------------------------------------------------------------------