Problem with inventory backgrounds and bodies

Discuss modding questions and implementation details.
Post Reply
Quellion
Posts: 2
Joined: Wed Jan 04, 2017 2:59 pm

Problem with inventory backgrounds and bodies

Post by Quellion »

Hello, newcomer here. Always been a big fan of Daggerfall, and I'm having a blast modifying things so easily.

I was toying with image replacement to see how everything worked and stumbled with some problems with the UI graphics.

As you can see in the image below, changing the character page image was really easy and worked great, but the landscape backgrounds that are used here and in the inventory don't seem to work. I placed a modified dark elf mountain background in the same "img" folder as the general character page image, and named it "SCBG03I0.IMG.png", but it doesn't show.

Also, the body image only seems to work correctly when it's the same size as the original, the sample below it's double in size and this is the result.

Image

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

Re: Problem with inventory backgrounds and bodies

Post by TheLacus »

Hi Quellion, thanks for the report. I will look into this :)

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

Re: Problem with inventory backgrounds and bodies

Post by TheLacus »

Ok, this is the situation. Since both the UI image you succesfully replaced and the character backgrounds have a picture frame, these last ones are edited and the borders removed. To do so they are handled in a different way than others images, and didn't benefit of the modding system.
From the next build it will be possible to replace them, but you need to take care of providing your custom images already without the frame.

For what concerns the body, the situation is more complicated. Beside the graphical artifact -which is caused by a wrong assumption of the size and easily solvable- the various components of the paperdoll are blitted in a single image. This system works when we use only vanilla textures which have fitting resolutions, but if we add custom images, they result bigger proportionally to the resolution. Likewise, if we increase the resolution of the resulting image, vanilla textures end up being too small.

The only solution i can think is to keep things as is if the option for custom textures is disabled, otherwise use a different panel with an higher (fixed) resolution, and somehow upscale with a point filter all images that haven't a got custom altenative. But it doesn't really sound like an optimal solution so maybe is better limiting ourselves to same-resolution replacement for now.

Interkarma sure has a better view of the situation and we can ask him what he thinks about this :)

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Problem with inventory backgrounds and bodies

Post by Nystul »

what i do not understand is that the positioning/scaling of most body parts is incorrect but not all (the head is displayed correctly, so are the hairs and the armor pieces as well). Does the head use a different positing method than the rest of the body parts?

btw, I love the replacement graphics for the character screen! Good work Quellion! And good work TheLacus for making replacements possible (i am confident that you will finally soon have everything fixed)!

Quellion
Posts: 2
Joined: Wed Jan 04, 2017 2:59 pm

Re: Problem with inventory backgrounds and bodies

Post by Quellion »

Cool, having the frame in each background was a bit awkward anyway, not sure why they did it that way. :lol:

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Problem with inventory backgrounds and bodies

Post by Interkarma »

Objects blitted into paper doll need a few bits of data:
  • Image itself.
  • Offset. This is part of the header in TEXTURE.xxx files. It defines where images should be positioned on paper doll.
  • Draw order. This is in the item template. It defines the correct order to draw items in.
Unfortunately a basic image swap will have trouble in this situation because it also needs correct offset meta-data in addition to the image itself. Mixing classic and high-res bitmaps on the same paper doll is possible, but will bring its own challenges. Draw order should remain basically the same however.

It might be possible to fake this if replacement images are always a fixed size multiple of the source image (e.g. 2x or 4x). Then the texture replacer can just scale Offset accordingly. This isn't that flexible though, best to add a metadata format to go with images (such as an XML file) to compensate for standard bitmap formats not having Daggerfall-specific metadata.

Such metadata will also come in handy when replacing 2D billboards, which also need Scale and Position values to ensure they fit correctly in environment (feet aligned to ground for example).

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

Re: Problem with inventory backgrounds and bodies

Post by TheLacus »

Thank you for your answer Interkarma :)

Post Reply