Skip to main content
Mod Moved Comments To Chat
added 38 characters in body
Source Link
Philipp
  • 123.2k
  • 28
  • 264
  • 345

My approach would be:

  1. Designate one soldier of the formation "the leader". (this does not necessarily need to be the actual commanding officer of the formation. You can pick any soldier. You will probably get the best results when you pick the soldier closest to the center of the formation, but that might be worth experimenting with)
  2. When the formation moves, calculate a path only for "the leader"
  3. WhenWhile "the leader" moves along the calculated path, have all other soldiers in the formation maintain their relative position to "the leader". This should not require additional route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier should calculate an individual path to its designated position within the formation. In order to regain unit cohesion before arriving at the destination, those separated soldiers should move faster than usual. Or alternatively the leader should notice when they lose a soldier and then slow down until the lost soldier has caught up.

When your game features combat with individual soldiers being able to die at any time, then you also need to handle the case that "the leader" dies, potentially even while the formation is on the move. In that case you would have to select a new solder as the new leader and reevaluate the relative positions in the formation of all remaining soldiers.

My approach would be:

  1. Designate one soldier of the formation "the leader". (this does not necessarily need to be the actual commanding officer of the formation. You can pick any soldier. You will probably get the best results when you pick the soldier closest to the center of the formation, but that might be worth experimenting with)
  2. When the formation moves, calculate a path only for "the leader"
  3. When "the leader" moves, have all other soldiers in the formation maintain their relative position to "the leader". This should not require route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier should calculate an individual path to its designated position within the formation. In order to regain unit cohesion before arriving at the destination, those separated soldiers should move faster than usual. Or alternatively the leader should notice when they lose a soldier and then slow down until the lost soldier has caught up.

When your game features combat with individual soldiers being able to die at any time, then you also need to handle the case that "the leader" dies, potentially even while the formation is on the move. In that case you would have to select a new solder as the new leader and reevaluate the relative positions in the formation of all remaining soldiers.

My approach would be:

  1. Designate one soldier of the formation "the leader". (this does not necessarily need to be the actual commanding officer of the formation. You can pick any soldier. You will probably get the best results when you pick the soldier closest to the center of the formation, but that might be worth experimenting with)
  2. When the formation moves, calculate a path only for "the leader"
  3. While "the leader" moves along the calculated path, have all other soldiers in the formation maintain their relative position to "the leader". This should not require additional route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier should calculate an individual path to its designated position within the formation. In order to regain unit cohesion before arriving at the destination, those separated soldiers should move faster than usual. Or alternatively the leader should notice when they lose a soldier and then slow down until the lost soldier has caught up.

When your game features combat with individual soldiers being able to die at any time, then you also need to handle the case that "the leader" dies, potentially even while the formation is on the move. In that case you would have to select a new solder as the new leader and reevaluate the relative positions in the formation of all remaining soldiers.

added 303 characters in body
Source Link
Philipp
  • 123.2k
  • 28
  • 264
  • 345

My approach would be:

  1. Designate one soldier of the formation "the leader". (this does not necessarily need to be the actual commanding officer of the formation. You can pick any soldier. You will probably get the best results when you pick the soldier closest to the center of the formation, but that might be worth experimenting with)
  2. When the formation moves, calculate a path only for "the leader"
  3. When "the leader" moves, have all other soldiers in the formation maintain their relative position to "the leader". This should not require route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier should calculate an individual path to its designated position within the formation. In order to regain unit cohesion before arriving at the destination, those separated soldiers should move faster than usual. Or alternatively the leader should notice when they lose a soldier and then slow down until the lost soldier has caught up.

When your game features combat with individual soldiers being able to die at any time, then you also need to handle the case that "the leader" dies, potentially even while the formation is on the move. In that case you would have to select a new solder as the new leader and reevaluate the relative positions in the formation of all remaining soldiers.

My approach would be:

  1. Designate one soldier of the formation "the leader"
  2. When the formation moves, calculate a path only for "the leader"
  3. When "the leader" moves, have all other soldiers in the formation maintain their relative position to "the leader". This should not require route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier should calculate an individual path to its designated position within the formation. In order to regain unit cohesion before arriving at the destination, those separated soldiers should move faster than usual. Or alternatively the leader should notice when they lose a soldier and then slow down until the lost soldier has caught up.

My approach would be:

  1. Designate one soldier of the formation "the leader". (this does not necessarily need to be the actual commanding officer of the formation. You can pick any soldier. You will probably get the best results when you pick the soldier closest to the center of the formation, but that might be worth experimenting with)
  2. When the formation moves, calculate a path only for "the leader"
  3. When "the leader" moves, have all other soldiers in the formation maintain their relative position to "the leader". This should not require route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier should calculate an individual path to its designated position within the formation. In order to regain unit cohesion before arriving at the destination, those separated soldiers should move faster than usual. Or alternatively the leader should notice when they lose a soldier and then slow down until the lost soldier has caught up.

When your game features combat with individual soldiers being able to die at any time, then you also need to handle the case that "the leader" dies, potentially even while the formation is on the move. In that case you would have to select a new solder as the new leader and reevaluate the relative positions in the formation of all remaining soldiers.

added 2 characters in body
Source Link
Philipp
  • 123.2k
  • 28
  • 264
  • 345

My approach would be:

  1. Designate one soldier of the formation "the leader"
  2. When the formation moves, calculate a path only for "the leader"
  3. When "the leader" moves, have all other soldiers in the formation maintain their relative position to "the leader". This should not require route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier willshould calculate an individual path back to its designated position within the formation. In order to regain unit cohesion before arriving at the destination, those separated soldiers should move faster than usual. Or alternatively the leader should notice when they lose a soldier and then slow down until the lost soldier has caught up.

My approach would be:

  1. Designate one soldier of the formation "the leader"
  2. When the formation moves, calculate a path only for "the leader"
  3. When "the leader" moves, have all other soldiers in the formation maintain their relative position to "the leader". This should not require route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier will calculate an individual path back to its designated position within the formation.

My approach would be:

  1. Designate one soldier of the formation "the leader"
  2. When the formation moves, calculate a path only for "the leader"
  3. When "the leader" moves, have all other soldiers in the formation maintain their relative position to "the leader". This should not require route finding, only blindly moving into the relative direction.
  4. Should that be impossible, for example because an obstacle in the way requires to break formation, then the individual soldier should calculate an individual path to its designated position within the formation. In order to regain unit cohesion before arriving at the destination, those separated soldiers should move faster than usual. Or alternatively the leader should notice when they lose a soldier and then slow down until the lost soldier has caught up.
Source Link
Philipp
  • 123.2k
  • 28
  • 264
  • 345
Loading