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(facade): fix broken --load-last-game #5053

Merged
merged 3 commits into from
Jul 5, 2022
Merged

Conversation

keturn
Copy link
Member

@keturn keturn commented Jun 21, 2022

It wasn't calling engine.run()

How to test

Run Terasology with the --load-last-game option.

If running from gradle, that's

gradlew game --args="--homedir=. --load-last-game"

Check --create-last-game too.

It wasn't calling engine.run()
@keturn keturn added Type: Bug Issues reporting and PRs fixing problems Good First Issue Good for learners that are new to Terasology Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Size: S Small effort likely only affecting a single area and requiring little to no research Category: Crash Requests, Issues and Changes targeting unexpected terminations, segfaults, etc. labels Jun 21, 2022
@jdrueckert
Copy link
Member

Hm, when testing this, I get a "Missing required module or dependency error" 🤔
21:32:21.081 [main] WARN o.t.e.c.m.loadProcesses.RegisterMods - Missing at least one required module (or dependency) from the following list: [BiomesAPI, Thirst, StructureTemplates, Furnishings, CoreRendering, AnotherWorld, Health, CoreSampleGameplay, Inventory, Explosives, CoreWorlds, CoreAdvancedAssets, Drops, StructuralResources, AnotherWorldPlants, engine, ClimateConditions, AlterationEffects, Fluid, CoreAssets, PlantPack, GrowingFlora]

Which is interesting as the last game I played before had the following modules enabled:

21:31:22.360 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: CoreAdvancedAssets-1.3.0-SNAPSHOT
21:31:22.363 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: Explosives-1.1.1-SNAPSHOT
21:31:22.366 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: CoreSampleGameplay-4.1.1-SNAPSHOT
21:31:22.369 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: WorldlyTooltipAPI-1.1.0-SNAPSHOT
21:31:22.381 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: CoreWorlds-2.1.0-SNAPSHOT
21:31:22.384 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: Drops-1.2.0-SNAPSHOT
21:31:22.391 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: FlexiblePathfinding-1.1.0-SNAPSHOT
21:31:22.394 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: BiomesAPI-4.1.1-SNAPSHOT
21:31:22.406 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: Inventory-1.5.0-SNAPSHOT
21:31:22.411 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: WildAnimals-1.1.0-SNAPSHOT
21:31:22.417 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: ModuleTestingEnvironment-0.3.3-SNAPSHOT
21:31:22.423 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: Health-2.0.0-SNAPSHOT
21:31:22.428 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: CoreAssets-2.3.0-SNAPSHOT
21:31:22.436 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: Behaviors-1.1.1-SNAPSHOT
21:31:22.445 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: CoreRendering-1.1.2-SNAPSHOT
21:31:22.453 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: NameGenerator-1.1.0-SNAPSHOT
21:31:22.455 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: Furnishings-1.1.1-SNAPSHOT
21:31:22.458 [main] INFO  o.t.gestalt.module.ModulePathScanner - Discovered module: MarkovChains-1.6.1-SNAPSHOT

Not sure, where the game gets the information, that other modules such as Fluid should be present as well...

@keturn
Copy link
Member Author

keturn commented Jun 26, 2022

It looks like it's determining "latest" by sorting on the last-modified-time of the manifest file:

savedGamePaths.put(Files.getLastModifiedTime(entry.resolve(GameManifest.DEFAULT_FILE_NAME)), entry);

Do we not have a logger.info somewhere telling us which game it's selected? Maybe that was only for headless mode.

Do you get the same "missing required module" error on both this branch and develop?

Is it the same with --create-last-game?

@jdrueckert
Copy link
Member

Do we not have a logger.info somewhere telling us which game it's selected? Maybe that was only for headless mode.

"Game" in the sense of gameplay or save game?

Do you get the same "missing required module" error on both this branch and develop?
Is it the same with --create-last-game?

Yes and yes.

@keturn
Copy link
Member Author

keturn commented Jun 26, 2022

hmm, --create-last-game was working for me on develop. Sounds like there's some other issue going on in your case.

@keturn
Copy link
Member Author

keturn commented Jul 1, 2022

I stumbled across a source of the "missing required module" error:

gradlew game --args=--load-last-game overrides game's default args list so it no longer sets the homedir, and then it was trying to load saves from my user directory instead of the development directory.

So invocation by gradle needs to be more like gradlew game --args="--homedir=. --load-last-game"

Copy link
Member

@jdrueckert jdrueckert left a comment

Choose a reason for hiding this comment

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

Now it works like a charm

@jdrueckert jdrueckert merged commit b367a18 into develop Jul 5, 2022
@jdrueckert jdrueckert deleted the fix/loadLastGame branch July 5, 2022 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Crash Requests, Issues and Changes targeting unexpected terminations, segfaults, etc. Good First Issue Good for learners that are new to Terasology Size: S Small effort likely only affecting a single area and requiring little to no research Topic: Stabilization Requests, Issues and Changes related to improving stablity and reducing flakyness Type: Bug Issues reporting and PRs fixing problems
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants