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

th19: thanm has no mechanism to deal with 2 images having the same name #111

Closed
32th-System opened this issue Aug 13, 2023 · 5 comments
Closed
Assignees
Milestone

Comments

@32th-System
Copy link
Member

32th-System commented Aug 13, 2023

TH19 seems to be the first game in the Touhou series, that has multiple entries in the same ANM file use the same file name for the image. This causes thtk to overwrite the first file with the next, causing both files to be the same upon recompilation of the ANM file. This doesn't matter for the game itself. The game itself doesn't even use these filenames (I think). But we've grown to rely on them, and it looks like we can no longer do that (at least for th19).

@DankRank
Copy link
Member

not the first time zun has done this mistake
#89

@32th-System
Copy link
Member Author

The difference with the .dat file is that you can only index files by file name. The game itself uses file names to load files from the .dat archive. The difference here is the game doesn't need the image file name to make use of the ANM. Therefore, if 2 images in an ANM have the same name, both can, and in the case of front.anm, probably are used. This makes this a much bigger problem than duplicate entires in the .dat file.

This really makes me question how these files are even put together in the first place

@DankRank
Copy link
Member

more importantly (and unlike th17.dat), the files are different

@DankRank
Copy link
Member

this isn't actually the first time
th18

('ability/dummy.png', ['dat18/abcard.anm', 'dat18/abcard.anm'])
('ending/ebg00.png', ['dat18/e01.anm', 'dat18/e01.anm'])
('ending/e01a.png', ['dat18/e01.anm', 'dat18/e01.anm'])
('ending/e01b.png', ['dat18/e01.anm', 'dat18/e01.anm'])
('ending/ebg05.png', ['dat18/e02.anm', 'dat18/e02.anm', 'dat18/e05.anm', 'dat18/e05.anm'])
('ending/e02a.png', ['dat18/e02.anm', 'dat18/e02.anm'])
('ending/e02b.png', ['dat18/e02.anm', 'dat18/e02.anm'])
('ending/ebg02.png', ['dat18/e03.anm', 'dat18/e03.anm'])
('ending/e03a.png', ['dat18/e03.anm', 'dat18/e03.anm'])
('ending/e03b.png', ['dat18/e03.anm', 'dat18/e03.anm'])
('ending/ebg01.png', ['dat18/e04.anm', 'dat18/e04.anm', 'dat18/e07.anm', 'dat18/e07.anm', 'dat18/e08.anm', 'dat18/e08.anm', 'dat18/e09.anm', 'dat18/e09.anm'])
('ending/e04a.png', ['dat18/e04.anm', 'dat18/e04.anm'])
('ending/e04b.png', ['dat18/e04.anm', 'dat18/e04.anm'])
('ending/e05a.png', ['dat18/e05.anm', 'dat18/e05.anm'])
('ending/e05b.png', ['dat18/e05.anm', 'dat18/e05.anm'])
('ending/ebg03.png', ['dat18/e06.anm', 'dat18/e06.anm', 'dat18/e11.anm', 'dat18/e11.anm', 'dat18/e12.anm', 'dat18/e12.anm'])
('ending/e06a.png', ['dat18/e06.anm', 'dat18/e06.anm'])
('ending/e06b.png', ['dat18/e06.anm', 'dat18/e06.anm'])
('ending/e07a.png', ['dat18/e07.anm', 'dat18/e07.anm'])
('ending/e07b.png', ['dat18/e07.anm', 'dat18/e07.anm'])
('ending/e08a.png', ['dat18/e08.anm', 'dat18/e08.anm'])
('ending/e08b.png', ['dat18/e08.anm', 'dat18/e08.anm'])
('ending/e09a.png', ['dat18/e09.anm', 'dat18/e09.anm'])
('ending/e10a.png', ['dat18/e10.anm', 'dat18/e10.anm'])
('face/balloon_1024.png', ['dat18/front.anm', 'dat18/front.anm', 'dat18/front.anm', 'dat18/front.anm'])
('face/dummy.png', ['dat18/pl00.anm', 'dat18/pl01.anm', 'dat18/pl02.anm', 'dat18/pl03.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st05enm2.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm', 'dat18/st06enm.anm'])
('loading/sig1280.png', ['dat18/sig.anm', 'dat18/sig.anm'])
('front/logo/st01logo.png', ['dat18/st01logo.anm', 'dat18/st01logo.anm'])
('front/logo/st02logo.png', ['dat18/st02logo.anm', 'dat18/st02logo.anm'])
('front/logo/st03logo.png', ['dat18/st03logo.anm', 'dat18/st03logo.anm'])
('front/logo/st04logo.png', ['dat18/st04logo.anm', 'dat18/st04logo.anm'])
('front/logo/st05logo.png', ['dat18/st05logo.anm', 'dat18/st05logo.anm'])
('front/logo/st06logo.png', ['dat18/st06logo.anm', 'dat18/st06logo.anm'])
('front/logo/st07logo.png', ['dat18/st07logo.anm', 'dat18/st07logo.anm'])
('title/title_bk00.png', ['dat18/title.anm', 'dat18/title.anm'])

th185

('ability/dummy.png', ['dat185/abcard.anm', 'dat185/abcard.anm'])
('face/dummy.png', ['dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss01t.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss25.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/boss26.anm', 'dat185/pl01.anm'])
('face/balloon_1024.png', ['dat185/front.anm', 'dat185/front.anm', 'dat185/front.anm', 'dat185/front.anm'])
('loading/sig1280.png', ['dat185/sig.anm', 'dat185/sig.anm'])
('title/title_bk01.png', ['dat185/title.anm', 'dat185/title.anm'])

th19

('ability/dummy.png', ['dat/abcard.anm', 'dat/abcard.anm'])
('player/pl00/pl00s.png', ['dat/ability.anm', 'dat/ability.anm', 'dat/pl00.anm'])
('player/pl01/pl01s.png', ['dat/ability.anm', 'dat/ability.anm', 'dat/pl01.anm'])
('player/pl02/pl02s.png', ['dat/ability.anm', 'dat/ability.anm', 'dat/pl02.anm'])
('face/balloon_1024.png', ['dat/front.anm', 'dat/front.anm', 'dat/front.anm', 'dat/front.anm'])
('background/world02/world4.png', ['dat/world02.anm', 'dat/world02.anm'])

probably earlier games too

@DankRank DankRank added this to the thtk-13 milestone Aug 21, 2023
@DankRank DankRank self-assigned this Aug 28, 2023
@DankRank
Copy link
Member

fixed in 58be110

DankRank added a commit that referenced this issue Sep 3, 2023
Turns out #111 wasn't that much of an issue after all.

This is a partial revert of 58be110, in
a sense that I reimplemented the stuff that I removed in that commit.

Now we have both combined and separate (-u) extraction implemented in a
somewhat elegant manner. Every entry now has a link to the next entry of
the same name. For separate extraction, we simply don't build the links.

Additionally, th19 is now fully supported in the combined mode (except
for replacement and for JPEGs). thanm will opportunistically try to
avoid recompressing PNGs. The -uu flag creates all the necessary
conditions for that.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants