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

feat/gif your game #6527

Merged
merged 7 commits into from
Feb 11, 2025
Merged

feat/gif your game #6527

merged 7 commits into from
Feb 11, 2025

Conversation

Scoppio
Copy link
Collaborator

@Scoppio Scoppio commented Feb 9, 2025

What it does

If you have the game minimap summary enabled, it will also make the gif of it.
once you start the game, every time a new image is generated it is added to the final gif.

e0cd828a-2e4e-469c-a8d7-5053578f2d82

New features

Destroyed units shown on minimap

It now shows the destroyed units on the minimap with its icon struck in the midle, they also have a heavy transparency applied to them.

Screenshot 2025-02-10 at 00 42 19

ECM shows on the minimap

They differ from Sensors by having a dashed outline instead of a solid one.

Screenshot 2025-02-10 at 00 39 38

Short name on the minimap

It's basically the display name without the player name, it can be turned on or off in the client settings.

Screenshot 2025-02-10 at 00 40 47

It also works with non-stratops symbols

The following image is a debug image showing how the different symbols look like wiht the destroy mark

Screenshot 2025-02-10 at 00 54 05 Screenshot 2025-02-10 at 00 55 31

How it works?

It runs in its own thread, once every phase it receives a new buffered image, which is then enqueued in its own synchonized queue, and it build the GIF while the game runs. Very simple and easy, it is capable of handling exceptions and interruptions, sudden disconections or crashes, and will just "finish" the gif it started.
If you crash and then rejoin the game, the game object should have a new ID, so you would endup with a new gif as the continuation of the previous game.

Anything else?

Yes... do NOT use the pink lemonade.theme for the minimap if you plan on sharing the gifs on Discord or some other platforms... turns out the pink with green tones is too close to skin tone and the automod on Discord and some other NSFW moderation tools will pickup the gif as a potential NSFW gif and block it/delete it.

Copy link

codecov bot commented Feb 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 29.03%. Comparing base (1d6c24b) to head (75caf49).
Report is 11 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #6527      +/-   ##
============================================
- Coverage     29.05%   29.03%   -0.02%     
+ Complexity    15160    15157       -3     
============================================
  Files          2835     2836       +1     
  Lines        279129   279279     +150     
  Branches      49214    49237      +23     
============================================
- Hits          81104    81102       -2     
- Misses       192652   192801     +149     
- Partials       5373     5376       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@HammerGS HammerGS added the Draft Work in Progress label Feb 9, 2025
@Scoppio Scoppio self-assigned this Feb 9, 2025
@Scoppio Scoppio marked this pull request as ready for review February 10, 2025 03:08
@Scoppio Scoppio added GUI User Interface and removed Draft Work in Progress labels Feb 10, 2025
@Scoppio Scoppio requested a review from Sleet01 February 10, 2025 04:17
Copy link
Collaborator

@Sleet01 Sleet01 left a comment

Choose a reason for hiding this comment

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

Looks pretty cool!

@HammerGS
Copy link
Member

Will this support "normal" aka non-ACAR and PACAR games?

@Scoppio
Copy link
Collaborator Author

Scoppio commented Feb 10, 2025

Will this support "normal" aka non-ACAR and PACAR games?

Yes, those changes are directly into MegaMek vanilla.

@HammerGS HammerGS merged commit 1d59a70 into MegaMek:master Feb 11, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI User Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants