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

Turn Details Overlay on Boardview #4513

Merged
merged 16 commits into from
Jun 17, 2023
Merged

Conversation

pakfront
Copy link
Collaborator

@pakfront pakfront commented Jun 10, 2023

This displays an optional overlay on the board view that gives the specific Moves or Actions a unit will do when the turn is Done.
This is very helpful in understanding what will happen in a turn, and makes debugging turn behavior a bit easier.
attackoverlay

moveoverlay
In the Move overlay, any set of moves that require a PSR get a * appended to their entry. Any illegal moves, such as moves beyond MP limit, are greyed out. There are also unicode icons for some move actions.
This fixes #4486

I optimized and centralized the code to calculate and itemize the user displayed ToHits for this feature and AttackSprites. This fixes #4501.
An important change - in FiringDisplay I switched the order of adding attacks to Game and to the local Log so that the Game add is first. This fixes the issues where the ToHit mods displayed to the user were not calculated correctly when the attack was first added. This should have not break anything, it is more correct and when the ToHits are sent to the server, they go through another recalc pass that verifies the values.

There are cases where the display differs from the actual results. Without considerable and possibly disruptivework, these are unavoidable due to the way MegaMek works:

  • In Move phase, it will display the Moves in the order they are entered. This may not match the actual execution order.
    Notably, it seems in the game all altitude changes are reordered to happen at the beginning of the turn on Done submit. This is not reflected in the Move list, So moves made after a number of alt changes may not have enough MP. This is true of the boardview movement sprite display also, so is a general issue.

  • in Firing phase, I put a chunk of work into getting the ToHit modifiers to display and update correctly, but the penalty for Spotting still is not applied to the user displayed ToHit. It is correctly calculated when the Turn is executed though.

@pakfront pakfront added (RFE) Enhancement Requests for Enhancement, new features or implementations GUI User Interface In Development (Draft) An additional way to mark something as a draft. Make it stand out more. labels Jun 14, 2023
@pakfront pakfront removed the In Development (Draft) An additional way to mark something as a draft. Make it stand out more. label Jun 16, 2023
@pakfront pakfront marked this pull request as ready for review June 16, 2023 04:16
Copy link
Member

@SJuliez SJuliez left a comment

Choose a reason for hiding this comment

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

Few minor things.

I like the AbstractBoardOverlay and the EntityAttackLog classes. Both neat as well as the PR itself of course.

@SJuliez SJuliez merged commit d71a90c into MegaMek:master Jun 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI User Interface (RFE) Enhancement Requests for Enhancement, new features or implementations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Attack Sprite ToHit is wrong after deleting an attack Better feedback on Movement Phase MovePath contents
2 participants