The Godot Community Forums are back up and running! Please read the the announcement post for important information on what happened. Thanks!

[Advanced Pathfinding][GridMap] How to know on which cells body is standing?

BozonBozon Posts: 1Member

Hello! pls help.
I want to make RTS with a bit advanced pathfinding. For this, i am dividing map to small cells. So (I think) I need to know on which cells body is standing. Body may have any form (mountain range, wolf, house). And it may stand on few cells.
cannot figure it out. How to scan the map for this, efficiently? I can get only cell of body center.

Comments

  • BozonBozon Posts: 1Member

    I have only one idea right now. Create trigger box for each cell and check for collisions. That will give me what i need, but my field is large (about 2500 - 10000 cells) so it seems like performance will be bad...

  • BozonBozon Posts: 1Member

    i mean Area, trying this..

  • TwistedTwiglegTwistedTwigleg Posts: 3,141Admin

    Maybe a combination of the world_to_map function (documentation) and the get_cell_item function (documentation) would work?

  • BozonBozon Posts: 1Member

    Thanks!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file