fishfolk / bones

An easy-to-use game engine for making real games.
https://fishfolk.org/development/bones/introduction/
Other
210 stars 20 forks source link

feat(assets): Add feature flag `cid_debug_trace` to bones_asset #422

Closed MaxCWhitehead closed 1 month ago

MaxCWhitehead commented 1 month ago

With feature flag, during asset load, each input used to update cid are tracked and then logged.

One issue is that for dep_cid, I tried to get the AssetLoc for deps, but it appears to be None. Would be good to improve with some identifying information on dependency, right now just logs dep_cid and asset cid after update. If dep_cid differs, hard to tell which it is / why.

Dump for each asset is a single trace call, which hopefully will avoid any interleaved output as this runs in parallel for multiple assets.

Sample output:

2024-07-11T01:45:13.558171Z  INFO bones_asset::server: Cid trace schema: u!("jumpy::GameMeta") file path: "/game.yaml"
Trace is in order of updates, which impacts result
[Intermediate] Cid from schema fullname: u!("jumpy::GameMeta") cid: GqGtXP1KVcKyCvAHaUFYKt6miTj83mNfamjHYhfnScDm
[Intermediate] Cid from contents: cid: Ee6Z9iFMXp9PZkHgH5UCdbT9RQqy1UwUBZPePWaqUXgu
Dumping updates from sorted dependency cids:
    dep_cid: 1sp1JT5VhgEas7h5A55pmMLSo7SGj44VtnwKF3xVtjq, cid: 5MtTGxtP5C2ytUANTrQRw8cufhRvVykGALggTzgY1eFA, dep_asset_loc: None

... <truncated, quite long> ...

    dep_cid: 5VYCqN78NFaPYig354UZW9Pu6Bj8qoLHCDP59UXF2cr, cid: 8NCDAQU5ETULQ78FcSWtyHZePi5iWZciyAoRF2C2fyET, dep_asset_loc: None
Final cid: A71MVvdDbboEKKx8tQULZh9baqoqDQn45PDeS6QxWrWQ

Hopefully useful for issues like: https://github.com/fishfolk/jumpy/issues/995