Incorrect rendering of terrain graphics (fixed)

Having trouble with the game? Report issues and get help here. Read this first!

Moderator: Forum Moderators

Forum rules
Before reporting issues in this section, you must read the following topic:
Post Reply
User avatar
inferno8
Art Contributor
Posts: 974
Joined: February 18th, 2008, 5:32 pm
Location: The Abyss

Incorrect rendering of terrain graphics (fixed)

Post by inferno8 »

Hello, I want to report graphical errors in BfW 1.13.10 (10.0.15063).

The game renders terrain images used in [terrain_graphics] tag incorrectly in some cases. I noticed this while porting my add-on to 1.13.x.
tlus01issue5.jpg
I have run some tests and it looks like this issue happens only for images without alpha channel and/or with indexed colors. Adding alpha channel and/or disabling indexed colors fixes all errors but I would like to know if this is intentional (so from now on only images with alpha channel are permitted for usage as terrain graphics) or if this is a bug. These glitches are present on both Windows and Linux machines.

To help others recreate this bug I have prepared a micro-add-on in form of a multiplayer scenario (with all necessary files). I am attaching it here for those who are interested:
Attachments
Multihex_Test.zip
(4.69 MiB) Downloaded 468 times
Last edited by inferno8 on April 17th, 2018, 7:21 pm, edited 2 times in total.
Creator of Era of Magic
Creator of To Lands Unknown

Support me on Ko-fi! https://ko-fi.com/inferno8
User avatar
Pentarctagon
Project Manager
Posts: 5531
Joined: March 22nd, 2009, 10:50 pm
Location: Earth (occasionally)

Re: Incorrect rendering of terrain graphics (1.13.10)

Post by Pentarctagon »

Can you check which version of SDL you have? This looks fairly similar to this issue.

Edit - tested with the attached example, and the issue still occurs for me with SDL 2.0.5.
99 little bugs in the code, 99 little bugs
take one down, patch it around
-2,147,483,648 little bugs in the code
User avatar
inferno8
Art Contributor
Posts: 974
Joined: February 18th, 2008, 5:32 pm
Location: The Abyss

Re: Incorrect rendering of terrain graphics (1.13.10)

Post by inferno8 »

Sorry, for the late reply. I have SDL 2.0.4 and the problem still persists in BfW 1.13.11 running on Win10 (10.0.16299) :?
Creator of Era of Magic
Creator of To Lands Unknown

Support me on Ko-fi! https://ko-fi.com/inferno8
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: Incorrect rendering of terrain graphics (1.13.10)

Post by vultraz »

Honestly, I can't help but feel this must have something to do with SDL being more sensitive to indexed colors... I have indeed confirmed that re-saving statues.png as a standard, RGB color, non-indexed file fixes all the visual issues - the hex bleedthrough and that weird red aura both.

This change wasn't intentional, but I cannot guarantee a fix. At present, it's best just to re-save the image.

EDIT: actually, turns out I was able to track down the problem (with jyrki's help). The fix will be in 1.13.12 :)
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
inferno8
Art Contributor
Posts: 974
Joined: February 18th, 2008, 5:32 pm
Location: The Abyss

Re: Incorrect rendering of terrain graphics (fixed for 1.13.12)

Post by inferno8 »

I can confirm the issue with indexed colors has been fixed for BfW 1.13.12 (SDL 2.0.4). Thank you! :)

It looks like the game still has problems using terrain graphics without transparency (non-rgba pngs, jpgs and similar).
Details:
Fortunately this issue can be easily fixed by enabling transparency via image editor and saving as png or tiff (at the cost of increased file size - sometimes tenfold).

I think it would be good to make the engine treat non-transparent images as if they had this additional information layer. This could reduce size of some add-ons even by 50% (especially mine) Nevertheless I am happy with the current implementation. It changes a lot in comparison to the previous development version.
Creator of Era of Magic
Creator of To Lands Unknown

Support me on Ko-fi! https://ko-fi.com/inferno8
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: Incorrect rendering of terrain graphics (fixed for 1.13.12)

Post by vultraz »

Heh, I was just going to write here that I couldn't reproduce the issue, then realized I was testing on master where rendering has been significantly refactored already (one of the major changes that will be in 1.15/1.16 is that large multi-hex images like yours will now be drawn all at once instead of broken up into hundreds of hex-sized images. But that's not relevant right now :P).

I'll test again on 1.13.12+dev and see what I can do. :)
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
vultraz
Developer
Posts: 960
Joined: February 7th, 2011, 12:51 pm
Location: Dodging Daleks

Re: Incorrect rendering of terrain graphics (fixed for 1.13.12)

Post by vultraz »

I have a fix (thanks again to jyrki for pointers). It will be in 1.13.14. :)

EDIT: 1.13.14 now live with the fix.
Creator of Shadows of Deception (for 1.12) and co-creator of the Era of Chaos (for 1.12/1.13).
SurvivalXtreme rocks!!!
What happens when you get scared half to death...twice?
User avatar
inferno8
Art Contributor
Posts: 974
Joined: February 18th, 2008, 5:32 pm
Location: The Abyss

Re: Incorrect rendering of terrain graphics (fixed)

Post by inferno8 »

I can confirm the fix works for 1.13.14 - the problem no longer exists. Thank you! :)
Creator of Era of Magic
Creator of To Lands Unknown

Support me on Ko-fi! https://ko-fi.com/inferno8
Post Reply