Opened 9 years ago

Closed 9 years ago

#2908 closed defect (fixed)

[PATCH] Use short pathfinder update when colliding with entities

Reported by: ickylevel Owned by: Itms
Priority: Should Have Milestone: Alpha 19
Component: UI & Simulation Keywords: patch pathfinding
Cc: tjh.hts@…, bgamari@… Patch:

Description

The patch is not the final one, the code will have to be made cleaner. It's just here for testing purpose.

Instead of recalculating everything when a unit hits another entity, the pathfinder will just update the short range path, improving performance. The calculation is done immediately as opposed to the 'next' turn. This has to be checked and verified in multiplayer.

Attachments (2)

pathfix.patch (13.0 KB ) - added by ickylevel 9 years ago.
pathfix_async.patch (13.2 KB ) - added by ickylevel 9 years ago.

Download all attachments as: .zip

Change History (12)

by ickylevel, 9 years ago

Attachment: pathfix.patch added

comment:1 by historic_bruno, 9 years ago

Keywords: patch review added

in reply to:  description comment:2 by historic_bruno, 9 years ago

Replying to ickylevel:

Instead of recalculating everything when a unit hits another entity, the pathfinder will just update the short range path, improving performance. The calculation is done immediately as opposed to the 'next' turn. This has to be checked and verified in multiplayer.

This actually sounds like it could be quite bad for performance, because instead of having that turn "buffer" before a recalculation, it happens immediately. Just imagine how often that could happen with a large group of units moving in a battle, or a unit that's trapped. This is more or less what happened the last time such a change was made (for the long pathfinder to make it more "responsive", and it's still in SVN).

Last edited 9 years ago by historic_bruno (previous) (diff)

comment:3 by ickylevel, 9 years ago

I haven't tried to queue it so I could try and see if it increase further the framerate.

by ickylevel, 9 years ago

Attachment: pathfix_async.patch added

comment:4 by ickylevel, 9 years ago

I just added pathfix_async which is the turn based version of it. It doesn't seem to do much of a difference (I am comparing using a save).

Last edited 9 years ago by ickylevel (previous) (diff)

comment:5 by Timothy Hamlett, 9 years ago

Cc: tjh.hts@… added

comment:6 by bgamari, 9 years ago

Cc: bgamari@… added

comment:7 by Itms, 9 years ago

Keywords: review removed

This change is obsolete considering the changes performed in Philip's patch (something rather similar was done there).

So I'm not going to close the ticket as invalid, I'll mark it as fixed when the pathfinding branch is merged.

Thanks for working on it anyways!

comment:8 by Itms, 9 years ago

Keywords: pathfinding added

comment:9 by Itms, 9 years ago

Milestone: Alpha 18Alpha 19

comment:10 by Itms, 9 years ago

Owner: set to Itms
Resolution: fixed
Status: newclosed

In 16751:

New long-range pathfinder.

Based on Philip's work located at http://git.wildfiregames.com/gitweb/?p=0ad.git;a=shortlog;h=refs/heads/projects/philip/pathfinder
Includes code by wraitii, sanderd17 and kanetaka.

An updated version of docs/pathfinder.pdf describing the changes in detail will be committed ASAP.

Running update-workspaces is needed after this change.

Fixes #1756.
Fixes #930, #1259, #2908, #2960, #3097
Refs #1200, #1914, #1942, #2568, #2132, #2563

Note: See TracTickets for help on using tickets.