progress with fixing path finding

This commit is contained in:
2025-01-21 00:19:38 +00:00
parent 8498fab1dc
commit f948d060ea
2 changed files with 5 additions and 5 deletions

View File

@@ -28,7 +28,7 @@ struct
(isBetween (prevX, curX, prevFinishX)
orelse
isBetween (prevX, curFinishX, prevFinishX)
andalso prevY + Constants.jumpLimit >= curY)
andalso prevY + 155 >= curY)
end
fun canDropDownTo (prevPlat: platform, currentPlat: platform) =
@@ -242,6 +242,7 @@ struct
fun filterMinDuplicates (q, eKeys) =
let
val {id = min, ...} = DistHeap.findMin q
val pos = IntSet.findInsPos (min, eKeys)
in
if IntSet.contains (min, eKeys) then
let val q = DistHeap.deleteMin q
@@ -261,7 +262,8 @@ struct
val acc = curID :: acc
val pos = IntSet.findInsPos (curID, eKeys)
val {from, ...} = ValSet.sub (eVals, pos)
val {from, distance, ...} = ValSet.sub (eVals, pos)
val _ = print ("266 distance = " ^ Int.toString distance ^ "\n")
in
helpGetPathList (from, eID, eKeys, eVals, acc)
end
@@ -289,7 +291,6 @@ struct
(* find reachable values from min in quad tree *)
let
val plat = Platform.find (minID, platforms)
val q = DistHeap.deleteMin q
(* add explored *)
val insPos = IntSet.findInsPos (minID, eKeys)
@@ -318,7 +319,7 @@ struct
(* fold over quad tree, updating any distances
* we find the shortest path for *)
val (eVals, q) = FindReachable.foldRegion
(0, 0, ww, wh, 0, 0, ww, wh, env, state, platformTree)
(0, 0, ww, 100, 0, 0, ww, wh, env, state, platformTree)
in
loop (pID, eID, platforms, platformTree, q, eKeys, eVals)
end

View File

@@ -52,7 +52,6 @@ struct
else
let
val {itemID, ...} = Vector.sub (elements, pos)
val _ = print ("foldVec itemID: " ^ Int.toString itemID ^ "\n")
val state = Fn.fState (state, env, itemID)
in
foldVec (iX, iY, iW, iH, pos + 1, elements, state, env)