0
\$\begingroup\$

I'm trying to create a game server. The game I want to create has a following feature.

  • 2d (isometric view)
  • ~300 users can play so a map will be not that small
  • all units can move in any angle (not only 8 directions)
  • all obstacles and buildings will be constructed to fit on tiles (There are many different sizes, but all of them are rectangular in shape.)
  • every user can build/destroy buildings
  • There are vehicles users can ride.

To do pathfinding for different size of units, I found the clearance based pathfinding.
The problem is some vehicles' size are not square. It's like 2*4 size.
So It seems it's hard to use tile-based astar algorithm.

So I thought about using navmesh.
Then the new problem is all users can build some buildings whenever they want if they have enough money. and buildings can be constructed in most regions of the map.
So I have to recalculate a navmesh. (I'm not sure how slow it will be.)

In this case, what kind of approach should I do?

\$\endgroup\$
1
  • \$\begingroup\$ I do path finding by detecting collisions and moving around them; have established a target point. For rotated obects and accuracy, I use "point in polygon"; else rectangle intersection. I just move forward and sidewaye untill I clear the obstacle; or attack it (enemy); or wait for it to "advance" (friend); etc. \$\endgroup\$ Commented Oct 13, 2024 at 3:17

1 Answer 1

0
\$\begingroup\$

Implement gaps say (10 to 1) in the grid system.

You only have to re-calculate the areas around the added building using the additional space to hint the best direction.


Similar concept:

For my tower-defense game, a build in the path triggered an A* search from the highest neighbor(one step towards start) to the goal. The search stops once a value equal to or less than the build square is encountered(or no lower or equal path length is available and the placement is denied ending the process); at that point the entire route distances are recalculated along the path and asynchronously(8 sq per 16 ms step) expanding both from the highest neighbor of the build point and from the path end point. This pattern converges before any new placement is possible.(Timing limits the maximum size of the grid).

\$\endgroup\$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.