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 - Sunken

Pages: 1 ... 11 12 [13] 14 15 ... 20
181
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 16, 2009, 02:45:51 am »
In fact I see no reason that the concept of TCV cant be mixed with zones that must be crossed with A*, the high level zone search can be agnostic as to the nature of the zones so long as it can query them for being able to be crossed by various agents.
Right, that's an important point. And this modularity should be maintained while developing, so that new approaches for each layer can be tried out and compared.

182
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 15, 2009, 08:23:31 am »
As for multi-creatures: the way you'd solve it with TCZs is that you make TCZs spanning different movement types (stopped from expanding by other movement types), store interfaces between them as usual, and simply take allowed zones into account when doing the path search - an A* node is not put on the open list if it is incompatible with the agent's movement.

The only extra cost is that you will need a whole new connectivity map for each movement type combination (not just each movement type). However, given that this map runs over zones, not tiles, it should be cheap enough that we can afford it.

And, yeah, fliers. I dunno about those. They're tricky.

Edit: I meant "multi-movement-type creatures" above, not "multi-tile creatures".

183
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 15, 2009, 08:19:58 am »
I was talking about creation, but the incremental changes suffer from the same problem, too. Wouldn't you have to check your addition against all other tiles in the TCZ? Or could you just settle with checking against certain key points, or points close (i.e., local) to the point where you are making the change?
As I already said, you only need to check a tile against the closest other tile in the TCZ that is in conflict with it. You do this by finding conflicting directions, and processing just those tiles that are closer to the seed and in this direction. It is on the order of the size of the TCZ, but with a very small factor on it.

184
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 15, 2009, 05:05:27 am »
The reason I suggested standard convex shapes rather than TCZ in my last post was exactly for the reason that they won't span so many objects and so end up smaller. In this way we can ignore the fact that we get a suboptimal route because it will only be marginally suboptimal and vastly faster to calculate.

Because we don't need to calculate interface point to interface point, other than when we hit a zone and need to move to the next one, we don't have to worry that the interfaces will be larger stretches.
It is indeed a different ball game if you settle on suboptimal paths. I have a feeling that won't work well in practice, because the inefficiency is unbounded in principle - the cost of moving through B from A to C may be 1 and the cost of moving through B from D to E may be 100.
But I can't prove that it's impracticable, it's just a hunch.

If one does go for full accuracy, and plans with interface tiles, then a key issue is whether the zone subdivision "fits" the environment - whether it finds natural choke points and minimizes the sizes of interfaces. That's where I think the flexibility of TCZs are a strong point. They're not the final answer by any means, of course.

185
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 15, 2009, 03:19:09 am »
Three wagons on larger map are framerate killers (along with some ten extra critters.), for me it literally means drop of about 20% in fps anytime they appear.
Are you sure it's mostly the wagons and not the critters?
But anyway, I would guess that not much optimizing has gone into the current wagon navigation system yet. With only small improvements it could probably handle most practical cases. Or so I'd think. Again - tests will tell...

186
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 15, 2009, 03:16:36 am »
I don't think convex will help you as much as you think. It's easy to forget (as I did initially), when thinking about zone decomposition, about the critical importance of the size of the interfaces between the zones. If you do not want to produce paths that are wildly suboptimal, you have to consider not just "move from zone A to zone B" when searching for a path, but "move from zone A to zone B through interface tile x", for each interface tile.

The advantage of TCZs to convexes or rectangles is that they are larger (they will always be at least as large as a convex or a rectangle, since TCZs subsume those concepts). The idea is that they have a greater chance of filling up an entire room, leaving only the doorways or other choke points as interfaces to be considered in the search. A single obstacle in the middle of a room is enough for a convex or rectangular subdivision to split it into several zones, which will have potentially long open-space interfaces, making the branching factor of the search bigger. TCZs are designed to make that less common (though by no means eliminate it!).

Only extensive testing will verify whether this idea actually holds water - especially given the extra cost of creating and maintaining the TCZs (though I'm hoping that will amortize well over time).

187
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 15, 2009, 02:48:40 am »
The problem I'm foreseeing with TCZ as currently envisioned is that their agent size dependent.  A 1x1 agent can go through a forest easily because all the obstacles are 1x1 and it can continually home-in on its destination and just take the diagonals when it runs into an obstacle.  But what about larger agents like wagons, two close trees can form an impenetrable barrier.  Their would need to be a TCZ for each agent size which will probably be prohibitive.
True, I never even thought about multi-tile agents when I thought up the TCZ approach.
But really, won't multi-tile creatures/wagons be rare enough that we could use brute force pathing for them? If a colossus should show up, we just perform a single, specific clearance-based flood fill starting at his current position and then brute A* over this - just like wagons (seem to) work right now?
Remember that the bigger the creature, the fewer its movement options. A four-tile creature can't even move through doors - A* inside a typical fortress should be a reasonably shallow search!

Simply put, I don't really feel multi-tile creatures/wagons are enough of a performance problem in practice to worry about. Especially since there's already a special clearance based system in place.

188
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 15, 2009, 02:41:02 am »
EDIT: Forgot to answer to Sunken earlier (oops). What I meant by local checks is that, if you have a large TCZ, you want to limit your checking to the area near the point you're checking, to avoid exponentiality. So you might decide to check only a 24x24 area around the seed point (or around the newly added point, but that runs into heavy redudancy), for example.

If, despite that, you allow the TCZ to grow much larger than the size you limit the checks to, you open yourself to letting in shapes that don't comply with the silly-move requirement.

...I still don't get it  ??? Checking for what? Are we still talking about incremental changes to the map? Or do you mean the initial TCZ creation? Either way there is no exponentiality involved even if you don't limit the area you process (especially with the simplified incremental update I suggested a post or two ago). Or do you mean some other check?

189
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 14, 2009, 12:58:32 pm »
That's pretty easily taken into account (in principle): only allow a zone to spread along equal traffic cost tiles.

Obviously, this makes for trouble if the traffic zones are changed a lot or are badly shaped (dots spread out in the middle of rooms and so on).
An interface change could help remedy this: If the player can see TCZs when setting traffic zones, he can elect to paint entire TCZ with the same cost, which means no TCZ reshuffling is necessary.

190
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 14, 2009, 10:54:28 am »
I agree that TCZs should be 2D. They are adjacent to zones on other levels at the points where there are stairways, for purposes of path planning.
This leaves fliers basically unaddressed by the approach, sadly. They'll have to be considered specially.

You can have fliers using zones too, all zone needs to store is adjacent zones and in these cases every square would allow you to pass to an adjacent zone (vertically at least). Not the most efficent system but it would work.
You need to store more than adjacent zones in the general case. You can't path plan on the zone level without knowing the costs, and the costs depend on exactly which tiles you're entering and leaving the zone from. The hierarchical clearance-based approach accepted a suboptimality in this respect, but that can get pretty bad for large zones.
I suggest instead storing gateway tiles between TCZs and path planning between these instead. But that solution would be prohibitive for fliers.

Quote
Alternatively you could assume everything above a 'top level' zone is a trivial connection to critters passing through these can move freely, which although means a special case is probably a cleaner solution overall.
That's a possibility, although it's not trivial to carry out in practice.

191
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 14, 2009, 09:16:53 am »
I agree that TCZs should be 2D. They are adjacent to zones on other levels at the points where there are stairways, for purposes of path planning.
This leaves fliers basically unaddressed by the approach, sadly. They'll have to be considered specially.

192
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 14, 2009, 08:33:19 am »
I don't quite understand what you mean by "local checks".

How you'd deal with changing terrain is more or less like this:
When a tile changes, find the TCZ(s) it contacts (use an efficient bounding-box algorithm for quick lookup).
Resume TCZ processing for all neighbors of the changed tile (and itself, if it was cleared) and process from there as before.
Finally, check tiles from which TCZs have withdrawn. If any remain uncovered by a zone, re-seed them until coverage is reestablished.

This will (unmodified) not reclaim space as aggressively as restarting the TCZ from scratch, but that may be just as well - maybe that tile will close up again anyway.

193
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 14, 2009, 05:34:30 am »
Well, what you actually do is check each of the 8 (or so, depending on what silly-move strategy you use) sectors around the tile at a time, and forbid the entire sector wholesale if it comes to that; also, in each sector, you only need check those tiles that are closer to the seed than the current tile is. And that number grows sub-linearly with the size of the TCZ.
So it's not exponential - but even if it were, that wouldn't mean "unacceptable" right off - remember this is a one-time calculation, in principle, and its time complexity is much less important than the cost of pathing itself. Besides, the larger the TCZs, the fewer they are.

Anyway, you can bound the time taken by limiting the maximum size of the TCZ from the start, reducing the "whole world" to just a 30x30 grid or something like that. You wouldn't be able to cover the whole forest then, but hey.

194
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 14, 2009, 04:55:59 am »
Well, I'm not aware of anyone else having implemented it but that may not be because they haven't... I'm very bad at finding related works :)
As for my implementation, it is rather rough around the edges and I'm still working on it.
But basically, the idea is: Start with assuming all the world belongs to the TCZ. Move outwards from the seed tile, and whenever a tile conflicts (that is, it wouldn't be possible to silly-move from it toward some other tile in the TCZ), forbid either it or the other tile, depending on which is closest to the seed. Then backtrack to reprocess any neighbors of newly forbidden tiles.
Keep it up until the whole world has been processed.
That's the gist of it, though there are many obvious simplifications that can be made.

195
DF General Discussion / Re: Anouncing The PathFinder Project
« on: October 14, 2009, 02:39:21 am »
Also, though the hierarchical clearance algorithm linked earlier is interesting, I have a feeling that its practical utility is limited to "outdoor" environments, that is environments where obstacles are few and free space is the rule. I think it will not work so well underground - or at least, the selection of blocks must be made more clever. But I may be missing something in the description.

Pages: 1 ... 11 12 [13] 14 15 ... 20