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

Cannot load save #11774

Open
1 task done
hackedpassword opened this issue Jun 17, 2024 · 14 comments
Open
1 task done

Cannot load save #11774

hackedpassword opened this issue Jun 17, 2024 · 14 comments
Labels

Comments

@hackedpassword
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Game Version

build 1008 - 4.12.0.1

Describe the bug

image

Steps to Reproduce

Manual load of an ongoing game after updating the Unciv apk.

Screenshots

No response

Link to save file

No response

Operating System

Android

Additional Information

If you guys need a save game or anything else let me know.

@yairm210
Copy link
Owner

What?!
Yes, please provide the game save!
Super weird!

@hackedpassword
Copy link
Author

Had to pull this file out with total commander since it won't load. The other saves seem to be fine.

Note I updated from 4.12.0.0 - pretty certain.

Savegame

France - 339 turns.txt

Details

@hackedpassword
Copy link
Author

Ugh accidentally touched close comment.

Anyway including the previous save. That will give something to compare to.

Details

France - 338 turns.txt

@yairm210
Copy link
Owner

@SomeTroglodyte
LastSeenImprovement.readOldFormat is getting a jsonData with real data, but jsonData.get("entries") is null
Putting a breakpoint on LastSeenImprovement.kt:46 and loading the save gets you to the interesting info

@SomeTroglodyte
Copy link
Collaborator

Having a class: com.unciv.json.HashMapVector2 part at all without the entries is somehow a contradiction. The old code would write both, and the new shouldn't be able to, as that class path is still a class, but a subclass of the data it writes, not a super...

So a patch might be adding && jsonData.has("entries") to the if on line 31, but I'd rather find out how that unwanted class got in there.

@SomeTroglodyte
Copy link
Collaborator

No, can't repro that - I can load turn 338, nextTurn it, and get a turn 339 save that's perfectly fine without the obsolete-class marker. So - do we know the Java runtime that did this or any such details?

@hackedpassword
Copy link
Author

In the update period, only sprites changed, no json. history

@SomeTroglodyte
Copy link
Collaborator

only sprites changed

Didn't think a mod json change could in any way influence that serialization... But a weird Java classloader might. So which one is it? Android version & manufacturer?

(it's the writeObjectStart(actualType, knownType); call in Gdx Json.java line 508 that decides whether that class annotation is needed - and it shouldn't be, but maybe the java.lang.Object::getClass call a few lines above was weird? The knownType at this point is com.unciv.json.LastSeenImprovement, but maybe getClass failed to produce the correct actualType?)

@SomeTroglodyte
Copy link
Collaborator

@hackedpassword I wasn't clear enough - I'm asking which exact platform was the code running when it last saved - the save that was successful but then couldn't be loaded. Android version, mainly major version but maybe also OS manufacturer?

We'll need to know if that can repro on any other platform, beginning with an Android AVD of the same level. Sounds like it cannot. or we would be hearing massively about nobody being able to load their saves??? So far the analysis says it's not specific to your mod!

@hackedpassword
Copy link
Author

Running android 12, galaxy s10, ATT model, kernel 4.14.190

Everything stock on this phone nothing fancy no hax/rooting etc.

The save did not cross platforms.

Let me know if there's anything missing.

@SomeTroglodyte
Copy link
Collaborator

Sounds good, the one AVD I kept should be enough - but probably not today.

Curious why there's not a lotta more noise, seems only you. Otherwise, that snippet up there ("patch might be adding && jsonData.has("entries") to the if on line 31") would be simple and "can't hurt 'xept perf" and definitely cure your one glitch...

@SomeTroglodyte
Copy link
Collaborator

Nope, an API 32 (Android 12L) AVD does not reproduce. Neither with a small vanilla test game nor your Turn 338 then next-turn. Writes without class marker as intended. 🤷

@hackedpassword
Copy link
Author

Could be a one-off, perhaps a unique artifact inclusive of your recent save size reduction and solar activity. Since no one else is reporting, I'd say neutrino decay bursts have subsided.

Haven't seen the issue reproduce here either since, all load/save actions seem normal.

btw what did the faulty save produce as a wrong version/build value out of curiosity?

@SomeTroglodyte
Copy link
Collaborator

wrong version/build value

None at all, that's just the message it defaults to when an unexpected exception occurs during deserialization

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

No branches or pull requests

3 participants