diff --git a/src/Dodge/Block.hs b/src/Dodge/Block.hs index 1c21ed058..a028ea683 100644 --- a/src/Dodge/Block.hs +++ b/src/Dodge/Block.hs @@ -4,13 +4,14 @@ module Dodge.Block ( destroyDoor, ) where +import Dodge.Zoning.Wall +import Dodge.Base.Collide +import Control.Monad +import Dodge.Path import Control.Lens import Data.Foldable -import qualified Data.Graph.Inductive as FGL import qualified Data.IntSet as IS import Data.Maybe -import Data.Set (Set) -import Dodge.Base.Collide import Dodge.Block.Debris import Dodge.Data.MountedObject import Dodge.Data.World @@ -20,7 +21,6 @@ import Dodge.Material.Sound import Dodge.Wall.Delete import Dodge.Wall.Zone import Dodge.WorldEvent.Sound -import Dodge.Zoning.Wall import qualified IntMapHelp as IM splinterBlock :: Block -> World -> World @@ -66,16 +66,22 @@ destroyBlock bl w = -- ps = replicateM 25 (randInCirc 20) & evalState $ _randGen w -- this does not handle eg doors blocking the path as well -maybeClearPaths :: Set PathEdgeNodes -> World -> World +maybeClearPaths :: [(Int,Int)] -> World -> World maybeClearPaths ps w = foldl' maybeClearPath w ps -maybeClearPath :: World -> PathEdgeNodes -> World -maybeClearPath w (PathEdgeNodes x y pe) - | not . null $ overlapSegWalls (_peStart pe) (_peEnd pe) $ wlsNearSeg (_peStart pe) (_peEnd pe) w = - w - | otherwise = - w - & cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles .~ mempty) . FGL.delEdge (x, y) +maybeClearPath :: World -> (Int,Int) -> World +maybeClearPath w (i,j) = fromMaybe w $ do + x <- getNodePos i w + y <- getNodePos j w + guard $ null $ overlapSegWalls x y $ wlsNearSeg x y w + return $ w & cWorld . incGraph %~ updateEdge f (i,j) + where + f = at BlockObstacle .~ Nothing +---- | not . null $ overlapSegWalls (_peStart pe) (_peEnd pe) $ wlsNearSeg (_peStart pe) (_peEnd pe) w = +---- w +---- | otherwise = +---- w +---- & cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles .~ mempty) . FGL.delEdge (x, y) destroyDoor :: Door -> World -> World destroyDoor dr w = diff --git a/src/Dodge/Combine/Graph.hs b/src/Dodge/Combine/Graph.hs index 53509c547..1b0b2e410 100644 --- a/src/Dodge/Combine/Graph.hs +++ b/src/Dodge/Combine/Graph.hs @@ -1,8 +1,6 @@ {-# LANGUAGE LambdaCase #-} -module Dodge.Combine.Graph - ( combinationsDotGraph - ) where +module Dodge.Combine.Graph ( combinationsDotGraph) where import Dodge.Data.CombAmount import Data.Bifunctor diff --git a/src/Dodge/CreatureEffect.hs b/src/Dodge/CreatureEffect.hs index cc9e43ec1..dac45eb0d 100644 --- a/src/Dodge/CreatureEffect.hs +++ b/src/Dodge/CreatureEffect.hs @@ -48,7 +48,8 @@ doCrWdAc :: CrWdAc -> Creature -> World -> Action doCrWdAc cw = case cw of CrWdBFSThenReturn t -> \cr w -> fromMaybe NoAction $ do n <- walkableNodeNear w (cr ^. crPos . _xy) - let as = take 20 $ map PathTo $ bfsNodePoints n w +-- let as = take 20 $ map PathTo $ bfsNodePoints n w + let as = [] return $ DoActionThen (DoImpulses [ChangeStrategy Search]) $ DoReplicate t $ diff --git a/src/Dodge/Data/Block.hs b/src/Dodge/Data/Block.hs index 6a10f8062..5bc66058d 100644 --- a/src/Dodge/Data/Block.hs +++ b/src/Dodge/Data/Block.hs @@ -7,7 +7,6 @@ module Dodge.Data.Block ( module Dodge.Data.PathGraph, ) where -import Data.Set (Set) import Color import Control.Lens import Data.Aeson @@ -29,7 +28,8 @@ data Block = Block , _blHeight :: Float , _blMaterial :: Material , _blDraw :: BlockDraw --Block -> SPic - , _blObstructs :: Set PathEdgeNodes +-- , _blObstructs :: Set PathEdgeNodes + , _blObstructs :: [(Int,Int)] } deriving (Eq, Ord, Show, Read) --Generic, Flat) diff --git a/src/Dodge/Data/CWorld.hs b/src/Dodge/Data/CWorld.hs index 4660488b2..83b804056 100644 --- a/src/Dodge/Data/CWorld.hs +++ b/src/Dodge/Data/CWorld.hs @@ -25,7 +25,7 @@ data CWorld = CWorld , _cwGen :: CWGen , _cClock :: Int , _cwTiles :: [Tile] - , _pathGraph :: Gr Point2 PathEdge +-- , _pathGraph :: Gr Point2 PathEdge , _incGraph :: V.Vector [(Int,SimpleEdge)] , _incNode :: UV.Vector Point2 , _numberFloorVerxs :: Int diff --git a/src/Dodge/Data/Door.hs b/src/Dodge/Data/Door.hs index 81e8a141e..9cdd193ed 100644 --- a/src/Dodge/Data/Door.hs +++ b/src/Dodge/Data/Door.hs @@ -8,7 +8,6 @@ module Dodge.Data.Door ( module Dodge.Data.WorldEffect, ) where -import Data.Set (Set) import Control.Lens import Data.Aeson import Data.Aeson.TH @@ -42,7 +41,7 @@ data Door = Door , _drPushedBy :: PushSource , _drPushes :: Maybe Int , _drMounts :: [MountedObject] - , _drObstructs :: Set PathEdgeNodes +-- , _drObstructs :: [(Int,Int)] , _drObstacleType :: EdgeObstacle } diff --git a/src/Dodge/Data/PathGraph.hs b/src/Dodge/Data/PathGraph.hs index d98c3ad7c..5604f7ee5 100644 --- a/src/Dodge/Data/PathGraph.hs +++ b/src/Dodge/Data/PathGraph.hs @@ -24,20 +24,20 @@ import Geometry.Data -- } -- deriving (Eq, Show, Read) --, Generic) -data PathEdgeNodes = PathEdgeNodes - { _penStart :: Int - , _penEnd :: Int - , _penPathEdge :: PathEdge - } - deriving (Eq, Ord, Show, Read) --Generic, Flat) - -data PathEdge = PathEdge - { _peStart :: Point2 - , _peEnd :: Point2 - , _peDist :: Float - , _peObstacles :: Set.Set EdgeObstacle - } - deriving (Eq, Ord, Show, Read) --Generic, Flat) +--data PathEdgeNodes = PathEdgeNodes +-- { _penStart :: Int +-- , _penEnd :: Int +-- , _penPathEdge :: PathEdge +-- } +-- deriving (Eq, Ord, Show, Read) --Generic, Flat) +-- +--data PathEdge = PathEdge +-- { _peStart :: Point2 +-- , _peEnd :: Point2 +-- , _peDist :: Float +-- , _peObstacles :: Set.Set EdgeObstacle +-- } +-- deriving (Eq, Ord, Show, Read) --Generic, Flat) data SimpleEdge = SimpleEdge { _seDist :: Float @@ -61,12 +61,12 @@ data EdgeObstacle --deriving instance (Flat (Gr Point2 PathEdge)) --makeLenses ''PathGraph -makeLenses ''PathEdge -makeLenses ''PathEdgeNodes +--makeLenses ''PathEdge +--makeLenses ''PathEdgeNodes makeLenses ''SimpleEdge deriveJSON defaultOptions ''EdgeObstacle -deriveJSON defaultOptions ''PathEdge -deriveJSON defaultOptions ''PathEdgeNodes +--deriveJSON defaultOptions ''PathEdge +--deriveJSON defaultOptions ''PathEdgeNodes deriveJSON defaultOptions ''Gr deriveJSON defaultOptions ''SimpleEdge --deriveJSON defaultOptions ''PathGraph diff --git a/src/Dodge/Data/World.hs b/src/Dodge/Data/World.hs index 9eb56f916..5c987e273 100644 --- a/src/Dodge/Data/World.hs +++ b/src/Dodge/Data/World.hs @@ -47,8 +47,8 @@ data World = World , _clZoning :: IntMap (IntMap [Cloud]) , _dsZoning :: IntMap (IntMap [Dust]) , _wlZoning :: IntMap (IntMap IntSet) -- Zoning IM.IntMap Wall - , _pnZoning :: IntMap (IntMap [(Int, Point2)]) --Zoning IM.IntMap Creature - , _peZoning :: IntMap (IntMap (Set PathEdgeNodes)) +-- , _pnZoning :: IntMap (IntMap [(Int, Point2)]) --Zoning IM.IntMap Creature +-- , _peZoning :: IntMap (IntMap (Set PathEdgeNodes)) , _incNodeZoning :: IntMap (IntMap [(Int, Point2)]) --Zoning IM.IntMap Creature , _incEdgeZoning :: IntMap (IntMap [(Int,Int)]) --Zoning IM.IntMap Creature , _gsZoning :: IntMap (IntMap IntSet) diff --git a/src/Dodge/Debug/Picture.hs b/src/Dodge/Debug/Picture.hs index 3fb7bc066..4d2863c54 100644 --- a/src/Dodge/Debug/Picture.hs +++ b/src/Dodge/Debug/Picture.hs @@ -251,22 +251,20 @@ drawInspectWalls w = concat $ do ) drawInspectWall :: World -> Wall -> Picture -drawInspectWall w wl = +drawInspectWall _ wl = setLayer DebugLayer $ color rose (thickLine 3 [a, b]) - <> foldMap (drawDoorPaths w) (wl ^? wlStructure . wsDoor) +-- <> foldMap (drawDoorPaths w) (wl ^? wlStructure . wsDoor) where (a, b) = _wlLine wl -drawDoorPaths :: World -> Int -> Picture -drawDoorPaths w drid = concat $ do - paths <- w ^? cWorld . lWorld . doors . ix drid . drObstructs - return $ foldMap' (drawPathEdge . (^. penPathEdge)) paths +--drawDoorPaths :: World -> Int -> Picture +--drawDoorPaths w drid = concat $ do +-- paths <- w ^? cWorld . lWorld . doors . ix drid . drObstructs +-- return $ foldMap' (drawPathEdge . (^. penPathEdge)) paths -drawPathEdge :: PathEdge -> Picture -drawPathEdge pe = - setLayer DebugLayer $ - multiArrow (_peStart pe) (_peEnd pe) green (S.map obstacleColor (_peObstacles pe)) +drawPathEdge :: Point2 -> Point2 -> S.Set EdgeObstacle -> Picture +drawPathEdge x y pe = setLayer DebugLayer $ multiArrow x y green (S.map obstacleColor pe) obstacleColor :: EdgeObstacle -> Color obstacleColor eo = case eo of @@ -403,16 +401,6 @@ drawWlIDs w = setLayer FixedCoordLayer $ foldMap f (w ^. cWorld . lWorld . walls where p = worldPosToScreen (w ^. wCam) $ 0.5 *.* uncurry (+.+) (_wlLine wl) - -drawPathing' :: Config -> World -> Picture -drawPathing' cfig w = - setLayer DebugLayer $ - foldMap (edgeToPic (screenPolygon cfig (w ^. wCam)) . (^?! _3)) (FGL.labEdges gr) - <> foldMap dispInc (graphToIncidence gr) - where - dispInc (p, n) = setDepth 2 . uncurryV translate p . scale 0.1 0.1 $ text $ show n - gr = w ^. cWorld . pathGraph - drawPathing :: Config -> World -> Picture drawPathing cfig w = setLayer DebugLayer $ ifoldMap f $ w ^. cWorld . incGraph @@ -420,12 +408,9 @@ drawPathing cfig w = inodes = w ^. cWorld . incNode f i = foldMap (g i) g i (j,se) = edgeToPic (screenPolygon cfig (w ^.wCam)) - (PathEdge (inodes ^?! ix i) (inodes ^?! ix j) 0 (se ^. seObstacles)) + (inodes ^?! ix i) (inodes ^?! ix j) (se ^. seObstacles) -edgeToPic :: [Point2] -> PathEdge -> Picture -edgeToPic poly pe +edgeToPic :: [Point2] -> Point2 -> Point2 -> S.Set EdgeObstacle -> Picture +edgeToPic poly sp ep pe | not (pointInPoly sp poly) && not (pointInPoly ep poly) = mempty - | otherwise = drawPathEdge pe - where - sp = _peStart pe - ep = _peEnd pe + | otherwise = drawPathEdge sp ep pe diff --git a/src/Dodge/Default/Door.hs b/src/Dodge/Default/Door.hs index addce6443..eabb7ce82 100644 --- a/src/Dodge/Default/Door.hs +++ b/src/Dodge/Default/Door.hs @@ -43,6 +43,6 @@ defaultDoor = , _drPushedBy = PushesItself , _drPushes = Nothing , _drMounts = mempty - , _drObstructs = mempty +-- , _drObstructs = mempty , _drObstacleType = DoorObstacle } diff --git a/src/Dodge/Default/World.hs b/src/Dodge/Default/World.hs index 438de0196..65e17b8f8 100644 --- a/src/Dodge/Default/World.hs +++ b/src/Dodge/Default/World.hs @@ -47,8 +47,8 @@ defaultWorld = , _clZoning = mempty , _dsZoning = mempty , _wlZoning = mempty - , _pnZoning = mempty - , _peZoning = mempty +-- , _pnZoning = mempty +-- , _peZoning = mempty , _incNodeZoning = mempty , _incEdgeZoning = mempty , _gsZoning = mempty --Zoning IM.empty clZoneSize (zonePos _guPos) @@ -87,7 +87,7 @@ defaultCWorld = { _lWorld = defaultLWorld , _cwGen = defaultCWGen , _cClock = 0 - , _pathGraph = Data.Graph.Inductive.Graph.empty +-- , _pathGraph = Data.Graph.Inductive.Graph.empty , _cwTiles = mempty , _numberFloorVerxs = 0 , _chasms = mempty diff --git a/src/Dodge/DrWdWd.hs b/src/Dodge/DrWdWd.hs index 99862e8c8..951b700d3 100644 --- a/src/Dodge/DrWdWd.hs +++ b/src/Dodge/DrWdWd.hs @@ -7,7 +7,7 @@ import Dodge.Base import Dodge.Block.Debris import Dodge.Data.World import Dodge.LevelGen.DoorPane -import Dodge.Placement.PlaceSpot.TriggerDoor +--import Dodge.Placement.PlaceSpot.TriggerDoor import Dodge.SoundLogic import Dodge.Wall.Move import Dodge.WorldBool @@ -28,7 +28,7 @@ doorMechanism dr w = case mvDir of & flip (IS.foldl' (flip (`translateWallID` d))) (_drWallIDs dr) & moveUpdate & cWorld . lWorld . doors . ix drid . drPos . each %~ (+.+ d) - & maybeClearDoorPaths (_drObstacleType dr) (_drObstructs dr) +-- & updateDoorEdges (_drObstacleType dr) (_drObstructs dr) Nothing -> w where toOpen = doWdBl (_drTrigger dr) w diff --git a/src/Dodge/Layout.hs b/src/Dodge/Layout.hs index 9f4c04b4d..a85ad44f5 100644 --- a/src/Dodge/Layout.hs +++ b/src/Dodge/Layout.hs @@ -6,12 +6,12 @@ module Dodge.Layout ( ) where import qualified Data.Vector.Unboxed as UV -import Dodge.Path.Translate +--import Dodge.Path.Translate import qualified Control.Foldl as L import Control.Lens import Data.Foldable import Data.Function -import Data.Graph.Inductive (labEdges, labNodes) +--import Data.Graph.Inductive (labEdges, labNodes) import Data.List (nubBy,sortOn) import Data.Maybe import Data.Tile @@ -45,16 +45,16 @@ generateLevelFromRoomList gr' w = . worldToGenWorld rs' $ w & cWorld . lWorld . walls .~ wallsFromRooms rs & cWorld . cwGen . cwgGameRooms .~ gameRoomsFromRooms (IM.elems rs') - & cWorld . pathGraph .~ path +-- & cWorld . pathGraph .~ path & cWorld . incNode .~ inodes & cWorld . incGraph .~ igraph - & pnZoning .~ foldl' (flip zonePn) mempty (labNodes path) - & peZoning .~ foldl' (flip zonePe) mempty (map fromEdgeTuple $ labEdges path) +-- & pnZoning .~ foldl' (flip zonePn) mempty (labNodes path) +-- & peZoning .~ foldl' (flip zonePe) mempty (map fromEdgeTuple $ labEdges path) & incNodeZoning .~ UV.ifoldl' (\m i p -> zonePn (i,p) m) mempty inodes & incEdgeZoning .~ foldl' (flip (zoneIncPe inodes)) mempty ipairs where pairs = snapToGrid $ foldMap _rmPath rs - (_, path) = pairsToGraph pairs +-- (_, path) = pairsToGraph pairs (inodes,igraph,ipairs) = pairsToIncGraph pairs rs = map doRoomShift $ IM.elems rs' rs' = mapM shuffleRoomPos gr' & evalState $ _randGen w diff --git a/src/Dodge/Path.hs b/src/Dodge/Path.hs index 45e173439..8cfe385c4 100644 --- a/src/Dodge/Path.hs +++ b/src/Dodge/Path.hs @@ -5,19 +5,18 @@ module Dodge.Path ( makePathBetweenPs, -- , removePathsCrossing obstructPathsCrossing, - pairsToGraph, +-- pairsToGraph, getNodePos, walkableNodeNear, - bfsNodePoints, +-- bfsNodePoints, snapToGrid, pairsToIncGraph, + updateEdge, + getEdgesCrossing, ) where -import Control.Lens import qualified Algorithm.Search as AS -import Dodge.Zoning.Common -import qualified Data.Vector as V -import qualified Data.Vector.Unboxed as UV +import Control.Lens --import Data.Bifunctor import Data.Foldable import Data.Graph.Inductive hiding ((&)) @@ -27,22 +26,36 @@ import qualified Data.Map.Strict as M import Data.Maybe import Data.Set (Set) import qualified Data.Set as Set +import qualified Data.Vector as V +import qualified Data.Vector.Unboxed as UV import Dodge.Base.Collide import Dodge.Data.World import Dodge.Zoning.Base +import Dodge.Zoning.Common import Dodge.Zoning.Pathing import Geometry -import Linear import qualified IntMapHelp as IM +import Linear getNodePos :: Int -> World -> Maybe Point2 -getNodePos i w = (w ^. cWorld . pathGraph) `lab` i +getNodePos i w = w ^? cWorld . incNode . ix i ---makePathUsing' :: (PathEdge -> Bool) -> Point2 -> Point2 -> World -> Maybe [Int] ---makePathUsing' t s e w = do --- na <- walkableNodeNear w s --- nb <- walkableNodeNear w e --- sp na nb . second _peDist . efilter (^. _3 . to t) $ w ^. cWorld . pathGraph +getEdgesCrossing :: Point2 -> Point2 -> World -> [(Int,Int)] +getEdgesCrossing s e w = filter inedgecrosses $ nearSeg peZoneSize _incEdgeZoning s e w + where + inedgecrosses (i, j) = isJust $ intersectSegSeg s e (f i) (f j) + f i = w ^?! cWorld . incNode . ix i + +updateEdge :: + (Set.Set EdgeObstacle -> Set.Set EdgeObstacle) -> + (Int, Int) -> + V.Vector [(Int, SimpleEdge)] -> + V.Vector [(Int, SimpleEdge)] +updateEdge f (i, j) = ix i . each %~ g + where + g (k, o) + | j == k = (k, o & seObstacles %~ f) + | otherwise = (k, o) makePathUsing :: (Set.Set EdgeObstacle -> Bool) -> Point2 -> Point2 -> World -> Maybe [Int] makePathUsing t s e w = do @@ -50,24 +63,24 @@ makePathUsing t s e w = do nb <- walkableNodeNear w e let f i = getes i h i = distance (getn nb) (getn i) - (na :) . snd <$> AS.aStarAssoc f h (==nb) na + (na :) . snd <$> AS.aStarAssoc f h (== nb) na where - g (i,SimpleEdge c o) - | t o = Just (i,c) + g (i, SimpleEdge c o) + | t o = Just (i, c) | otherwise = Nothing getes i = mapMaybe g $ w ^?! cWorld . incGraph . ix i getn i = w ^?! cWorld . incNode . ix i - + -- sp na nb . second _peDist . efilter (^. _3 . to t) $ w ^. cWorld . pathGraph makePathBetween :: Point2 -> Point2 -> World -> Maybe [Int] makePathBetween = makePathUsing $ not . pathEdgeObstructed -pathEdgeObstructed' :: PathEdge -> Bool -pathEdgeObstructed' pe = - any - (`Set.member` _peObstacles pe) - [DoorObstacle, BlockObstacle, ChasmObstacle] +--pathEdgeObstructed' :: PathEdge -> Bool +--pathEdgeObstructed' pe = +-- any +-- (`Set.member` _peObstacles pe) +-- [DoorObstacle, BlockObstacle, ChasmObstacle] pathEdgeObstructed :: Set.Set EdgeObstacle -> Bool pathEdgeObstructed pe = @@ -81,11 +94,11 @@ walkableNodeNear w p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear where nodesNear = zonesExtract (w ^. incNodeZoning) . snailAround $ zoneOfPoint pnZoneSize p -walkableNodeNear' :: World -> Point2 -> Maybe Int -{-# INLINE walkableNodeNear' #-} -walkableNodeNear' w p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear - where - nodesNear = zonesExtract (w ^. pnZoning) . snailAround $ zoneOfPoint pnZoneSize p +--walkableNodeNear' :: World -> Point2 -> Maybe Int +--{-# INLINE walkableNodeNear' #-} +--walkableNodeNear' w p = fmap fst . find (flip (isWalkable p) w . snd) $ nodesNear +-- where +-- nodesNear = zonesExtract (w ^. pnZoning) . snailAround $ zoneOfPoint pnZoneSize p snailAround :: Int2 -> [Int2] snailAround x = (x +) <$> smallSnailInt2 @@ -97,17 +110,18 @@ smallSnailInt2 = [V2 x y | x <- [-2 .. 2], y <- [-2 .. 2]] makePathBetweenPs :: Point2 -> Point2 -> World -> Maybe [Point2] -makePathBetweenPs a b w = mapMaybe (lab $ w ^. cWorld . pathGraph) <$> makePathBetween a b w +--makePathBetweenPs a b w = mapMaybe (lab $ w ^. cWorld . pathGraph) <$> makePathBetween a b w +makePathBetweenPs a b w = mapMaybe (flip getNodePos w) <$> makePathBetween a b w -bfsNodePoints :: Int -> World -> [Point2] -bfsNodePoints n w = mapMaybe (lab g) $ bfs n g - where - g = w ^. cWorld . pathGraph +--bfsNodePoints :: Int -> World -> [Point2] +--bfsNodePoints n w = mapMaybe (lab g) $ bfs n g +-- where +-- g = w ^. cWorld . pathGraph pointTowardsImpulse :: Point2 -> Point2 -> World -> Maybe Point2 pointTowardsImpulse a b w = --- (find (flip (isWalkable a) w) . reverse) --- =<< (makePathBetweenPs a b w <&> (<> [b])) + -- (find (flip (isWalkable a) w) . reverse) + -- =<< (makePathBetweenPs a b w <&> (<> [b])) (find (flip (isWalkable a) w) . reverse) =<< makePathBetweenPs a b w -- <&> (<> [b])) @@ -155,78 +169,80 @@ pointTowardsImpulse a b w = -- _ -> return $ Just $ ns !! i -- -pairsToIncGraph :: Set.Set (Point2,Point2) - -> (UV.Vector Point2 - , V.Vector [(Int,SimpleEdge)] - , [(Int,Int)] +pairsToIncGraph :: + Set.Set (Point2, Point2) -> + ( UV.Vector Point2 + , V.Vector [(Int, SimpleEdge)] + , [(Int, Int)] + ) +pairsToIncGraph pairs = + ( inodes + , incgraph + , Set.toList pairs & each . each %~ (\i -> pstons ^?! ix i . _head) ) -pairsToIncGraph pairs = (inodes,incgraph - ,Set.toList pairs & each . each %~ (\i -> pstons ^?! ix i . _head)) where incgraph = V.generate (length im) (\i -> im ^?! ix i) im = IM.fromListWith (<>) . fmap toedge $ Set.toList pairs - toedge (x,y) = (pstons ^?! ix x . _head - , [(pstons ^?! ix y . _head, SimpleEdge (distance x y) mempty)]) - pstons = IM.invertIntMap . IM.fromList $ zip [0..] ps + toedge (x, y) = + ( pstons ^?! ix x . _head + , [(pstons ^?! ix y . _head, SimpleEdge (distance x y) mempty)] + ) + pstons = IM.invertIntMap . IM.fromList $ zip [0 ..] ps inodes = UV.generate (length ps) (ps !!) ps = Set.toList $ Set.map fst pairs <> Set.map snd pairs -pairsToGraph :: - Set.Set (Point2, Point2) -> - (Map (V2 Point2) PathEdgeNodes, Gr Point2 PathEdge) -pairsToGraph pairs = addEdges nodemap gr pairs - where - (nodemap, _, gr) = addNodes $ Set.toList $ Set.map fst pairs <> Set.map snd pairs +--pairsToGraph :: +-- Set.Set (Point2, Point2) -> +-- (Map (V2 Point2) PathEdgeNodes, Gr Point2 PathEdge) +--pairsToGraph pairs = addEdges nodemap gr pairs +-- where +-- (nodemap, _, gr) = addNodes $ Set.toList $ Set.map fst pairs <> Set.map snd pairs -addNodes :: [Point2] -> (Map Point2 Int, Int, Gr Point2 PathEdge) -addNodes = foldl' f (mempty, 0, Data.Graph.Inductive.empty) - where - f (nodemap, i, gr) p = case nodemap M.!? p of - Just _ -> (nodemap, i, gr) - Nothing -> (nodemap & at p ?~ i, i + 1, insNode (i, p) gr) +--addNodes :: [Point2] -> (Map Point2 Int, Int, Gr Point2 PathEdge) +--addNodes = foldl' f (mempty, 0, Data.Graph.Inductive.empty) +-- where +-- f (nodemap, i, gr) p = case nodemap M.!? p of +-- Just _ -> (nodemap, i, gr) +-- Nothing -> (nodemap & at p ?~ i, i + 1, insNode (i, p) gr) -addEdges :: - Map Point2 Int -> - Gr Point2 PathEdge -> - Set.Set (Point2, Point2) -> - (Map (V2 Point2) PathEdgeNodes, Gr Point2 PathEdge) -addEdges nodemap gr = foldl' f (mempty, gr) - where - f (edgemap, gr') (a, b) = - ( M.insert (V2 a b) theedgedata edgemap - , insEdge theedgetup gr' - ) - where - theedgetup = (g a, g b, PathEdge a b (dist a b) mempty) - theedgedata = PathEdgeNodes (g a) (g b) (PathEdge a b (dist a b) mempty) - g a = nodemap M.! a +--addEdges :: +-- Map Point2 Int -> +-- Gr Point2 PathEdge -> +-- Set.Set (Point2, Point2) -> +-- (Map (V2 Point2) PathEdgeNodes, Gr Point2 PathEdge) +--addEdges nodemap gr = foldl' f (mempty, gr) +-- where +-- f (edgemap, gr') (a, b) = +-- ( M.insert (V2 a b) theedgedata edgemap +-- , insEdge theedgetup gr' +-- ) +-- where +-- theedgetup = (g a, g b, PathEdge a b (dist a b) mempty) +-- theedgedata = PathEdgeNodes (g a) (g b) (PathEdge a b (dist a b) mempty) +-- g a = nodemap M.! a obstructPathsCrossing :: EdgeObstacle -> Point2 -> Point2 -> World -> - (World, Set PathEdgeNodes) -obstructPathsCrossing obstacletype sp' ep w = - ( w & cWorld . pathGraph %~ updateedges - & cWorld . incGraph %~ updateincedges - , es + (World, [(Int,Int)]) +obstructPathsCrossing obstacletype s e w = + ( w & cWorld . incGraph %~ updateincedges + , inces ) where - updateincedge :: V.Vector [(Int,SimpleEdge)] -> (Int,Int) -> V.Vector [(Int,SimpleEdge)] - updateincedge gr (i,j) = gr & ix i . each %~ g j - g j (k,o) | j == k = (k,o & seObstacles . at obstacletype ?~ ()) - | otherwise = (k,o) + updateincedge = flip $ updateEdge (at obstacletype ?~ ()) updateincedges gr = foldl' updateincedge gr inces - inces = filter inedgecrosses $ nearSeg peZoneSize _incEdgeZoning sp' ep w - inedgecrosses (i,j) = isJust $ intersectSegSeg sp' ep (f i) (f j) + inces = filter inedgecrosses $ nearSeg peZoneSize _incEdgeZoning s e w + inedgecrosses (i, j) = isJust $ intersectSegSeg s e (f i) (f j) f i = w ^?! cWorld . incNode . ix i - es = Set.filter edgecrosses $ pesNearSeg sp' ep w - edgecrosses (PathEdgeNodes _ _ pe) = - isJust $ intersectSegSeg sp' ep (_peStart pe) (_peEnd pe) - updateedges gr = foldl' updateedge gr es - updateedge gr (PathEdgeNodes x y pe) = - insEdge (x, y, pe & peObstacles . at obstacletype ?~ ()) $ delEdge (x, y) gr + --es = Set.filter edgecrosses $ pesNearSeg sp ep w +-- edgecrosses (PathEdgeNodes _ _ pe) = +-- isJust $ intersectSegSeg s e (_peStart pe) (_peEnd pe) +-- updateedges gr = foldl' updateedge gr es +-- updateedge gr (PathEdgeNodes x y pe) = +-- insEdge (x, y, pe & peObstacles . at obstacletype ?~ ()) $ delEdge (x, y) gr snapToGrid :: Set (Point2, Point2) -> Set (Point2, Point2) snapToGrid = Set.map (over each (fmap (fromIntegral . f))) diff --git a/src/Dodge/Path/Translate.hs b/src/Dodge/Path/Translate.hs index 1a6b07e70..da6fc0c0a 100644 --- a/src/Dodge/Path/Translate.hs +++ b/src/Dodge/Path/Translate.hs @@ -2,6 +2,6 @@ module Dodge.Path.Translate where import Dodge.Data.PathGraph -fromEdgeTuple :: (Int, Int, PathEdge) -> PathEdgeNodes -{-# INLINE fromEdgeTuple #-} -fromEdgeTuple (a, b, pe) = PathEdgeNodes a b pe +--fromEdgeTuple :: (Int, Int, PathEdge) -> PathEdgeNodes +--{-# INLINE fromEdgeTuple #-} +--fromEdgeTuple (a, b, pe) = PathEdgeNodes a b pe diff --git a/src/Dodge/Placement/PlaceSpot/Block.hs b/src/Dodge/Placement/PlaceSpot/Block.hs index ebe486395..fd9625c46 100644 --- a/src/Dodge/Placement/PlaceSpot/Block.hs +++ b/src/Dodge/Placement/PlaceSpot/Block.hs @@ -4,8 +4,6 @@ module Dodge.Placement.PlaceSpot.Block ( plLineBlock, ) where -import Data.Set (Set) -import qualified Data.Set as Set import Control.Lens import qualified Data.IntSet as IS import Data.List @@ -115,11 +113,11 @@ plLineBlock basePane blwidth a b gw = -- | Must be done after inserting the block insertWalls :: Int -> [Wall] -> World -> World -insertWalls blid wls w = w' & cWorld . lWorld . blocks . ix blid . blObstructs .~ Set.unions paths +insertWalls blid wls w = w' & cWorld . lWorld . blocks . ix blid . blObstructs .~ concat paths where (w', paths) = mapAccumR (flip insertWall) w wls -insertWall :: Wall -> World -> (World, Set PathEdgeNodes) +insertWall :: Wall -> World -> (World, [(Int,Int)]) insertWall wl = uncurry (obstructPathsCrossing BlockObstacle) (_wlLine wl) . (cWorld . lWorld . walls . at (_wlID wl) ?~ wl) diff --git a/src/Dodge/Placement/PlaceSpot/TriggerDoor.hs b/src/Dodge/Placement/PlaceSpot/TriggerDoor.hs index c07036db8..bc56b5f47 100644 --- a/src/Dodge/Placement/PlaceSpot/TriggerDoor.hs +++ b/src/Dodge/Placement/PlaceSpot/TriggerDoor.hs @@ -1,19 +1,15 @@ module Dodge.Placement.PlaceSpot.TriggerDoor ( plDoor, plSlideDoor, - maybeClearDoorPaths, + updateDoorEdges, ) where import Dodge.Data.GenWorld -import Data.Set (Set) -import qualified Data.Graph.Inductive as FGL import qualified Data.IntSet as IS import Data.List -import Dodge.Base import Dodge.Default.Door import Dodge.LevelGen.DoorPane import Dodge.Path -import Dodge.Zoning.Wall import Geometry import qualified IntMapHelp as IM import LensHelp @@ -61,19 +57,20 @@ addDoorWall eo drid wl w (wlid, wlps) = , _wlID = wlid , _wlStructure = DoorPart drid } - & cWorld . lWorld . doors . ix drid . drObstructs <>~ es +-- & cWorld . lWorld . doors . ix drid . drObstructs <>~ es where - (w', es) = uncurry (obstructPathsCrossing eo) wlps w + (w', _) = uncurry (obstructPathsCrossing eo) wlps w -maybeClearDoorPaths :: EdgeObstacle -> Set PathEdgeNodes -> World -> World -maybeClearDoorPaths eo es w = foldl' (maybeClearDoorPath eo) w es +updateDoorEdges :: EdgeObstacle -> [(Int,Int)] -> World -> World +updateDoorEdges eo es w = foldl' (updateDoorEdge eo) w es -maybeClearDoorPath :: EdgeObstacle -> World -> PathEdgeNodes -> World -maybeClearDoorPath eo w (PathEdgeNodes x y pe) - | not . null $ overlapSegWalls (_peStart pe) (_peEnd pe) $ wlsNearSeg (_peStart pe) (_peEnd pe) w = - w & cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles . at eo ?~ ()) . FGL.delEdge (x, y) - | otherwise = - w & cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles . at eo .~ Nothing) . FGL.delEdge (x, y) +updateDoorEdge :: EdgeObstacle -> World -> (Int,Int) -> World +--updateDoorEdge eo w (i,j) = w +updateDoorEdge _ w _ = w +-- | not . null $ overlapSegWalls (_peStart pe) (_peEnd pe) $ wlsNearSeg (_peStart pe) (_peEnd pe) w = +-- w & cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles . at eo ?~ ()) . FGL.delEdge (x, y) +-- | otherwise = +-- w & cWorld . pathGraph %~ FGL.insEdge (x, y, pe & peObstacles . at eo .~ Nothing) . FGL.delEdge (x, y) plSlideDoor :: Door -> diff --git a/src/Dodge/Room/Room.hs b/src/Dodge/Room/Room.hs index 0dd270bda..ebcd2b179 100644 --- a/src/Dodge/Room/Room.hs +++ b/src/Dodge/Room/Room.hs @@ -399,9 +399,9 @@ critsRoom :: Int -> State LayoutVars (Tree Room) critsRoom i = join $ takeOne --- [ return <$> roomCCrits i --- , return <$> critsPillarRoom i - [ return <$> glassSwitchBackCrits i + [ return <$> roomCCrits i + , return <$> critsPillarRoom i + , return <$> glassSwitchBackCrits i ] -- cor <- shuffleLinks corridor diff --git a/src/Dodge/Room/Tutorial.hs b/src/Dodge/Room/Tutorial.hs index deff5b700..efefa6dcc 100644 --- a/src/Dodge/Room/Tutorial.hs +++ b/src/Dodge/Room/Tutorial.hs @@ -43,10 +43,10 @@ tutAnoTree = do foldMTRS [ tToBTree "TutStartRez" . return . cleatOnward <$> tutRezBox , corDoor - , corDoor + , return $ tToBTree "cor" $ return $ cleatOnward corridor , tToBTree "t" . return . cleatOnward <$> slowDoorRoom , corDoor - , corDoor + , return $ tToBTree "cor" $ return $ cleatOnward corridor , tutHub , tutLight , tutDrop diff --git a/src/Dodge/Save.hs b/src/Dodge/Save.hs index 161d0a588..758b8762a 100644 --- a/src/Dodge/Save.hs +++ b/src/Dodge/Save.hs @@ -13,10 +13,10 @@ module Dodge.Save ( import Control.Monad import Data.Maybe import Dodge.WorldLoad -import Dodge.Path.Translate -import Data.Graph.Inductive (labEdges, labNodes) -import Dodge.Zoning.Pathing -import Data.Foldable +--import Dodge.Path.Translate +--import Data.Graph.Inductive (labEdges, labNodes) +--import Dodge.Zoning.Pathing +--import Data.Foldable import Dodge.Wall.Zone import Dodge.Concurrent import Control.Lens @@ -51,14 +51,14 @@ readSaveSlot ss = do return $ \uv -> Just $ uv & uvWorld . cWorld .~ cw & uvWorld %~ initWallZoning - & uvWorld . pnZoning .~ foldl' (flip zonePn) mempty - (labNodes $ path uv) - & uvWorld . peZoning .~ foldl' (flip zonePe) mempty - (map fromEdgeTuple $ labEdges $ path uv) +-- & uvWorld . pnZoning .~ foldl' (flip zonePn) mempty +-- (labNodes $ path uv) +-- & uvWorld . peZoning .~ foldl' (flip zonePe) mempty +-- (map fromEdgeTuple $ labEdges $ path uv) & uvScreenLayers .~ [] & postUniverseLoadSideEffect - where - path uv = uv ^. uvWorld . cWorld . pathGraph +-- where +-- path uv = uv ^. uvWorld . cWorld . pathGraph saveSlotPath :: SaveSlot -> String saveSlotPath (SaveSlotNum i) = "generated/saves/" ++ show i diff --git a/src/Dodge/Zoning/Pathing.hs b/src/Dodge/Zoning/Pathing.hs index 93177040a..2c8e944b8 100644 --- a/src/Dodge/Zoning/Pathing.hs +++ b/src/Dodge/Zoning/Pathing.hs @@ -11,17 +11,17 @@ import Geometry import qualified IntMapHelp as IM import Control.Lens -pnsNearPoint :: Point2 -> World -> [(Int, Point2)] -pnsNearPoint = nearPoint pnZoneSize _pnZoning +--pnsNearPoint :: Point2 -> World -> [(Int, Point2)] +--pnsNearPoint = nearPoint pnZoneSize _pnZoning -pnsNearSeg :: Point2 -> Point2 -> World -> [(Int, Point2)] -pnsNearSeg = nearSeg pnZoneSize _pnZoning +--pnsNearSeg :: Point2 -> Point2 -> World -> [(Int, Point2)] +--pnsNearSeg = nearSeg pnZoneSize _pnZoning -pnsNearRect :: Point2 -> Point2 -> World -> [(Int, Point2)] -pnsNearRect = nearRect pnZoneSize _pnZoning +--pnsNearRect :: Point2 -> Point2 -> World -> [(Int, Point2)] +--pnsNearRect = nearRect pnZoneSize _pnZoning -pnsNearCirc :: Point2 -> Float -> World -> [(Int, Point2)] -pnsNearCirc p r = pnsNearRect (p +.+ V2 r r) (p -.- V2 r r) +--pnsNearCirc :: Point2 -> Float -> World -> [(Int, Point2)] +--pnsNearCirc p r = pnsNearRect (p +.+ V2 r r) (p -.- V2 r r) pnZoneSize :: Float pnZoneSize = 50 @@ -32,19 +32,19 @@ zoneOfPn = zoneOfPoint pnZoneSize . snd zonePn :: (Int, Point2) -> IM.IntMap (IM.IntMap [(Int, Point2)]) -> IM.IntMap (IM.IntMap [(Int, Point2)]) zonePn pn = zoneMonoid (zoneOfPn pn) [pn] -pesNearPoint :: Point2 -> World -> Set PathEdgeNodes -pesNearPoint = nearPoint peZoneSize _peZoning +--pesNearPoint :: Point2 -> World -> Set PathEdgeNodes +--pesNearPoint = nearPoint peZoneSize _peZoning --pesNearPoint p w = zoneExtract (zoneOfPoint peZoneSize p) (w ^. cWorld . lWorld . peZoning) -pesNearSeg :: Point2 -> Point2 -> World -> Set PathEdgeNodes -pesNearSeg = nearSeg peZoneSize _peZoning +--pesNearSeg :: Point2 -> Point2 -> World -> Set PathEdgeNodes +--pesNearSeg = nearSeg peZoneSize _peZoning -pesNearRect :: Point2 -> Point2 -> World -> Set PathEdgeNodes -pesNearRect = nearRect peZoneSize _peZoning +--pesNearRect :: Point2 -> Point2 -> World -> Set PathEdgeNodes +--pesNearRect = nearRect peZoneSize _peZoning -pesNearCirc :: Point2 -> Float -> World -> Set PathEdgeNodes -pesNearCirc p r = pesNearRect (p +.+ V2 r r) (p -.- V2 r r) +--pesNearCirc :: Point2 -> Float -> World -> Set PathEdgeNodes +--pesNearCirc p r = pesNearRect (p +.+ V2 r r) (p -.- V2 r r) peZoneSize :: Float peZoneSize = 50 @@ -52,16 +52,16 @@ peZoneSize = 50 zoneOfIncPe :: UV.Vector Point2 -> (Int,Int) -> [Int2] zoneOfIncPe m (i,j) = zoneOfSeg peZoneSize (m ^?! ix i) (m ^?! ix j) -zoneOfPe :: PathEdgeNodes -> [Int2] -zoneOfPe (PathEdgeNodes _ _ pe) = zoneOfSeg peZoneSize (_peStart pe) (_peEnd pe) +--zoneOfPe :: PathEdgeNodes -> [Int2] +--zoneOfPe (PathEdgeNodes _ _ pe) = zoneOfSeg peZoneSize (_peStart pe) (_peEnd pe) -zonePe :: - PathEdgeNodes -> - IM.IntMap (IM.IntMap (Set PathEdgeNodes)) -> - IM.IntMap (IM.IntMap (Set PathEdgeNodes)) -zonePe pe im = foldl' f im (zoneOfPe pe) - where - f im' i2 = zoneMonoid i2 (Set.singleton pe) im' +--zonePe :: +-- PathEdgeNodes -> +-- IM.IntMap (IM.IntMap (Set PathEdgeNodes)) -> +-- IM.IntMap (IM.IntMap (Set PathEdgeNodes)) +--zonePe pe im = foldl' f im (zoneOfPe pe) +-- where +-- f im' i2 = zoneMonoid i2 (Set.singleton pe) im' zoneIncPe :: UV.Vector Point2 -> (Int,Int) -> diff --git a/tags b/tags index 115454370..f41b8d496 100644 --- a/tags +++ b/tags @@ -130,7 +130,7 @@ BlNegate src/Dodge/Data/BlBl.hs 10;" C BlSh src/Dodge/Data/Block.hs 43;" t BlShConst src/Dodge/Data/Block.hs 45;" C BlShMempty src/Dodge/Data/Block.hs 44;" C -Block src/Dodge/Data/Block.hs 21;" t +Block src/Dodge/Data/Block.hs 20;" t BlockDebris src/Dodge/Data/Prop.hs 44;" C BlockDegradeSound src/Dodge/Data/SoundOrigin.hs 30;" C BlockDraw src/Dodge/Data/Block.hs 36;" t @@ -350,15 +350,15 @@ DoNotMoveEquipment src/Dodge/Data/RightButtonOptions.hs 18;" C DoReplicate src/Dodge/Data/ActionPlan.hs 106;" C DoReplicatePartial src/Dodge/Data/ActionPlan.hs 110;" C DockingBaySS src/Dodge/Data/Scenario.hs 92;" C -Door src/Dodge/Data/Door.hs 30;" t -DoorClosed src/Dodge/Data/Door.hs 21;" C -DoorHalfway src/Dodge/Data/Door.hs 21;" C -DoorInt src/Dodge/Data/Door.hs 21;" C +Door src/Dodge/Data/Door.hs 29;" t +DoorClosed src/Dodge/Data/Door.hs 20;" C +DoorHalfway src/Dodge/Data/Door.hs 20;" C +DoorInt src/Dodge/Data/Door.hs 20;" C DoorMechanism src/Dodge/Data/WorldEffect.hs 69;" C DoorObstacle src/Dodge/Data/PathGraph.hs 50;" C -DoorOpen src/Dodge/Data/Door.hs 21;" C +DoorOpen src/Dodge/Data/Door.hs 20;" C DoorPart src/Dodge/Data/Wall/Structure.hs 12;" C -DoorStatus src/Dodge/Data/Door.hs 21;" t +DoorStatus src/Dodge/Data/Door.hs 20;" t DoubleRes src/Dodge/Data/Config.hs 98;" C DoubleTreeNodeType src/Dodge/Data/DoubleTree.hs 14;" t DrWdId src/Dodge/Data/WorldEffect.hs 66;" C @@ -866,7 +866,7 @@ NorthEast8 src/Dodge/Data/CardinalPoint.hs 21;" C NorthWest src/Dodge/Data/CardinalPoint.hs 16;" C NorthWest8 src/Dodge/Data/CardinalPoint.hs 27;" C NotLink src/Dodge/Data/Room.hs 69;" C -NotPushed src/Dodge/Data/Door.hs 27;" C +NotPushed src/Dodge/Data/Door.hs 26;" C Nothing' src/MaybeHelp.hs 11;" C NothingID src/Dodge/Data/CrWlID.hs 10;" C NozzleAngle src/Dodge/Data/Item/Params.hs 16;" C @@ -1046,9 +1046,9 @@ PulseBallSF src/Dodge/Data/ComposedItem.hs 44;" C PulseLaser src/Dodge/Data/PulseLaser.hs 11;" t PulseLaserSF src/Dodge/Data/ComposedItem.hs 41;" C PulseStatus src/Dodge/Data/Creature/Misc.hs 52;" C -PushSource src/Dodge/Data/Door.hs 24;" t -PushedBy src/Dodge/Data/Door.hs 26;" C -PushesItself src/Dodge/Data/Door.hs 25;" C +PushSource src/Dodge/Data/Door.hs 23;" t +PushedBy src/Dodge/Data/Door.hs 25;" C +PushesItself src/Dodge/Data/Door.hs 24;" C PutBlock src/Dodge/Data/GenWorld.hs 45;" C PutButton src/Dodge/Data/GenWorld.hs 41;" C PutChasm src/Dodge/Data/GenWorld.hs 63;" C @@ -1547,17 +1547,17 @@ _bdMaxY src/Dodge/Data/Bounds.hs 14;" f _bdMinX src/Dodge/Data/Bounds.hs 11;" f _bdMinY src/Dodge/Data/Bounds.hs 13;" f _beamCombine src/Dodge/Data/Beam.hs 46;" f -_blDir src/Dodge/Data/Block.hs 28;" f -_blDraw src/Dodge/Data/Block.hs 31;" f -_blFootprint src/Dodge/Data/Block.hs 26;" f -_blHP src/Dodge/Data/Block.hs 24;" f -_blHeight src/Dodge/Data/Block.hs 29;" f -_blID src/Dodge/Data/Block.hs 22;" f -_blMaterial src/Dodge/Data/Block.hs 30;" f +_blDir src/Dodge/Data/Block.hs 27;" f +_blDraw src/Dodge/Data/Block.hs 30;" f +_blFootprint src/Dodge/Data/Block.hs 25;" f +_blHP src/Dodge/Data/Block.hs 23;" f +_blHeight src/Dodge/Data/Block.hs 28;" f +_blID src/Dodge/Data/Block.hs 21;" f +_blMaterial src/Dodge/Data/Block.hs 29;" f _blObstructs src/Dodge/Data/Block.hs 32;" f -_blPos src/Dodge/Data/Block.hs 27;" f -_blShadows src/Dodge/Data/Block.hs 25;" f -_blWallIDs src/Dodge/Data/Block.hs 23;" f +_blPos src/Dodge/Data/Block.hs 26;" f +_blShadows src/Dodge/Data/Block.hs 24;" f +_blWallIDs src/Dodge/Data/Block.hs 22;" f _blocks src/Dodge/Data/LWorld.hs 123;" f _bloomBlurShader src/Data/Preload/Render.hs 21;" f _bmColor src/Dodge/Data/Beam.hs 21;" f @@ -1766,22 +1766,21 @@ _doReplicateAction src/Dodge/Data/ActionPlan.hs 113;" f _doReplicateTimes src/Dodge/Data/ActionPlan.hs 107;" f _doReplicateTimes src/Dodge/Data/ActionPlan.hs 112;" f _doors src/Dodge/Data/LWorld.hs 118;" f -_drClosePos src/Dodge/Data/Door.hs 38;" f -_drDeath src/Dodge/Data/Door.hs 40;" f -_drHP src/Dodge/Data/Door.hs 39;" f -_drID src/Dodge/Data/Door.hs 31;" f -_drMech src/Dodge/Data/Door.hs 35;" f -_drMounts src/Dodge/Data/Door.hs 44;" f -_drObstacleType src/Dodge/Data/Door.hs 46;" f -_drObstructs src/Dodge/Data/Door.hs 45;" f -_drOpenPos src/Dodge/Data/Door.hs 37;" f -_drPos src/Dodge/Data/Door.hs 36;" f -_drPushedBy src/Dodge/Data/Door.hs 42;" f -_drPushes src/Dodge/Data/Door.hs 43;" f -_drSpeed src/Dodge/Data/Door.hs 41;" f -_drStatus src/Dodge/Data/Door.hs 33;" f -_drTrigger src/Dodge/Data/Door.hs 34;" f -_drWallIDs src/Dodge/Data/Door.hs 32;" f +_drClosePos src/Dodge/Data/Door.hs 37;" f +_drDeath src/Dodge/Data/Door.hs 39;" f +_drHP src/Dodge/Data/Door.hs 38;" f +_drID src/Dodge/Data/Door.hs 30;" f +_drMech src/Dodge/Data/Door.hs 34;" f +_drMounts src/Dodge/Data/Door.hs 43;" f +_drObstacleType src/Dodge/Data/Door.hs 45;" f +_drOpenPos src/Dodge/Data/Door.hs 36;" f +_drPos src/Dodge/Data/Door.hs 35;" f +_drPushedBy src/Dodge/Data/Door.hs 41;" f +_drPushes src/Dodge/Data/Door.hs 42;" f +_drSpeed src/Dodge/Data/Door.hs 40;" f +_drStatus src/Dodge/Data/Door.hs 32;" f +_drTrigger src/Dodge/Data/Door.hs 33;" f +_drWallIDs src/Dodge/Data/Door.hs 31;" f _dsPos src/Dodge/Data/Cloud.hs 28;" f _dsTimer src/Dodge/Data/Cloud.hs 30;" f _dsType src/Dodge/Data/Cloud.hs 31;" f @@ -2530,8 +2529,8 @@ addCrGibs src/Dodge/Prop/Gib.hs 17;" f addDepth src/Picture/Base.hs 133;" f addDoorAtNthLinkToggleTerminal src/Dodge/Room/Warning.hs 40;" f addDoorToggleTerminal src/Dodge/Room/Warning.hs 37;" f -addDoorWall src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 53;" f -addEdges src/Dodge/Path.hs 188;" f +addDoorWall src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 49;" f +addEdges src/Dodge/Path.hs 207;" f addGib4 src/Dodge/Prop/Gib.hs 52;" f addGibAt src/Dodge/Prop/Gib.hs 63;" f addGibAtDir src/Dodge/Prop/Gib.hs 69;" f @@ -2546,7 +2545,7 @@ addGirderNS' src/Dodge/Room/Modify/Girder.hs 55;" f addHighGirder src/Dodge/Room/Modify/Girder.hs 132;" f addHighGirder' src/Dodge/Room/Modify/Girder.hs 142;" f addIndefiniteArticle src/StringHelp.hs 17;" f -addNodes src/Dodge/Path.hs 181;" f +addNodes src/Dodge/Path.hs 200;" f addPane src/Dodge/Placement/PlaceSpot.hs 183;" f addPlmnt src/Dodge/LevelGen/PlacementHelper.hs 87;" f addPointPolygon src/Geometry/Polygon.hs 134;" f @@ -2702,7 +2701,7 @@ battery src/Dodge/Item/Ammo.hs 63;" f batteryPack src/Dodge/Item/Equipment.hs 46;" f belowNumX src/Dodge/Combine/Graph.hs 86;" f beltMag src/Dodge/Item/Ammo.hs 39;" f -bfsNodePoints src/Dodge/Path.hs 102;" f +bfsNodePoints src/Dodge/Path.hs 115;" f bfsThenReturn src/Dodge/Creature/ReaderUpdate.hs 225;" f bgateCalc src/Dodge/Inventory/SelectionList.hs 118;" f bgunSound src/Dodge/HeldUse.hs 514;" f @@ -3162,7 +3161,7 @@ deleteWallIDs src/Dodge/Wall/Delete.hs 28;" f denormalEdges src/Polyhedra.hs 136;" f destroyAllInvItems src/Dodge/Inventory.hs 53;" f destroyBlock src/Dodge/Block.hs 52;" f -destroyDoor src/Dodge/Block.hs 80;" f +destroyDoor src/Dodge/Block.hs 86;" f destroyInvItem src/Dodge/Inventory.hs 40;" f destroyItem src/Dodge/Inventory.hs 62;" f destroyLS src/Dodge/LightSource.hs 32;" f @@ -3170,8 +3169,8 @@ destroyLSFlashAt src/Dodge/LightSource.hs 42;" f destroyMachine src/Dodge/Machine/Destroy.hs 13;" f destroyMatS src/Dodge/Material/Sound.hs 7;" f destroyMcType src/Dodge/Machine/Destroy.hs 22;" f -destroyMount src/Dodge/Block.hs 100;" f -destroyMounts src/Dodge/Block.hs 97;" f +destroyMount src/Dodge/Block.hs 106;" f +destroyMounts src/Dodge/Block.hs 103;" f destroyProjectile src/Dodge/Projectile/Update.hs 108;" f detV src/Geometry/Vector.hs 94;" f detector src/Dodge/Item/Held/Utility.hs 27;" f @@ -3319,7 +3318,6 @@ drawCursorByTerminalStatus src/Dodge/Render/Picture.hs 139;" f drawDDATest src/Dodge/Debug/Picture.hs 312;" f drawDamSensor src/Dodge/Machine/Draw.hs 27;" f drawDebug src/Dodge/Debug.hs 173;" f -drawDoorPaths src/Dodge/Debug/Picture.hs 261;" f drawDoubleLampCover src/Dodge/Prop/Draw.hs 95;" f drawDrag src/Dodge/Render/Picture.hs 200;" f drawDragDrop src/Dodge/Render/Picture.hs 229;" f @@ -3628,6 +3626,7 @@ getCrsFromRooms src/Dodge/Room/Tutorial.hs 329;" f getCrsFromRooms' src/Dodge/Room/Tutorial.hs 316;" f getDebugMouseOver src/Dodge/Update.hs 376;" f getDistortions src/Dodge/Render.hs 435;" f +getEdgesCrossing src/Dodge/Path.hs 43;" f getGrenadeHitEffect src/Dodge/HeldUse.hs 1264;" f getInventoryPath src/Dodge/Inventory/Path.hs 9;" f getItemValue src/Dodge/Inventory/SelectionList.hs 147;" f @@ -3637,7 +3636,7 @@ getLaserPhaseV src/Dodge/HeldUse.hs 701;" f getLinksOfType src/Dodge/RoomLink.hs 41;" f getMaxLinesTM src/Dodge/Terminal/Type.hs 6;" f getMenuMouseContext src/Dodge/Update.hs 388;" f -getNodePos src/Dodge/Path.hs 38;" f +getNodePos src/Dodge/Path.hs 40;" f getPJStabiliser src/Dodge/HeldUse.hs 1251;" f getPretty src/AesonHelp.hs 8;" f getPromptTM src/Dodge/Terminal/Type.hs 3;" f @@ -3790,9 +3789,9 @@ insertNewKey src/IntMapHelp.hs 64;" f insertOneS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 514;" f insertOver src/ListHelp.hs 47;" f insertS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 446;" f -insertWall src/Dodge/Placement/PlaceSpot/Block.hs 122;" f +insertWall src/Dodge/Placement/PlaceSpot/Block.hs 120;" f insertWallInZones src/Dodge/Wall/Zone.hs 20;" f -insertWalls src/Dodge/Placement/PlaceSpot/Block.hs 117;" f +insertWalls src/Dodge/Placement/PlaceSpot/Block.hs 115;" f insertWithNewKeys src/IntMapHelp.hs 70;" f intAnno src/Dodge/Floor.hs 111;" f interactWithCloseObj src/Dodge/SelectedClose.hs 9;" f @@ -4117,9 +4116,9 @@ makeIntInterval src/Dodge/Zoning/Base.hs 35;" f makeMovingEB src/Dodge/EnergyBall.hs 60;" f makeMuzzleFlare src/Dodge/HeldUse.hs 656;" f makeParagraph src/Justify.hs 6;" f -makePathBetween src/Dodge/Path.hs 63;" f -makePathBetweenPs src/Dodge/Path.hs 99;" f -makePathUsing src/Dodge/Path.hs 47;" f +makePathBetween src/Dodge/Path.hs 76;" f +makePathBetweenPs src/Dodge/Path.hs 112;" f +makePathUsing src/Dodge/Path.hs 60;" f makePoisonExplosionAt src/Dodge/WorldEvent/Explosion.hs 25;" f makeRect src/Grid.hs 82;" f makeSelectionListPictures src/Dodge/Render/List.hs 66;" f @@ -4149,8 +4148,6 @@ maxInvSlots src/Dodge/Inventory/CheckSlots.hs 30;" f maxShowX src/Dodge/Combine/Graph.hs 50;" f maxViewDistance src/Dodge/Viewpoints.hs 26;" f maybeBlockedPassage src/Dodge/Room/RezBox.hs 80;" f -maybeClearDoorPath src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 71;" f -maybeClearDoorPaths src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 68;" f maybeClearPath src/Dodge/Block.hs 72;" f maybeClearPaths src/Dodge/Block.hs 69;" f maybeDestroyBlock src/Dodge/Wall/Damage.hs 32;" f @@ -4323,7 +4320,7 @@ numShads src/Picture/Data.hs 40;" f numSubElements src/Shader/Parameters.hs 39;" f numTraversable src/TreeHelp.hs 184;" f obstacleColor src/Dodge/Debug/Picture.hs 271;" f -obstructPathsCrossing src/Dodge/Path.hs 204;" f +obstructPathsCrossing src/Dodge/Path.hs 223;" f oldMachineBootS src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 698;" f onEquipWristShield src/Dodge/Equipment.hs 37;" f onRemoveWristShield src/Dodge/Equipment.hs 24;" f @@ -4371,8 +4368,8 @@ p src/ShortShow.hs 48;" f pContID src/Dodge/LevelGen/PlacementHelper.hs 15;" f pairInPolys src/Dodge/Room/Path.hs 45;" f pairPolyPointsIntersect src/Geometry/ConvexPoly.hs 68;" f -pairsToGraph src/Dodge/Path.hs 174;" f -pairsToIncGraph src/Dodge/Path.hs 158;" f +pairsToGraph src/Dodge/Path.hs 193;" f +pairsToIncGraph src/Dodge/Path.hs 171;" f pairsToIncidence src/Dodge/Graph.hs 20;" f pairsToSCC src/Dodge/Graph.hs 32;" f paletteToColor src/Color.hs 58;" f @@ -4380,8 +4377,7 @@ parseItem src/Dodge/Debug/Terminal.hs 62;" f parseNum src/Dodge/Debug/Terminal.hs 77;" f passthroughLockKeyLists src/Dodge/Floor.hs 120;" f pathConnected src/Dodge/Room/CheckConsistency.hs 13;" f -pathEdgeObstructed src/Dodge/Path.hs 72;" f -pathEdgeObstructed' src/Dodge/Path.hs 66;" f +pathEdgeObstructed src/Dodge/Path.hs 85;" f pauseAndFloatCam src/Dodge/Camera.hs 10;" f pauseGame src/Dodge/Update/Input/InGame.hs 525;" f pauseMenu src/Dodge/Menu.hs 59;" f @@ -4419,9 +4415,9 @@ pipe src/Dodge/Item/Craftable.hs 32;" f pistol src/Dodge/Item/Held/Stick.hs 40;" f pistolerRoom src/Dodge/Room/Room.hs 330;" f pjRemoteSetDirection src/Dodge/Projectile/Update.hs 172;" f -plBlock src/Dodge/Placement/PlaceSpot/Block.hs 18;" f -plDoor src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 22;" f -plLineBlock src/Dodge/Placement/PlaceSpot/Block.hs 50;" f +plBlock src/Dodge/Placement/PlaceSpot/Block.hs 16;" f +plDoor src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 18;" f +plLineBlock src/Dodge/Placement/PlaceSpot/Block.hs 48;" f plMachine src/Dodge/Placement/PlaceSpot.hs 204;" f plMachine' src/Dodge/Placement/PlaceSpot.hs 248;" f plNew src/Dodge/Base/NewID.hs 19;" f @@ -4429,7 +4425,7 @@ plNewID src/Dodge/Base/NewID.hs 7;" f plNewUpID src/Dodge/Base/NewID.hs 13;" f plNewUsing src/Dodge/Base/NewID.hs 27;" f plRRpt src/Dodge/LevelGen/PlacementHelper.hs 33;" f -plSlideDoor src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 78;" f +plSlideDoor src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 75;" f plTurret src/Dodge/Placement/PlaceSpot.hs 217;" f placeChasm src/Dodge/Placement/PlaceSpot.hs 159;" f placeMachineWalls src/Dodge/Placement/PlaceSpot.hs 262;" f @@ -4467,7 +4463,7 @@ pointInOrOnPolygon src/Geometry/Polygon.hs 78;" f pointInPoly src/Geometry/Polygon.hs 86;" f pointIsInCone src/Geometry.hs 375;" f pointIsOnScreen src/Dodge/Base/Window.hs 59;" f -pointTowardsImpulse src/Dodge/Path.hs 107;" f +pointTowardsImpulse src/Dodge/Path.hs 120;" f pointerToItem src/Dodge/Item/Location.hs 39;" f pointerToItemID src/Dodge/Item/Location.hs 42;" f pointerYourRootItem src/Dodge/Item/Location.hs 33;" f @@ -5042,11 +5038,11 @@ smallGlass3S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 518;" f smallGlass4S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 466;" f smallPillar src/Dodge/Room/Pillar.hs 37;" f smallRoom src/Dodge/Room/RunPast.hs 31;" f -smallSnailInt2 src/Dodge/Path.hs 93;" f +smallSnailInt2 src/Dodge/Path.hs 106;" f smg src/Dodge/Item/Held/Stick.hs 58;" f smokeReducer src/Dodge/Item/Scope.hs 162;" f -snailAround src/Dodge/Path.hs 90;" f -snapToGrid src/Dodge/Path.hs 231;" f +snailAround src/Dodge/Path.hs 103;" f +snapToGrid src/Dodge/Path.hs 246;" f sndV2 src/Geometry/Data.hs 73;" f sniperRifle src/Dodge/Item/Held/Rod.hs 44;" f someCrits src/Dodge/LockAndKey.hs 120;" f @@ -5139,7 +5135,7 @@ stone4S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 484;" f stone5S src/Dodge/SoundLogic/ExternallyGeneratedSounds.hs 626;" f stopAllSounds src/Sound.hs 125;" f stopBulletAt src/Dodge/Bullet.hs 199;" f -stopPushing src/Dodge/Block.hs 105;" f +stopPushing src/Dodge/Block.hs 111;" f stopSoundFrom src/Dodge/SoundLogic.hs 220;" f strFromEquipment src/Dodge/Creature/Statistics.hs 53;" f strFromHeldItem src/Dodge/Creature/Statistics.hs 67;" f @@ -5421,8 +5417,11 @@ updateDisplaySections src/Dodge/DisplayInventory.hs 116;" f updateDistortion src/Dodge/Distortion.hs 5;" f updateDistortions src/Dodge/Update.hs 558;" f updateDoor src/Dodge/Update.hs 310;" f +updateDoorEdge src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 67;" f +updateDoorEdges src/Dodge/Placement/PlaceSpot/TriggerDoor.hs 64;" f updateDust src/Dodge/Update.hs 822;" f updateDusts src/Dodge/Update.hs 672;" f +updateEdge src/Dodge/Path.hs 49;" f updateEnergyBall src/Dodge/EnergyBall.hs 31;" f updateEnergyBalls src/Dodge/Update.hs 660;" f updateEnterRegex src/Dodge/Update/Input/InGame.hs 505;" f @@ -5576,8 +5575,7 @@ vocalizationTest src/Dodge/Creature/Vocalization.hs 42;" f volleyGun src/Dodge/Item/Held/Cane.hs 15;" f volleyGunShape src/Dodge/Item/Draw/SPic.hs 357;" f walkNozzle src/Dodge/HeldUse.hs 809;" f -walkableNodeNear src/Dodge/Path.hs 78;" f -walkableNodeNear' src/Dodge/Path.hs 84;" f +walkableNodeNear src/Dodge/Path.hs 91;" f wallBlips src/Dodge/RadarSweep.hs 99;" f wallBuffer src/Dodge/WallCreatureCollisions.hs 53;" f wallIsZeroLength src/Dodge/LevelGen/StaticWalls.hs 179;" f