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

Account for dependencies when deciding what maps to cook #47

Open
Xymanek opened this issue Jun 27, 2021 · 2 comments
Open

Account for dependencies when deciding what maps to cook #47

Xymanek opened this issue Jun 27, 2021 · 2 comments
Labels
bug Something isn't working cooking Related to mod asset and Highlander cooking incremental Rebuilding does extra or not enough work.

Comments

@Xymanek
Copy link
Member

Xymanek commented Jun 27, 2021

Since switch to the DLC cook (#46) we need to figure out which maps are dirty and are in need of recook ourselves. Currently this logic only considers the map file only, ignoring the dependencies since we don't know what they are (except for collection maps, where we do know the, at least the direct ones).

One approach would be to have the mod devs manually specify the dependencies. This is simple for X2MBC, but error-prone for mod devs. A better approach would be to automatically infer the list of dependencies. If only there was a way to do it...

.\XComGame.com pkginfo TEST_map_CI.umap -import

[… Other output …]
--------------------------------------------
        Packages referenced by test_map_ci:
                0) Engine
                1) Core
                2) XComGame
                3) EngineMaterials
                4) EngineMeshes
                5) TEST_mat_CI_2
                6) UILibrary_StrategyImages

What's even better, is that it also lists transitive dependencies, not only the direct ones - in this case the map itself only referenced
TEST_mat_CI_2, while an object there referenced something in UILibrary_StrategyImages. This command also accepts multiple packages/maps to check in one invocation.

I suggest the following workflow:

When a map is dirty/(re)cooked:

  1. Before undoing the junctions/ini changes, run the above command to gather the dependencies
  2. Save the list of maps with their dependencies to a json file in BuildCache (outside of PublishedCookedPCConsole)

When deciding whether a map is dirty:

  1. If the tracking file is missing, all maps are dirty
  2. If the cooked map is missing, it is dirty
  3. If the specific map is missing a record for its dependencies, it is dirty
  4. If the timestamp of the map or any of its dependencies is later than the cooked map, it is dirty

Of course, the output of the command will need to be parsed and cleaned - we don't want to check the timestamps for:

  • Script packages - they get rebuilt all the time
  • SDK packages - the cooker doesn't permit them to be changed for DLC cook (especially their textures)
@Xymanek Xymanek added bug Something isn't working cooking Related to mod asset and Highlander cooking incremental Rebuilding does extra or not enough work. labels Jun 27, 2021
@Xymanek
Copy link
Member Author

Xymanek commented Jul 9, 2021

No longer relevant as DLC cook was reverted (#53)

@Xymanek Xymanek closed this as completed Jul 9, 2021
@Xymanek
Copy link
Member Author

Xymanek commented Dec 19, 2021

Reopening since DLC cooking was re-implemented (#70)

@Xymanek Xymanek reopened this Dec 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cooking Related to mod asset and Highlander cooking incremental Rebuilding does extra or not enough work.
Projects
None yet
Development

No branches or pull requests

1 participant