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

Fix dynamic MP logic a bit #3641

Merged
merged 13 commits into from Aug 9, 2022
Merged

Fix dynamic MP logic a bit #3641

merged 13 commits into from Aug 9, 2022

Conversation

84634E1A607A
Copy link
Contributor

@84634E1A607A 84634E1A607A commented Aug 2, 2022

Description

(This is added because the complexity of Dyn MP.)
Previously, Dyn MP uses a way similar to bubble sort to check if the action data can be merged together. Which means:

1. Place 1
2. Place 2
3. Remove 2

May be merged into

1. Move 2 -> 1
2. Place 2

This PR aims to make combine operation more optimal by adding a key function GetLeastCostCombineTuple.

Given the data to combine and a list of actions that may be combined to, this function calculates the cost saved by combination for each action and picks the one that saves the most. Then it returns some relevant info.

Related Issues

Extensive testing is needed to prove if this fixes #3558
Workaround #3661

Progress Checklist

Note: before starting this checklist the PR should be marked as non-draft.

  • PR author has checked that this PR works as intended and doesn't
    break existing features:
    https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
    (this is important as to not waste the time of Thrive team
    members reviewing this PR)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    styleguide.

Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.

@hhyyrylainen hhyyrylainen added this to the Release 0.5.10 milestone Aug 2, 2022
@hhyyrylainen hhyyrylainen added this to In progress in Thrive Planning via automation Aug 2, 2022
@hhyyrylainen hhyyrylainen requested review from FuJa0815 and a team August 2, 2022 08:18
84634E1A607A and others added 2 commits August 9, 2022 15:02
Co-authored-by: Henri Hyyryläinen <hhyyrylainen@revolutionarygamesstudio.com>
Co-authored-by: Henri Hyyryläinen <hhyyrylainen@revolutionarygamesstudio.com>
Co-authored-by: Henri Hyyryläinen <hhyyrylainen@revolutionarygamesstudio.com>
@hhyyrylainen
Copy link
Member

I just playtested this and it seems to not at least break anything in a major way so once the code is cleaned up a bit I think this can be merged.

@hhyyrylainen hhyyrylainen merged commit 9995301 into master Aug 9, 2022
@hhyyrylainen hhyyrylainen deleted the dynamic_mp_fix branch August 9, 2022 07:42
Thrive Planning automation moved this from In progress to Done Aug 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

Successfully merging this pull request may close these issues.

Specific sequences of editor actions can result in nonsensical dynamic MP result
2 participants