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

Pathfinding #651

Merged
merged 5 commits into from
Apr 6, 2024
Merged

Pathfinding #651

merged 5 commits into from
Apr 6, 2024

Conversation

Jarod42
Copy link
Contributor

@Jarod42 Jarod42 commented Apr 6, 2024

Should improve/fix pathfinding with big unit.

- `CostMoveToCallBack_Default` multiplied cost by unitSize
- `CostToGoal` < 16 was ignored
- Increase `AStarMaxSearchIterations` (1024 is around 30x30)
@Jarod42 Jarod42 merged commit 15fb3b5 into master Apr 6, 2024
4 checks passed
@Jarod42 Jarod42 deleted the pathfinding branch April 6, 2024 12:22
// of the libc we're using has a 128/256/512bit SIMD vector
// instruction branch, since we might be clearing 8M of
// memory for a 2048x2048 map
alignas(64) int32_t CostFromStart = 0; /// Real costs to reach this point
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the goal to align struct Node to 64 bytes?
pahole shows that sizeof(Node) is 64 now (instead of 8).
Isn't the allocator behind vector itself doing a larger alignment for larger allocations?

pahole:

struct Node {
private:

        int32_t                    CostFromStart __attribute__((__aligned__(64))); /*     0     4 */
        uint16_t                   CostToGoal;           /*     4     2 */
        int8_t                     InGoal;               /*     6     1 */
        int8_t                     Direction;            /*     7     1 */

        /* size: 64, cachelines: 1, members: 4 */
        /* padding: 56 */
        /* forced alignments: 1 */
} __attribute__((__aligned__(64)));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was indeed to not loose aligned_malloc(64, AStarMatrixSize).
But indeed I did it wrongly.

I think alignas(std::uint64_t) was enough, or even no alignment at all.
I will remove it.

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

Successfully merging this pull request may close these issues.

None yet

2 participants