Resizing existing sprites

Discuss modding questions and implementation details.
User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Resizing existing sprites

Post by Ralzar »

TheLacus wrote: Sun Mar 01, 2020 8:08 pm
Ralzar wrote: Sun Mar 01, 2020 7:12 pm Note that all XML files in my mod increase each sprite by the same amount, which seems like a really redundant way to do this compared to simply having a size value declared together with the sprite archive number in EnemyBasics.cs
I confirm that a custom implementation of MobilePersonAsset is something you should consider. It would allow you to make all kinds of customizations and not only be limited to a fixed scale.
Xml files are retrieved with load order to serve a specific need; i would rather not break compatiblity by adding other ways to resize billboards. Maybe i can add a scale property to Archive.xml, which would serve as a base for additional scales defined in Archive_Record-0.xml. Would this work for you?
Honestly, I don't know enough coding to feel I can answer that competently :D
TheLacus wrote: Sun Mar 01, 2020 8:08 pm PS: I noticed that you have files for specific frames in your repository. This should't be needed, all frames have the same size so only Archive_Record-0.xml is actually read.
Hm, I'm having problems making this work correctly. I just attempted it with the Werwolf.

If I understand you correctly, I should be able to simply have:
264_0-0.xml
264_1-0.xml
264_2-0.xml
264_3-0.xml
etc
?

This mostly works, but I see the werewolf pop down to regular size mid-attack. Maybe because EnemyBasics.cs defines attack frames?

Code: Select all

PrimaryAttackAnimFrames = new int[] { 0, 1, -1, 2, -1, 2 }

squerol
Posts: 6
Joined: Tue Feb 25, 2020 7:01 am

Re: Resizing existing sprites

Post by squerol »

Ralzar wrote: Sun Mar 01, 2020 8:48 pm Maybe because EnemyBasics.cs defines attack frames?

Code: Select all

PrimaryAttackAnimFrames = new int[] { 0, 1, -1, 2, -1, 2 }
So are attack frames of enemies editable? For example when hit collisions actually happens, etc?

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Resizing existing sprites

Post by Ralzar »

squerol wrote: Mon Mar 02, 2020 9:08 am
Ralzar wrote: Sun Mar 01, 2020 8:48 pm Maybe because EnemyBasics.cs defines attack frames?

Code: Select all

PrimaryAttackAnimFrames = new int[] { 0, 1, -1, 2, -1, 2 }
So are attack frames of enemies editable? For example when hit collisions actually happens, etc?
I think yes, but I'm not sure what defines when attack hits.

User avatar
TheLacus
Posts: 1305
Joined: Wed Sep 14, 2016 6:22 pm

Re: Resizing existing sprites

Post by TheLacus »

Ralzar wrote: Sun Mar 01, 2020 8:48 pm
If I understand you correctly, I should be able to simply have:
264_0-0.xml
264_1-0.xml
264_2-0.xml
264_3-0.xml
etc
?

This mostly works, but I see the werewolf pop down to regular size mid-attack. Maybe because EnemyBasics.cs defines attack frames?

Code: Select all

PrimaryAttackAnimFrames = new int[] { 0, 1, -1, 2, -1, 2 }
Enemies are implemented by DaggerfallMobileUnit, which reads custom scales for individual records and store them inside MobileUnitSummary.RecordSizes. Xml files for frames different than zero are never read, so they can't have any effect here.

If there are specific frames with unexpected size there may be a bug somewhere. I don't see anything suspicious in the code, can you tell me which record(s) are affected by the issue?

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Resizing existing sprites

Post by Ralzar »

I'll try to recreate the test I did and see if I can identify the exact frames.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Resizing existing sprites

Post by BadLuckBurt »

Ralzar wrote: Mon Mar 09, 2020 7:07 am I'll try to recreate the test I did and see if I can identify the exact frames.
Dump all the textures with Daggerfall Imaging and add the Dimensions column in Windows Explorer while in Details view. I think some frames just have different dimensions
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Resizing existing sprites

Post by Ralzar »

BadLuckBurt wrote: Mon Mar 09, 2020 7:16 am
Ralzar wrote: Mon Mar 09, 2020 7:07 am I'll try to recreate the test I did and see if I can identify the exact frames.
Dump all the textures with Daggerfall Imaging and add the Dimensions column in Windows Explorer while in Details view. I think some frames just have different dimensions
Right, so since the method suggested by TheLacus only defines the size in the first frame, if some of them have different sizes it might bug out?

I'd agree, if not for the fact that the xml fils I created to resize the sprites are all identical. They all say to set size to 1.2. No consideration is taken for image size/dimansions.
So if that gets done through some kind of cascading effect or done for each individual frame should not produce this bug. But what do I know? :D
I'll test when I get home.

User avatar
BadLuckBurt
Posts: 948
Joined: Sun Nov 05, 2017 8:30 pm

Re: Resizing existing sprites

Post by BadLuckBurt »

Ralzar wrote: Mon Mar 09, 2020 7:25 am Right, so since the method suggested by TheLacus only defines the size in the first frame, if some of them have different sizes it might bug out?

I'd agree, if not for the fact that the xml fils I created to resize the sprites are all identical. They all say to set size to 1.2. No consideration is taken for image size/dimansions.
So if that gets done through some kind of cascading effect or done for each individual frame should not produce this bug. But what do I know? :D
I'll test when I get home.
If only the 0-frame XML is being read and one of the other frames has a different height it would produce this bug so Im not sure I follow your logic. Anyway, if they are all the same height, its a bug. If they are not, then it would seem the XMLs for the other frames should be read but TheLacus knows more than I do.

There was also a bug with a female spellcaster I believe where she went really tiny for 1 frame but that has since been fixed I believe. This might be similar to that
DFU on UESP: https://en.uesp.net/w/index.php?title=T ... fall_Unity
DFU Nexus Mods: https://www.nexusmods.com/daggerfallunity
My github repositories with mostly DFU related stuff: https://github.com/BadLuckBurt

.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Resizing existing sprites

Post by Ralzar »

BadLuckBurt wrote: Mon Mar 09, 2020 8:00 am There was also a bug with a female spellcaster I believe where she went really tiny for 1 frame but that has since been fixed I believe. This might be similar to that
Yeah, I reported that bug and this looked pretty much identical to that.

User avatar
Ralzar
Posts: 2211
Joined: Mon Oct 07, 2019 4:11 pm
Location: Norway

Re: Resizing existing sprites

Post by Ralzar »

Tested a bit now. Could not reproduce the bug so will chalk this down to user error on my part.

I'll test a bit more to be sure, but I assume I managed to delete an xml file I should not have.

Post Reply