Denser map for possible creature position

Denser map for possible creature position

Postby paul424 » 18 Aug 2015, 18:17

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.
User avatar
paul424
OD Moderator
 
Posts: 643
Joined: 24 Jan 2012, 13:54

Re: Denser map for possible creature position

Postby Akien » 19 Aug 2015, 09:36

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.
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Re: Denser map for possible creature position

Postby Danimal » 19 Aug 2015, 12:32

i think he wants to add more than 1 tile big creatures that fill several tiles
User avatar
Danimal
OD Moderator
 
Posts: 1317
Joined: 23 Nov 2010, 13:50

Re: Denser map for possible creature position

Postby Bertram » 20 Aug 2015, 20:21

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,
User avatar
Bertram
VT Moderator
 
Posts: 1635
Joined: 09 Nov 2012, 12:26

Re: Denser map for possible creature position

Postby hwoarangmy » 24 Aug 2015, 08:03

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.
hwoarangmy
 
Posts: 567
Joined: 16 Apr 2014, 19:13

Re: Denser map for possible creature position

Postby paul424 » 24 Aug 2015, 17:31

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.
User avatar
paul424
OD Moderator
 
Posts: 643
Joined: 24 Jan 2012, 13:54

Re: Denser map for possible creature position

Postby Akien » 24 Aug 2015, 18:11

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...
User avatar
Akien
 
Posts: 731
Joined: 22 Feb 2014, 13:14

Who is online

Users browsing this forum: No registered users and 1 guest

cron