Resizing existing sprites

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

Resizing existing sprites

Post by Ralzar »

So I recently looked into modding sprites in Daggerfall and found that you could define the size of sprites by supplying XML files. This works, however, it is a bit awkward and the Unity developer keeps giving reference errors because the mod system expect me to supply the sprites.

https://github.com/Ralzar81/Meaner-Monsters


Is there an easier way to do this that does not use so many xml files and does not produce constant errors when running in debug mode?

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Resizing existing sprites

Post by King of Worms »

Ive found just a workarounds and I dont really like those, so something more user friendly than current state and actually working would be more than welcomed (I dont think the XML files work for terrain sprites for example)

If you want to make something smaller, than resize the image withing the canvas, so it looks like this (notice the empty room above the plant)
Spoiler!
503_25-0.png
503_25-0.png (521.04 KiB) Viewed 1656 times
To make it larger, only XML can help, if it works I mean...

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

Re: Resizing existing sprites

Post by Ralzar »

I'm trying to avoid editing sprites, because then I'll have to do it for DREAM as well ;)

User avatar
Baler
Posts: 225
Joined: Thu May 23, 2019 1:39 am
Location: Earth

Re: Resizing existing sprites

Post by Baler »

Implement a scaler into DFU such as xBR scaling algorithm as an example. :?:
edit: probably overkill and not really a direct solution :?

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Resizing existing sprites

Post by King of Worms »

Baler wrote: Sun Mar 01, 2020 6:07 pm Implement a scaler into DFU such as xBR scaling algorithm as an example. :?:
edit: probably overkill and not really a direct solution :?
I wanted that for the paperdoll project, would have saved me a major headache... but it was too problematic at the time, even tho I wanted to buy those damn algos and just make someone to implement it :D

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

Re: Resizing existing sprites

Post by TheLacus »

The ability to resize sprites was introduced to allow replacement images to have significative scale or proportion differences with the original billboards; adding empty space to the texture itself is not an ideal solution for perfomance so support for xml files was added. Would you like the ability to provide xml files without textures? This is a feature that can be added if there is a request, but i'd like to understand what's the intended use case.

If you want something more open to customization you can rely on MobilePersonAsset component, at least for wandering npcs (enemies will also be supported in a similar way in the future).

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

Re: Resizing existing sprites

Post by Ralzar »

At the moment I’m working on the mod Meaner Monsters that changes the stats of enemies. Hopefully in the future (Hazelnut willing) I’ll be able to add new enemies.

Anyway, what I use this for at the moment is to resize enemies to visually match their stats. First of all werewolf/boars are rather small and now that I buff them, I also increase their size to 1.5.
I’ve also changed Dragonling_Alternate to be a “Large Dragonling” with boosted stats and an increased size.

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

User avatar
King of Worms
Posts: 4753
Joined: Mon Oct 17, 2016 11:18 pm
Location: Scourg Barrow (CZ)
Contact:

Re: Resizing existing sprites

Post by King of Worms »

Resizing enemies will be fantastic! And if we can add new mobs in a future, that will be a wet DREAM .)

User avatar
Baler
Posts: 225
Joined: Thu May 23, 2019 1:39 am
Location: Earth

Re: Resizing existing sprites

Post by Baler »

Being able to add new custom monsters is one of my dream mod capability.
I really hope to add a huge varity of new monsters ripped from other games.
here is one example: https://i.imgur.com/kRcLSRZ.png

Also I hope if when this is possible that we can adjust individual custom monsters addition to the world based on character level.

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 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?

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.
King of Worms wrote: Sun Mar 01, 2020 7:42 pm Resizing enemies will be fantastic!
This is already possible with xml files. I remember doing it for a very early version of my mod that removes spiders.

Post Reply