-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
Seems to be really hard for me to nail it down.
Steps
This commit should make it easy to build and repro it:
stack build && stack exec -- hackslash
Once it starts (it shows an empty window):
hit 'S'
watch the output with fine loop.
What I know about it
Basically, the goal was to write simple 'monster' that would react to change in monster positions, finding nearest one, and approaching it. This happens here:
cmdApproach = traceEvent "cmdApproach" $
let eTarget = traceEvent "eTarget" $ fromJust <$> ffilter isJust (uncurry findTarget <$> attachPromptlyDyn pos (updated inputPositions))
ePath = init . fromJust <$> traceEvent "ePath" (ffilter isJust (uncurry (findPath inputLevel) <$> attachPromptlyDyn pos eTarget))
in CmdWalk <$> ePath
pos :: Dynamic t Coord -- monster position
inputPositions :: Dynamic t (Map MonsterID Coord) -- all monster positions
findTargetdoes not find itselffindPathusesastarlibrary, currently whole grid is passable (I've stripped the code offreeablodependencies)- for some short paths, it doesn't loop.
- By looking at trace output, it doesn't look to me like it is the
findPathwhich loops endlessly, so my hunch is that it could be some causality loop?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels