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

[49.20] Units reinforced from MUL sometimes swap sprites with other unit sprites #5769

Closed
gsparks3 opened this issue Jul 22, 2024 · 7 comments · Fixed by #5834
Closed

[49.20] Units reinforced from MUL sometimes swap sprites with other unit sprites #5769

gsparks3 opened this issue Jul 22, 2024 · 7 comments · Fixed by #5834
Assignees
Labels
Bug GUI User Interface

Comments

@gsparks3
Copy link
Collaborator

I have seen this issue as far back as 0.48 or even earlier, but it has been difficult to deliberately reproduce. However, I currently have a saved game that appears to at least partially demonstrate the issue, as well as some documentation from in-game experience.

Sometimes, when reinforcing from a MUL, the sprites of the reinforced units will be replaced with sprites of other units, especially previously destroyed units. Here, you can see that the Hunchback sprite is actually that of a destroyed Ontos, and the one Cheetah sprite is actually from a destroyed Drillson Heavy Hover Tank.
image

Interestingly, I found that the Cheetah sprite was actually swapped for the sprite of the destroyed Drillson Heavy Hover Tank, showing up in the hex where the tank was destroyed. I was not able to confirm whether the Ontos wreck sprite was swapped for the Hunchback sprite.
image

Whenever this bug occurs, turning the client setting "Show damage to units on the unit icon" off and on again will generally reset the sprites to their correct state, as seen below.
image

This led me to believe that it would not reproduce from a saved game, but here it appears to do so at least partially. In particular, the save game was after movement and firing, at which point the Cheetah was destroyed, and its wreck sprite in hex 2743 has remained as the Drillson sprite.
image

Interestingly, the original Drillson wreck in hex 3841 is now displayed correctly after loading the savegame.
image

I note that I actually had two clients connected to the game server for this game; on one client I had flipped the setting off and on to correct the sprite glitch (prior to the Cheetah moving), but on the other client I did not, and the sprite switch persisted through the end of the movement phase for that client, into the firing phase, as seen below.
image

Going back through my autosaves from Paranoid Autosave, I managed to locate the save from immediately after deployment of the reinforced units. Loading this autosave also appears to partially reproduce the sprite bug. Interestingly, the Cheetah is now displayed with the correct sprite, but the Drillson wreck in hex 3841 is still the Cheetah sprite. It seems only the incorrect wreck sprites persist through a save and reload, and then only sometimes.

Savegames:
bigGameDay4end.sav.gz
autosave_2024-07-21_15-12-01.sav.gz

@IllianiCBT
Copy link
Collaborator

Probably the same issue as #5661

@gsparks3
Copy link
Collaborator Author

I'm not so sure it's the same root cause, although the effect is similar. Worth noting the possibility, at least.

@HammerGS HammerGS added Bug GUI User Interface labels Jul 22, 2024
@repligator
Copy link
Collaborator

When loading autosave_2024-07-21_15-12-01.sav.gz on 49.20, I also see the Drillson wreck as a Cheetah.
I tried to reinforce from a random post-battle MUL I had laying around. I tried actually playing the game but replacing all the players with bots ate my RAM almost instantly. The log does seem to indicate that it loaded the correct sprites from the MUL.

When looking at the other recent sprite issue, I experimented with adding mechImageList.clear() and mechImages.clear() to case FILE_REFRESH_CACHE: so that every time the user selected Game -> Refresh Unit Cache, the sprites would be refreshed as well. I wonder if that would be useful, (or even effect) this issue?

megamek-mul-load.log
Ghost Bears.mul.zip

@SJuliez
Copy link
Member

SJuliez commented Jul 27, 2024

@gsparks3 Does the MUL you reinforced from include unit IDs? This looks like overlapping unit IDs leading to icon cache retrieval errors. Which is what happened in #5661 where the old cache entries persisted over a game /reset.

@SJuliez SJuliez self-assigned this Jul 27, 2024
@gsparks3
Copy link
Collaborator Author

I'd have to check, but it's very likely that it did - most of us play with Show Unit IDs enabled, and I believe having that active causes unit IDs to be saved to MULs?

@gsparks3
Copy link
Collaborator Author

Attached is the MUL, which does appear to contain saved unit IDs.

2nd FWL 3rd Company.zip

@gsparks3
Copy link
Collaborator Author

Hah - in the screenshots in the first post, you can see that the wreck of the Drillson and the reinforced Cheetah have the same unit IDs listed. That's definitely it.

HammerGS added a commit that referenced this issue Aug 1, 2024
#5769: Possibly fix ID overlap when reinforcing from MUL
HammerGS added a commit that referenced this issue Aug 1, 2024
+ Fix #5769:  Possibly fix ID overlap when reinforcing from MUL
+ PR #5835: Allow bot vs bot in ScenarioV2 and test setup
+ Fix #5833: GameReports: remove error message and deal with missing rounds
+ Fix #5833: Precognition: receive updated ground objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug GUI User Interface
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants