xaya / taurion_gsp

Taurion - A Fully Decentralised MMO built for the Xaya Platform.
https://taurion.io
GNU General Public License v3.0
23 stars 10 forks source link

Make path finding independent on vehicle dynamic obstacles #36

Closed domob1812 closed 4 years ago

domob1812 commented 4 years ago

The final obstacle map for movement in Taurion is built up from two parts: The base obstacle layer and dynamic obstacles, which can be buildings and the vehicles of your own faction.

Movement consists of two phases: If a character has only waypoints (because they just started movement or just reached a previous waypoint), then we run path finding to compute the exact steps to the next waypoint. If a character already has such steps, then we just follow them.

Both of these need the obstacle map. But we should change the obstacle map for path finding only to only consist of the base map and buildings, but not vehicles.

This has two advantages:

  1. In the current system, if a character's next waypoint is blocked when path finding happens, then the character will simply stop. That is not necessary if the block is by a vehicle, because that may very well be gone by the time the character reaches the waypoint.

  2. Making the path finding independent of vehicle positions makes it easier to parallelise this heavy computation in the future.

In the end, vehicles would still act as obstacles, because they will be taken into account during the "follow the precomputed path" phase anyway.

domob1812 commented 4 years ago

Discussed and confirmed with @xaya.

domob1812 commented 4 years ago

This obviously also has a strong disadvantage, namely that it may not route around vehicles that are just standing on a fixed position. Thus it may happen that you simply run into them and then stop there, because they will not move out of the way themselves after some blocks. So we need to consider this thoroughly.

domob1812 commented 4 years ago

Due to the issue mentioned above, we won't do this (at least not in the way described).