Page 1 of 1

Denser map for possible creature position

PostPosted: 18 Aug 2015, 18:17
by paul424
As in title, so far for the walking algorithm the smallest atomic area the creature occupy or walks through is one gamemap Tile. How about make it a little denser ? Splitting into 4 or 9 or 16 positions, also the number could be a parameter at compile time.

Re: Denser map for possible creature position

PostPosted: 19 Aug 2015, 09:36
by Akien
Why? Could you explain what would be the benefits, for which feature you would like to have this possibility, what could be the impact on performance for the pathfinding algorithms and creature behaviours?

Please remember that we can't read your mind. hwoarangmy, Bertram and oln are maybe skilled enough to understand the implications of what you describe in two sentences, but I don't, and I guess other non-developers of our community might not either. You don't really give enough elements to start a discussion.

Re: Denser map for possible creature position

PostPosted: 19 Aug 2015, 12:32
by Danimal
i think he wants to add more than 1 tile big creatures that fill several tiles

Re: Denser map for possible creature position

PostPosted: 20 Aug 2015, 20:21
by Bertram
Tom/Paul {l Wrote}:As in title, so far for the walking algorithm the smallest atomic area the creature occupy or walks through is one gamemap Tile. How about make it a little denser ? Splitting into 4 or 9 or 16 positions, also the number could be a parameter at compile time.


Akien {l Wrote}:Why? Could you explain what would be the benefits, for which feature you would like to have this possibility, what could be the impact on performance for the pathfinding algorithms and creature behaviours?


Danimal {l Wrote}:i think he wants to add more than 1 tile big creatures that fill several tiles


Maybe yes, maybe not? Sub-dividing the grid has no benefits I can foresee so far, and won't help with handling big creatures in the end IMO.
Why? Because, you must then think about why you first want to have creature using several tiles at once. To me, it's usually when you want to make creatures block tiles to other creatures, usually with the hope to make them auto-decide of a road next to one another. But in practice, it doesn't suffice to work that way. Because the creatures that are crossing paths need to resync their paths to take one another in account, (and so not decide to both use the left area to cross their path, for instance.)

Sub-dividing the grid will also make the pathfinding slower, and that could be a huge drawback, as there is a lot of pathfinding going on while playing.

At the time, we (and mostly hwoarangmy) revised the pathfinding algorithm, I proposed to make creatures non-blocking and use a random position on a tile as a first pass at it, because it's cheap and in the end, not that bad looking.
The next thing in term of path-finding, IMHO, is rather to add a check when setting a random position on a tile, to make sure the creature doesn't overlap with walls when it's possible.
I'm and always be open for suggestions in this area, of course, but I'm pretty much sure we're close from what should be the end game path algorithm. Thus, I'm against sub-dividing the grid.

Best regards,

Re: Denser map for possible creature position

PostPosted: 24 Aug 2015, 08:03
by hwoarangmy
For my part, the goal with splitting tiles would be to avoid creatures overlapping. But we decided to add a random offset to handle this. IMHO, it is a better solution as long as we do not limit creatures per tile.
Could you explain what you have in mind ? AFAIK, there is no benefit.

Re: Denser map for possible creature position

PostPosted: 24 Aug 2015, 17:31
by paul424
Note : I propose to split the navigiating mesh of creatures, the size of every tile and it's mesh would stay the same. So there are say 9 poistions , where now there is only one -- the center ....

The point is currently the creature walks through the tile centers, which does look bad. This is especially visible in the game map named room galore ( or festival ?) ,
where the creatures trapped in 2x2 rooms walk from one center to another tile center, spending most of the time there. The second reason to make tile net denser is
the behaviour of gnomes( drones ) when digging a wall -- they never come closer to the wall instead they stop at the tile center and wave in the air with their pickaxes.

Re: Denser map for possible creature position

PostPosted: 24 Aug 2015, 18:11
by Akien
Erm... Stop playing a binary from 2014 and try to compile the latest development branch?... ;)

Creatures walk a random path as explained by Bertram and by hwoarangmy, so if you check again "Model's fair" (you were not too far from the name), you'll see that creatures rarely work through the tile centers.
As for the workers, I think it's the same, their position is random; but indeed it's not always close to the wall, this could probably be adjusted with a forced offset (or random offset but close to the wall), no need to densify all tiles in the map just for that...