Opened 9 years ago

Closed 21 months ago

Last modified 21 months ago

#3280 closed enhancement (fixed)

Formation pathfinding should take obstructions into account.

Reported by: sanderd17 Owned by:
Priority: Should Have Milestone: Alpha 26
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by Freagarach)

This is a proposal to make formation pathfinding better next to big obstructions. The problem is that formations should avoid obstructions as much as possible, but should also be able to pass small obstructions (like a tree) without doing too much effort.

The patch can be applied to the current pathfinder branch: https://github.com/na-Itms/0ad/commit/54b918ecdb57bfd58e2ad064beaca8a45a2ada79 So it works with the new pathfinder.

There's also a pdf explaining the changes.

Note that only the move-to-point command is implemented now. So gather or attack commands will result in an error.

Attachments (4)

formation_pathfinding.diff (25.6 KB ) - added by sanderd17 9 years ago.
formation_pathfinding.tex (6.5 KB ) - added by sanderd17 9 years ago.
formation_pathfinding.pdf (56.0 KB ) - added by sanderd17 9 years ago.
formation_pathfinding.2.diff (27.1 KB ) - added by sanderd17 9 years ago.

Download all attachments as: .zip

Change History (9)

by sanderd17, 9 years ago

Attachment: formation_pathfinding.diff added

by sanderd17, 9 years ago

Attachment: formation_pathfinding.tex added

by sanderd17, 9 years ago

Attachment: formation_pathfinding.pdf added

comment:1 by sanderd17, 9 years ago

Description: modified (diff)

comment:2 by sanderd17, 9 years ago

Ok, turning formations doesn't work as I wanted (see updated patch). Without bending, it doesn't result in a nice visual.

When focusing on long-distance formations, I think we should consider the following:

The first row can calculate the path of the least resistance, just like the entire formation does now. Then it can leave a breadcrumb trail for the other rows to follow.

by sanderd17, 9 years ago

comment:3 by Freagarach, 4 years ago

Description: modified (diff)

(Ticket for formation bending: #2602.)

comment:4 by marder, 21 months ago

Keywords: patch removed
Resolution: fixed
Status: newclosed
Summary: [PATCH] Formation pathfinding should take obstructions into account.Formation pathfinding should take obstructions into account.

Somthing to deal with this problem was added with the two commits:

1) https://code.wildfiregames.com/rP26801 :

Allow setting the passability class dynamically. This is needed to improve formation behavior for the release.

Accepted by: @Freagarach Refs: Phab:D4563, Phab:D4605 Differential Revision: https://code.wildfiregames.com/D4599

_ _ _ _ _ _ _

2) https://code.wildfiregames.com/rP26865 :

UnitMotion - Fix Clearance serialization and only allow changing passability of formation controllers.

Fixes rP26801

Changing the passability class at runtime breaks some UnitMotion assumptions in unrecoverable ways and will lead to units getting into impassable terrain. Formation controllers can tolerate it since units still check their own obstruction. Until some code is added to recover from the above bad case, de-activated changing passability class for non-formation controllers.

This also fixes serialization issues related to clearance & passability classes following that diff.

Reviewed By: Freagarach

Differential Revision: https://code.wildfiregames.com/D4629

comment:5 by marder, 21 months ago

Milestone: BacklogAlpha 26
Note: See TracTickets for help on using tickets.