Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PathGraph, skip closed cells early. #19524

Merged

Conversation

anvilvapre
Copy link
Contributor

In path finding GetConnections considers connections to already closed cells and calculates the cost for them. The caller afterwards ignores them. These are 15% of all connections.

Originally part of a separate pull request that I will close in future #19245.

@anvilvapre anvilvapre force-pushed the 20210716_perf_path_graph_skip_closed_early branch from 4e249b8 to ccbbb7e Compare July 16, 2021 15:45
teinarss
teinarss previously approved these changes Jul 25, 2021
Comment on lines 105 to 109
foreach (var cml in world.GetCustomMovementLayers().Values)
{
if (cml.EnabledForActor(actor.Info, locomotorInfo))
customLayerInfo[cml.Index] = (cml, pooledLayer.GetLayer());
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
foreach (var cml in world.GetCustomMovementLayers().Values)
{
if (cml.EnabledForActor(actor.Info, locomotorInfo))
customLayerInfo[cml.Index] = (cml, pooledLayer.GetLayer());
}
foreach (var cml in world.GetCustomMovementLayers().Values)
if (cml.EnabledForActor(actor.Info, locomotorInfo))
customLayerInfo[cml.Index] = (cml, pooledLayer.GetLayer());

Comment on lines 147 to 148
var validNeighbors = new List<GraphConnection>(directions.Length +
(posLayer == 0 ? customLayerInfo.Count : 1));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var validNeighbors = new List<GraphConnection>(directions.Length +
(posLayer == 0 ? customLayerInfo.Count : 1));
var validNeighbors = new List<GraphConnection>(directions.Length + (posLayer == 0 ? customLayerInfo.Count : 1));

In path finding GetConnections considers connections to already closed cells and calculates the cost for them. The caller afterwards ignores them. These are 15% of all connections.
Copy link
Member

@abcdefg30 abcdefg30 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok.

@abcdefg30 abcdefg30 merged commit e201e41 into OpenRA:bleed Jul 27, 2021
@abcdefg30
Copy link
Member

Changelog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants