-
Notifications
You must be signed in to change notification settings - Fork 814
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
Migrate monstdat to a data file #5220
Conversation
c2a195a
to
87c1fae
Compare
179b7ff
to
f28ab66
Compare
00cbe14
to
dddf285
Compare
1b54134
to
8d6bf4f
Compare
Pull request was converted to draft
8d6bf4f
to
e065fde
Compare
Yes! |
e065fde
to
0c4dd3d
Compare
@glebm I just have that one single comment, but also now that debug.cpp has been rewritten this is going to need a little rebase if you have the time :) |
Ok, it looks like you haven't made any adjustments for picking up the monster names when translation files are updated. Text extraction is normally done by calling |
For monsters with the same sprite, load the sprite from the file system only once. Example: ``` VERBOSE: Loaded monster graphics: falspear\phall 452 KiB x1 VERBOSE: Loaded monster graphics: skelbow\sklbw 618 KiB x1 VERBOSE: Loaded monster graphics: skelsd\sklsr 610 KiB x1 VERBOSE: Loaded monster graphics: goatbow\goatb 832 KiB x1 VERBOSE: Loaded monster graphics: bat\bat 282 KiB x2 <-- here we only load the sprite once VERBOSE: Loaded monster graphics: rhino\rhino 1306 KiB x1 VERBOSE: Loaded monster graphics: golem\golem 298 KiB x1 VERBOSE: Total monster graphics: 4401 KiB 4684 KiB ``` Here, the bat sprite will be loaded from the MPQ only once. For the second sprite, we simply clone the first sprite before applying TRNs. This also reduces the size of `MonsterData` from 88 bytes to 80. When we migrate monster data to a TSV, the sprite IDs can be generated automatically at load time.
I actually much prefer it as a table of monsters. I'm not sure how it would look if split up though, but it sounds like it would mostly just complicates editing them and be easy to make one of them not align with the others etc. |
0c4dd3d
to
7a6974c
Compare
We may want to migrate this to 1 file per monster but for now the migration is as close to the hard-coded version as possible. Sprites that are used by multiple monsters are only loaded from disk once.
7a6974c
to
fe6b530
Compare
I had a little chat with chatGPT and we came to the conclusion that we should make a python script that the developers run each time the tsv file is updated. This lets the translation process work with out changes and also addresses my only comment to your code and gives us a simpler data file. I got excited and made an implementation for it, hope you like it :) |
We may want to migrate this to 1 file per monster but for now the format is as close to the hard-coded version as possible.
Sprites that are used by multiple monsters are only loaded from disk once.
With the CSV editor extension in VS Code: