deathkiller / jazz2

🎮 · Jazz² Resurrection: Open-source reimplementation of Jazz Jackrabbit 2
https://deat.tk/jazz2/
GNU General Public License v3.0
495 stars 18 forks source link

Add /output <DIR> switch to Import tool #27

Closed chewi closed 4 years ago

chewi commented 4 years ago

This writes the content to the specified directory instead of where the executables are. The argument handling had to be adjusted so that this could also be used for the automatic demo download.

The reason behind this is that I'm creating one package for Jazz² and one for the commercial/demo data. Many package managers install to a staging directory first and actively prevent you from writing directly outside the build area. I therefore need to source the Jazz² content from the system but write the import output to the staging directory.

This was admittedly a bit more involved than I had initially expected since you read, write, and delete these files. I basically applied exePath to content provided by Jazz² (e.g. Shaders) rather than the game itself (e.g. Tilesets).

I do see confusing errors during the import about things like missing tilesets and this one when starting a level but these appear without this change too.

 ˙ Can't load animation "FallShootToFall" from metadata "Interactive/PlayerJazz": File "Animations\Jazz\unused_jump_shoot_end.png.res" was not found in CompressedContent
 ˙ Can't load animation "LedgeClimb" from metadata "Interactive/PlayerJazz": File "Animations\Jazz\unused_ledge_climb.png.res" was not found in CompressedContent
deathkiller commented 4 years ago

Thank you for contribution.

It breaks build, so I have to check it first, but it looks fine, so I will merge it then.

That's right. I create /minimal content file that will be distributed in release. Then Import.exe merges JJ2 files with distributed content file.

These missing animations (FallShootToFall and LedgeClimb) are present only in original Jazz Jackrabbit 2 (but not in The Secret Files), so I'm adding them manually to release, so it works everywhere (so if you are planning to not use content file from my release, you have to import original JJ2 to make it work too). Without them, player cannot climb ledges, but it works too.

chewi commented 4 years ago

I've got the build to pass but I don't know what to do about the Codacy check. I disagree with its complaint as I can't actually think of any other way to do this. I saw that it was using Sonar under the hood and I read about // NOSONAR to skip the line but it didn't work. Any ideas?

Thanks for info on the missing animations. I'm using the "Collection" as installed by GOG. Are you saying the animations are missing from that? That's very odd. It would be annoying but I guess I could download your release to use your Main.dz as a starting point? Ideally the import tool would then overwrite the other entries that are already there. It would be nicer if these animations were just present in the sources. Perhaps you're concerned about licensing but you're including them in Main.dz anyway?

deathkiller commented 4 years ago

Please ignore Codacy warnings and don't try to fix it, I do the same (and such comments in source code are ugly) 😀

I think GOG version is The Secret Files (because it's the newest version), so it's not there. Yes, you can use Main.dz from release. Import tool does replace automatically already, so it already work. And yes, you are right, but no one has noticed this until now 😀 You still need at least one JJ2 game to make the game work, so I think it's not big issue.

chewi commented 4 years ago

Okay cool. I've removed that comment so we should be good to merge now.

deathkiller commented 4 years ago

Merged. Also, I added /demo switch.