Hyrule-Builder icon indicating copy to clipboard operation
Hyrule-Builder copied to clipboard

Add Havok support

Open GingerAvalanche opened this issue 3 years ago • 5 comments

Implements #2

Closes #2

Note that this relies on https://github.com/krenyy/botw_havok/pull/2 being pulled in and a release made for.

Also, I apologize for the messy diff. black auto-formatted the entire thing to match the bcml formatting, and I couldn't find a way to override it.

GingerAvalanche avatar Oct 21 '20 03:10 GingerAvalanche

How does this perform on large mods (e.g. Second Wind)?

NiceneNerd avatar Oct 22 '20 14:10 NiceneNerd

Note that I added in a call to time.time() at the beginning, and logged the difference at the end, of both build_mod() and unbuild_mod(), which should be the entire process, minus code interpretation.

This was the test on Second Wind:

Unbuilding complete in 78.67538189888 seconds
Unbuilding complete in 47.318360805511475 seconds
Unbuilding complete in 67.4050931930542 seconds
Unbuilding complete in 80.33496880531311 seconds
Unbuilding complete in 81.56705260276794 seconds
Unbuilding complete in 82.35656118392944 seconds
Unbuilding complete in 79.34546446800232 seconds

For reference, this is a run on Second Wind without Havok:

Unbuilding complete in 49.451889514923096 seconds

Seems to be about a 60% increase in run time for unbuilding, minus those two outliers. Building has been having trouble, as it seems like there are a bunch of tree-related RigidBody files that Second Wind has that botw_havok can dump to json but can't parse back to hkx. I'll post a run summary for that once it can be done.

GingerAvalanche avatar Oct 23 '20 00:10 GingerAvalanche

Alright, I'm not able to give you a runtime on the JSON files for building because botw_havok can't build about 2% of the files it unbuilds. But as far as the other 98% of the files goes, Second Wind had about a 50 second runtime on building those (which was significantly easier to time because the build process handles file types individually).

The files that couldn't be built were ~6-12KB each, so the time they add is probably eclipsed by random processor timing fluctuations.

EDIT: There are issues open for botw_havok that concern the "can't build 2% of files it unbuilds" thing. I expect this PR to collect dust while those get fixed.

GingerAvalanche avatar Oct 23 '20 03:10 GingerAvalanche

Alright, botw_havok 0.3.17 allows Second Wind to be unbuilt and built in its entirety, so I have a full analysis now. (There's an extra JSON file build time in the "with havok" section because that was my test to make sure 0.3.17 would finish building them, in which I called exit() right after the JSON section.)

with havok
Unbuilding complete in 82.29088568687439 seconds
Unbuilding complete in 71.19975852966309 seconds

Built JSON files in 43.95258140563965 seconds
Built JSON files in 43.246333360672 seconds
Built JSON files in 43.838900327682495 seconds

Mod built successfully in 362.4425332546234 seconds
Mod built successfully in 385.78689885139465 seconds
without havok
Unbuilding complete in 90.72036790847778 seconds
Unbuilding complete in 43.29712677001953 seconds

Built JSON files in 0.0 seconds
Built JSON files in 0.0 seconds

Mod built successfully in 254.36017489433289 seconds
Mod built successfully in 235.29895615577698 seconds

I don't know where that extra ~90 seconds is coming from on the full-build times. I've run a few tests and it's just there. I'm pretty certain it's got nothing to do with Havok parsing, as the only time Havok files are parsed is inside _build_json, and all calls to that are included in the "Build JSON" timer. Other than that, the only change to the builder was the addition of a json_files dict comprehension, which definitely should not take 90 seconds, but if it does then I don't know if I can do anything about it.

GingerAvalanche avatar Oct 25 '20 12:10 GingerAvalanche

Before you try to do anything with this, I'm gonna see if I can resolve this supposed merge conflict on my end. Looking at the diff, there is no conflict, so I dunno what GitHub is talking about, but I'll see if I can figure it out.

I'm also gonna undo the formatting changes made by black and squash some of these commits down, so the history isn't so ugly.

GingerAvalanche avatar Oct 25 '20 12:10 GingerAvalanche