Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Niseg

Pages: 1 2 [3] 4 5 ... 10
31
DF Dwarf Mode Discussion / Re: So many prisoners (Spoilers here)
« on: May 04, 2011, 09:37:12 am »
I used to use them as target practice... but i got lazy - I throw them into an 8~ z level pit - it does the trick. I also use that pit to take care of the growing cat population. I got an atom smasher at the bottom to take care of the remains and miasma.

32
DF Dwarf Mode Discussion / Re: 16x16 Maps
« on: May 04, 2011, 08:06:29 am »
350 GHz don't mean anything on their own. Is it actually usable?
Not really . The fact that it's possible doesn't mean it's economically feasible for mass production. If I remember correctly it was a fairly simple processor.


Anyways as I said what need to be done is reduce the complexity of some algorithms - that will make the game run fine on any size embark. 

Embark size affects the possible number of nodes in your graph .It's about 230,400 per embark square. a 16X16 embark has 59~ million possible nodes . more nodes = more number crunching and much more complicated path finding.  other than that you'll have more veins ,more plants and more and more structures and creatures . This means more stuff in the data structures you have to go through.

More is not always a problem . If you approach it using a classic "divide and conquer approach" you can get some huge improvements . My simulator only does pathfinding on 32X32 maze. In one of my examples I managed to reduce a 110 step long path's  complexity from 2 million iterations that it does with a simple A*  to 11520 iterations  using the "same" A* (added some constraints)  but just finding 13 +1 subpaths length 8~ . I believe the gains on a larger map would be much  greater. I can upscale my simulator to upto 256X256 easily and I believe that with a similar complexity with a longer path.

This is how my path looks like(S= start, D=dest ,*= path, O are room access points):
Spoiler (click to show/hide)
the A* path looks like this and the runtime is significantly longer.
Spoiler (click to show/hide)

Saving paths between rooms also gives good performance but even without that path caching scheme the run times are similar. The path caching algorithms  ( I got a placed waypoint example in there ) also need a path smoother( I got a function that does that fairly fast) to get an optimal path .The non cacher you see above doesn't really need smoothing . It's only off by about 4 nodes from the optimal path and I didn't finish optimizing room shapes and adding the update scheme ( a critical part for this implementation).

So can DF run smoothly in a 16X16 embark? currently no, theoretically yes. Processing power is not the only factor at the moment . You have to take  power consumption into account too  because mobile computing is very common these days and so are computers with less computing power and memory.

33
DF Dwarf Mode Discussion / Re: 16x16 Maps
« on: May 04, 2011, 04:19:33 am »
Multi-core discussion again  ::) . I don't think it should be considered unless you do a GPU offloading (300+cores). And if you want a fast CPU a Ga-As processor can reach about 50GHz and a Si-Ge processor was made recently which ran at 350GHz on air and 500GHz on liquid nitrogen.

If path finding is the problem that causes the degradation of  FPS  my room system (the no cache button) can fix it easily. Theoretically you can run a 16X16 embark with same FPS as 1X1 with a room based pathfinding but... there are other things like flows and temperatures - I don't know how they work...

The best way to improve performance is to improve algorithms but because we aren't in control of that just get the fastest cpu (single core performance) and overclock it. (2500k/2600k are the winners today).

34
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: May 02, 2011, 01:31:12 pm »
I added a new search mode to a_star.js - searching in rooms (I may improve it to search for the next room instead of just a destination). This mode doesn't add nodes to the open list if they are not in the starting room or destination room . It only made it twice as fast in term of complexity. I also calculate complexity a little better by incrementing a counters on most loops (except the ones that adds neighbors) . It doesn't display it on any of the path caching algorithms but I'll add that later.

if you try my example. You'll get about 2.1 million for A* and 11502  for my newer no cache algorithm. A* is about 180 times more complex than my algorithm. When you consider the fact it makes a 13+1 subpathes the load spread out well with about 850~ iterations per search (my path smoother takes about 500 if you want to compare). The cache performance should also be much better than finding a huge path.

I'm thinking about optimizing the open set queue in A* so they insert stuff in order - it's about  log(n) insertion and O(1) (the best node is always in element 0). This should improve A* performance by a lot because it generally spends more time searching its queues than anything else . I might want to turn the closed set into another data structure like a hash table. Those improvement may help both algorithm run faster but it wouldn't affect the  potential memory thrashing of calculating many  extremely long paths.


35
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: May 01, 2011, 10:17:46 am »
Well, its true you don't have to totally regenerate with any system. When someone digs out a room you just add to the nodes/mesh either way and optimizing it during spare cpu time.

What sucks (for any method)is when someone locks a door, currently you can feel DF hang for a second recalculating its pathfinding data.
I don't think it would hang for a second. With a non-caching method all you need to keep track of is weather a "room" is accessible or not. You should also consider the fact that the UI and user are significantly  slower than the back-end and CPU.  When you make a change you might want to go through  path validation but that's pretty quick on room paths(no guesswork either),  or let everyone hit the wall(like they do now.

 I think A* should be modified farther for this mode - it should consider the room shape and it's destination - it should consider nodes in other rooms to be blocked.  I can do that currently by quitting prematurely when it  start considering nodes that are significantly away from the target (it go to the closest ones first). It's too general and costly to do it this way.

Either way, your method will work and it is going in the right direction now. With a mesh or nodes, you're actually working with a proper graph now and this is where things actually improve. Feel free to burn as much cpu building/maintining your graph, in the end it is cheaper than traversing a suboptimal one.

It's not a matter of "proper" or not the current map is fine as a graph the problem is that it's really big and  too complicated. I've read in a book google scaned that they don't recommend using pure A* on "boards" larger than 60X60. What DF has in a 4X4 embark is a graph 192X192X100  ::)  or 3.7~ million nodes .  I'm not sure how Toady implemented his A* but if there is a dead end and you can  access to 1/10 of those nodes you are pushing 370000 nodes into a queue before you figure out it's a dead end.

The overlaying map model just leads A* to the right direction this way it doesn't get overly confused and kill your CPU. It also divide the A* of  a long path to many small A*s for short paths which spreads the load a little.

36
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: May 01, 2011, 07:59:02 am »
Creating nodes(waypoints) over 2d space is pretty trivial, but you have to do it in 3d space.
doing this in 3d space is trivial it's also not that necessary because you can keep 2d space per level and keep looking per z level . It might be a lot of memory but it's not too bad.  I can convert my simulator to work in 3d but the transitions between Z levels would need a modification to alow it to know if there are "stairs" or something like that in the node.

The no cache algorithm acts as a guide to tell A* where to go .

Once you're done, you might as well be generating vectors. With a mesh you can do things like create monsters that take up more than one tile. Imagine a dragon that can't get in your fort because it is too tall. Imagine siege engines that can shoot downwards.
The width can be handled easily by saving multiple access points and their width. I'm not sure A* can handle width anyways.
Imagine a dwarf grabbing a nearby stone instead of crossing the entire map.
Nearby stone  is simplified by this algorithm because if you need to find a path for each stone you will pay a smaller penalty for unreachable objects.

I brought this up once but you shot it down because it had to be generated and changed each time the map was modified, now that is exactly what you're talking about :P

The fact the my map has to be regenerated with each modification is  because I didn't finish the update scheme yet. It's not that bad.

If I know all the nodes that change I can check each room to see if something changed. I still need to fix my collider so it limits the depth correctly.  be aware that you can still change the maze without updating as long as you don't change the access points. There are many ways to implement an update scheme I"m just starting it.

About meshes .. I can convert my rooms into meshes using some interpolation scheme or something maybe after I split them up( or find the shapes using another way). I'm not sure what benefit would come of this because A* is not that bad when the distances are really small. I should add another monitor to A * which would say how many neighbors were pushed to the queues . this would show you the insanity in super long path A*.

I can also add a traffic zone handling to the no cache room pathing algorithm. It can look at traffic zones when doing sub-paths (it's really trivial).  The update scheme is a more important part of the simulation at the moment and after that's done it would be a pretty good alternative for super long A* paths. The solution I'm presenting is a simple application of the "divide and conquer" approach.

37
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: April 29, 2011, 03:13:09 pm »
I'm happy to inform everyone I just wrote a non path caching 2 layer A* (it's called " advanced  rooms no path cache")  that simplify pathfinding cases to its most trivial cases. Room shapes and handling  need a lot of  work but it's not as important because it works with any shape room. It's also a very simple program. the only complexity in it is A* and it's changes (not that bad either)

In my early example A* finds a  110 length path visiting 813 nodes (it's really lost). My algorithm finds it in 203 this may sound bad compared to path caching but the big difference is that it finds to finding 13+1 paths with an  average length of about 8 steps . The "destination unreachable"  penalty is also really low about 16 node visits ( I got 16 rooms ).

The way it works is simple : it uses BFS collider to find rooms and saves their shape (square + bit vector). The collider also save the first collision point of the path ( I think I need to move it but it's not important) . The info about the destination id now also saves the collision point which means the room know at what coordinate is closest to the other room.
After building all the rooms all it does to get from S to D is find the path between the rooms

S and D exist in and then it pushes S to the output_path. There is a loop that looks for a path from the end of the   output_path to the next room's access point then it concatenate the path to  the output_path but it slice the last element for it.

With this system all a mob need to do is save the overlaying path and then calculate paths as it go from room to room . It's so trivial it runs as fast as the room pather with the caching.

Be aware though - you we have to recreate rooms whenever you change the maze. As I said I'm not updating the room structure when the maze is changed yet. It may still work if you keep access points between rooms.

you can check other examples it should work you may get unusual results because I just save the first access point and doesn't consider others in any way.

EDIT: I'm marking the subpathes now with 'O'
you can see it here

Spoiler (click to show/hide)

38
DF General Discussion / Re: So I got bored and decided to draw this
« on: April 27, 2011, 05:53:17 am »
so dwarf fortress for the ipad
with a streamlined interface, an easy difficulty, and local multiplayer
You forgot microtransactions. For $3 you can ensure that iron will be present on every map. for $5 you can play as the goblins and siege the dwarves!

For $7 you can have elf slave cattle to milk and breed, and use as combat mounts!

Don't forget a few hundreds of $ for an external battery in a backpack.

39
DF Modding / Re: HTML +JS path-finding simulator
« on: April 27, 2011, 05:21:23 am »
Here's an example where the current room algorithm apparently fails to find any path at all, in case that's helpful.
here is a fixed link to that maze . I can't seem to access my old site(I should get a domain name...) and I'm not sure it's updated .

I agree that the room based algorithm needs work. The advanced version is off by a mile.I think i know why that happens - the heuristic for room base search is on the room map which means it doesn't evaluate the distance correctly.

EDIT: I figured it out it's because of the use of path caching from the center of rooms .  I'll add a search that doesn't use path caching ;). I might ad an access point parameter to the edges array and go for those. I'm also considering moving the central points or splitting very large rooms




I  also  another problem with  A* case for rooms  in this maze it doesn't find a path  to the destination because it only look in the "board" while the edges between rooms are not related to their location on the "board".

I'll fix both problems by tommorow. Thanx for the feedback!  :D

One thought on the floor(sqrt(x^2,y^2)), have you considered a lookup table? for the small area you have, and that it's all integer input and result, 1kb (32x32xa byte) of memory might (might, needs testing) be faster than those operations.
Heuristic performance is not a critical part of this simulation due to the fact JS is inherently slow . It might help if I run performance test by telling it to find path x times for example.  What i try to optimize are the node visits which is affected by the distance to the destination and the complexity of the maze(how well it fools A*).

The idea with overlaying room is to reduce both the distances and the edges. It also make a complex maze fairly trivial as you can see on the bottom.

40
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: April 27, 2011, 03:56:11 am »
doh my response got erased  :'( .

anyways I said :

- I looked at some of the files and without optimization like a passible map it would be HFS for the CPU.
-Sorting creatures by start and destination  may help with caching using compare ={return hur(s1,s2) -hur(d1,d2} .stat from center go up x, go up x then go up x+1 , go down x+2 etc.

I also started writing about my progress so I made a new maze .

results a* 542 visits advanced room pathing 23 node visits.
here are times from chrome timeline in java console (just runtimes which are yellow):
a*-max(draw)    room-min(draw)    a*    room    redraw   
13971843740
85191304933
8691313945
96121414230
97111424138
Still that A* function I got isn't optimized and doesn't insert nodes in order.

Edit:
After messing with this maze I found out that my A* needs fixing because it isn't pushing far nodes on my room grid , while it should...  :-\ I should be fixed by tomorrow.

EDIT: FIXED! now I need to add some kind of room spliting and node trading algorithms. someone managed to fool my program to go a silly distance when the destination was around the corner  ;D . I can overcome it by splitting rooms that are way too big and then comes some update scheme ... I can just recreate them a second pass won't be that bad.

41
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: April 26, 2011, 04:17:21 pm »
It's not that bad even with 32 bit per block the weighted A* might cause it some trouble but the use of bit vectors means it should run pretty fast and should fit in cache easily enough.

Anyways I managed to create my first room navigation search based on the BFS-Collider rooms . The way I save the dimensions  isn't optimal(x,y,dx,dy,width,height,mask[8]). I should start node exchange soon.  My search function is fairly stupid it goes through all the rooms(it doesn't have to it can guess pretty well), find the start and end room , build a paths to their central points and then find the path between rooms( I need to fix that heuristic).

I think room pathing should cover anything the update scheme shouldn't be bad. if you dig a square you need to check which box it's in ,update bit vector or expand the box if needed. I guess I'll do it one step at a time  :D.

42
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: April 26, 2011, 12:34:38 pm »
Learning and applying this stuff is a good thing. Sadly, most colleges don't teach up to date programming techniques :/ CPUs today are fast, like REALLY fast but memory isn't very fast. When you get it, you'll understand why it is just as expensive to path up one z-level as it is to path out 16 tiles horizontally. Check out this pdf from Sony for example...

http://research.scee.net/files/presentations/gcapaustralia09/Pitfalls_of_Object_Oriented_Programming_GCAP_09.pdf

It takes a common programming case and improves its performance from 20ms to 3ms with simple reorganization. The case is very similar to a lot of processing DF does :)
Being an embedded programmer I know this kind of stuff. I can tell you a thing or two about udp packet transmission and the  downfalls of classic network stacks  ::) .  I am a big supporter of "link list = caching disaster" . I once improved udp transmission from 200us to 20us  ;D.

This is generally why I look at node accesses  as my benchmark . everytime you go through a node you don't know what kind of disastrous memory fetches you'll get unless the map is a very small bit vector.  just to think that you have to go to check the weights too. Who know what other useless data you are gonna fetch along with it.

This is why a room pather is so great. let assume our map is 192X192 (4X4) with depth 100 . If we choose room size of 16x16 we can divide each Z level into 12X12 rooms .  then instead of traversing a maximum of 3,686,400 nodes you'll traverse 14400 nodes. By saving the "edges" you can also make pathing between them cost nothing. You can also apply a smoothing algorithm and alternate paths . and if that isn't enough you can say those 12X12 rooms are 3X3 regions  then from 14000 you are down to major regions  and pathing inside them is 4X4 then a 16X16 intera-room pathing.You can also make regions cross the boundaries of Z levels.

This can make it possible to embark on 10X10 (provided you got enough memory) with little to no slow down.

on other news ;) I added room highlighting on my BFS-Collider output  ;). Now I know I got well defined rooms I can work with... Soon I'll have room pathing and I'll work on gaps.

43
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: April 26, 2011, 10:14:57 am »
You hit the nail on the head. Before Toady did DF, he was paid money to know math. It is kind of like going up to a race care driver and telling them they could take faster turns if they focused out for their weight distribution, it is kind of pretentious.
I'm not sure what Toady's background  but if someone wants to suggest a better pathfinding  algorithm they better know something in the field of computer science, discrete mathematics etc and be able to offer code or well outlined implementation.

I had no AI or pathfinding background other than having a CS degree and being able to code my way out of a plastic bag.  I found it interesting so I went and learn a little about  the subject.  After trying stuff myself I can make suggestions that work. I've been trying to convert some of the ideas on this thread into code. This also gave me another opportunity to experiment with JS and CSS etc.
Don't get me wrong though, there is nothing wrong with pathfinding improvements. It would be nice if when a dwarf constructed a wall, that it did it from the closest tile instead of always building from one side, it would be nice if it grabbed the stone that was close or on the way, it would be nice if we had multi-tile monsters, etc. Toady isn't sitting around trying to figure out how to do it, he is simply busy working on other things(like hill dwarfs, taverns, and cities!). We will get those things when they get to the top of the enormous list of things left to do.
The issue with dwarfs always building from top can  easily solved with some weighing and heuristics I don't think that it's such a major issue anyways. Just open the circus if you want FPS to drop ;) and there aren't that many clowns in there but they certainly kill fps in their marketing campaign . they got big k and big N to reach their customers and they can reach more nodes than anyone else.


It is also logical that you could improve FPS by improving any piece of code, but premature optimization is a killer waste of time. The truth is, exponential slowdowns in DF are the result of bugs. The most useful thing the user can do is upload saves before and after such slowdowns occur. Furthermore it is difficult sometimes figuring out how to properly write a piece of code when you don't know what it is going to do, DF is a huge work in progress.

For example, let me show you a graphed view of the function that determines what an object is when you look at it.
Spoiler (click to show/hide)

There is so much waste in that I could cut away with a few key strokes, but why bother? Right now it is flexible enough to add all sorts of cool new features and items to the game. The biggest performance gains are not possible to implement until you actually know what you are trying to do.

That looks like a call stack or something - look kinda blurry. I admit I have no Idea what's killing my CPU. If it's the dwarfs looking for items, thiefs looking for stuff to steal or 200 cats looking for who know what. All I know is that more Mobs = less fps which probably translate to pathfinding.  I know that turning off temperatures boosts FPS I haven't checked fluids flow. Maybe its the magma?!

This is why I like path finding optimization approach and you don't really have  to add much . It's a classic divide and conquer approach that every CS major should knows by heart .

My room scheme should offer great improvement and it has another advantage - you can do it over and over again to simplify the map farther.

Unfortunately my current [http://niseg.moshela.com/test_maze.html?maze=v05GAk0YzlSI1LhfmxHFkSulWNLiARSGSQJhJDJIZJAZJDJIZJAZJ9_x-UuNFMZC9HuMTTdIjx4hYifIzEWzFYj39cmIIvOSxJsRWJOjzJiAxKbpUADSixCQIxJEYkhkkBkkMkhkABkkAMhkkA]favorite maze [/url]doesn't show splitting it up too well :

0-1-2 3
|    /|
4 5-6 7
| |   |
8 9-A B
|     |
C-D-E-F


This is basically a strait line
2-1-0-4-8-C-D-E-F-B-7-3-6-5-9-A

If you look at it structurally you can divide it into the center region, the top left-region , the bottom region and top-right region

The problem with A* is that it can't see it as a strait line and it have to hit every wall in the general direction of  the target. If a dwarf wants  to look for an item and it's listed at 63,63 when the dwarf is at 1,1  it usually take 100-300 node traversal to get to the target  but if he know he's in room 0 and the item is in room F it takes 9 . That's only about 10-30 times faster . As the maze get larger and more complicated the gains get bigger and all you need to do is some pre-processing and maintaining the overlaying structure. The memory costs shouldn't be that big (my js program might be a hog but it doesn't have to be).


I do agree that profiling would get us far but I got no clue how to do it on someone else's code on a windows platform.  I am thinking of running some more tests with max fps to see the true effect of pathfinding . I'm not sure what else to concentrate on maybe item search  :-\ .... i'll do that after the path finding project  ;D.

44
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: April 26, 2011, 06:52:23 am »
These pointless threads come up all the time, kind of ignoring the fact that Toady knows math hehe.

I'm almost tempted to write a hack that lets you guys plug your own pathfinders into DF just so you can see how pointless your ideas are... it wouldn't be that hard...

Now *that* would be an interesting mod.
:-\ I don't think I'll take any part of *that* . I'm here to suggest stuff not to "fix" the code through hacks. Controlling the game with external apps is one thing, changing the game  engine is borderline copyright infringement ~ .

I'm not  sure why devek is so resistant to any path-finding related suggestions. He might be right that path finding improvements would be a waste of time because it might not take as many CPU resources as we think. My limited test didn't suggest memory thrashing .

It still seems logical that path finding improvements would lead to FPS improvement because that what all creatures do most of the time. Recently I built the bridged snake access:
Spoiler (click to show/hide)

It seems that after enabaling bridges dwarves still go along the snake. Some of them did repath - it might be related to bumping into each other.

I think that repathing frequency along with the big penalty on blocked paths can cause slow down .I'm not really sure. some people suggest atom smashing helps. Maybe the search through many items isn't optimal. If anyone searching through items check its accessibility using A* it might cause  a huge slowdown when there are many items inaccessible.

This is where the "Room splitting suggestion" can help - help a lot. I'm now in the process of creating one in my simulator . my current scheme of "waypoint rooms" is not always going to find the path because of it's naive  way of selecting rooms (it assumes it's either in the room closest to it or a disconnected  neighbor that of  that room ). This point to a room selection problem and instead of fixing something that sometimes work I advanced to a well defined room scheme which is the natural advancement.

even though waypoint room sometimes don't work when it does it gives great results of about 15 node visits compared to 800 of A*. The blocked path penalty is about 15 node visit compared to the number of accessible nodes of the map (that's about a maximum 1000 in my simulator). Still it only work for special cases and like this . When it's blocked in the corner it does about 700 node visits because I  let it run wild ( high limit on search distance) in attempts to reach the destination .

My new room definition algorithm would make the room selection very deterministic which would save pathing retries and other problems related to the waypoint scheme. After that I'll add a room update scheme and when everything is done I'll switch to 3d . After that I may convert the mechanics into c code or find other ways to grind it for performance testing (JS's has pretty bad performance).

45
DF Suggestions / Re: Improving Pathfinding. (Computer sciency)
« on: April 24, 2011, 04:45:59 am »

one thing i have noticed about the A* approach (and probably most others) is the exponential increase in calculations over greater distance (due to the exponential increase in path options, most of which are redundant and unnecessary)
The complexity is about min((k/2)^N ,Nmax) which means node explosion . A* is also fooled by dead ends . there are a few examples for this

there are two suggestions i have. one would help a lot for pathing in a fortress. by breaking the fortress down into rooms separated by doors, you could simplify the code by using a macroscopic version to calculate what rooms you need to go to, and a microscopic one for pathing through each room. even if it needs to preform the same amount of pathing checks it won't have to do them all at once, only once every time the object enters the room, spreading the lag more evenly. this also means numerous shorter distances instead of one long one minimizing the exponential growth in possibilities ( i know it is better then exponential but the algorithm hates distance. you could even use memory to store the path from one end of the room to the other (though this would have to be compiled and called on when needed because RAM is taxed as it is (i think))
I think that's around page 15-17 or so of this thread.

I did implement an arbitrary room generation with patch caching between them . you'll see it in the picture above your post(it's spoilered to save space). the cyan on gray Rs are the rooms and the path between them is shown in light gray. The path itself is cyan background floors.


here is a condensed version of my code with dest-path part choped (same as spath after reseting variable) but it's still pretty big though what it does is simple.
Spoiler (click to show/hide)

first thing it tries to find a path to the room closest to it but it limits its search to nodes 16 or less away. then if it fails it tries again with longer distance . (the complexity of the second search is much larger than the first). if it still fails it assumes that it's by a wall and the best candidate rooms are the ones not connected to it's closest room. if it fails to find a path to those rooms it gives up.

after it's done with path (xs,ys)->R(wprxs,wprys) it will then find the  path R(wprxd,wpryd) -> (xd,yd) the same way (this part is choped). then it look for a path from start room to end room on the room "maze" which is  a 4X4 size (atm) and if it doesn't find a path - it returns empty path. otherwise it goes and concatenate spath to all the subpaths of the room path (not necessary to save path  - short distance A* is usually pretty fast).

As I said before the begining of the function that got to do with room selection needs a lot of work because waypoint based rooms are just terrible in terms of finding "where you are"  . The last part is pretty simple once you find the connections.

Edit1:

After playing with the code a little I added a BFS  collider  to find edges between rooms - sure it goes through every node in the maze but it finds all the connections between rooms and their shape in one pass . All I need to do now is to add  the info to room data structure , then I'll need  to create a better navigation function then a room update scheme ... lots of work ;). I still need to fix the bfs limits scheme so it know when to update the depth counter correctly .

here is how it looks like - it puts the output at the bottom whenever updating rooms:
Spoiler (click to show/hide)

Pages: 1 2 [3] 4 5 ... 10