Engine and loading of 32bpp graphics is now in trunk!

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

User avatar
Ben_Robbins_
Tycoon
Tycoon
Posts: 1234
Joined: 20 Nov 2005 01:56
Location: Abu Dhabi, UAE

Post by Ben_Robbins_ »

Geektoo: Cheers for asking permission before using, much appreciated. Most of what I've posted in the past needs finishing, but any help with getting things complete would be great. (I'll pm you the full list rather than running threw everything in here)
Ben
MarkyParky
Engineer
Engineer
Posts: 89
Joined: 20 Nov 2003 15:20

Post by MarkyParky »

Can anyone please publish compiled WIN32 binary of pngcodec for us, poor guys that do not want to install VisualStudio only for compiling once in a year?

Thank you very much...
User avatar
dannys9
Engineer
Engineer
Posts: 29
Joined: 23 Nov 2004 17:16
Location: Dassendorf, Germany

Post by dannys9 »

I'm very fascinated by the new 32bpp feature. It's only problem so far is, that it supports 20x20px images for toolbars only.

So, I've played around with the code to set the toolbar size according to the image size. Look at the screenshots below. Both are r10170, first running 8bpp-optimized, second 32bpp-simple with the 28x28px iconset from joed.

What do you think of it? Is it worth further development and maybe a suggestion for trunk?
Attachments
8bpp-optimized
8bpp-optimized
Unbenannt, 1. Jan 1960.png (80.78 KiB) Viewed 1646 times
32bpp-simple
32bpp-simple
Unbenannt, 1. Jan 1960 #1.png (161.39 KiB) Viewed 1614 times
User avatar
dannys9
Engineer
Engineer
Posts: 29
Joined: 23 Nov 2004 17:16
Location: Dassendorf, Germany

Post by dannys9 »

MarkyParky wrote:Can anyone please publish compiled WIN32 binary of pngcodec for us, poor guys that do not want to install VisualStudio only for compiling once in a year?

Thank you very much...
Here you are...
Attachments
pngcodec.zip
(18.66 KiB) Downloaded 239 times
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Post by GeekToo »

athanasios and ben: thanks very much for your permissions. Now things really can get started for 32bpp!

I've created 2 screenshots in the toyland scenery (not my favourite, but we can change that now : :) )

The difference is not spectacular, but more important: it shows that 32 bpp png can be used correctly in-game, so when more graphics become available, the result will be fantastic imo.

@dannys9: I like the idea of bigger icons for the toolbar very much, but since 32bpp is in trunk now, some considerations should be made:
I dont think the new toolbar layout is nice for people that want to keep using the 8bpp graphs, or when they use the 32 bpp blitter but dont have the larger icons installed.

So the toolbar layout should be an option, or even better, code should be changed to make it possible to configure the GUI layout from e.g. a config file, instead of being hardcoded( big change I think).
Attachments
screenshots of same scenario with athanasios's pngs with embedded x and y offset
screenshots of same scenario with athanasios's pngs with embedded x and y offset
screenshot #1.png (39.83 KiB) Viewed 5652 times
screenshot of game without PNG loading
screenshot of game without PNG loading
screenshot2.png (32.22 KiB) Viewed 5647 times
User avatar
Digitalfox
Chief Executive
Chief Executive
Posts: 708
Joined: 28 Oct 2004 04:42
Location: Catch the Fox if you can... Almost 20 years and counting!

Post by Digitalfox »

dannys9 and GeekToo, nice work :)

But dannys9 , have you asked permission from joed for using the toolbar graphics? :wink:

Please everybody, always say if you have permission for using the graphics you show..
Doing it this way, we can all rest assured that respect and credits are given to the artists :)

dannys9 , all suggestions are welcome, I'm sure the dev's will appreciate :)
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

I agree about the toolbar that normal size should remain, or it will brake compatibility with 640x480. A larger one is usefull for high resolutions and there should be switches about which one to use on each standard resolution.
GeekToo: I noticed that in the 32bpp screenie there are footpaths and street lamps whereas in the first not. May I suppose you pressed "fund new buildings", to "announce" to the toyland inhabitants the construction of the first 32bpp buildings for their land? :wink:
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
User avatar
dannys9
Engineer
Engineer
Posts: 29
Joined: 23 Nov 2004 17:16
Location: Dassendorf, Germany

Post by dannys9 »

@GeekToo/athanasios: It's an autosize feature. If you use the 8bpp blitters or 32bpp with smaller toolbar icons, you will also have a smaller toolbar (as you can see in the first screenshot). This doesn't need any further setup. Just place the images of the size you like into the sprites directory and the toolbars will autofit to them.
peter1138
OpenTTD Developer
OpenTTD Developer
Posts: 1740
Joined: 30 Mar 2005 09:43

Post by peter1138 »

Nice idea, but really we need a generic method of window and widget scaling which works for all GUI components.
He's like, some kind of OpenTTD developer.
joed
Engineer
Engineer
Posts: 90
Joined: 30 Jan 2005 11:10
Location: Melbourne AU

Post by joed »

dannys9 no problem using my icons :) thanks for the screen shot.
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Post by GeekToo »

athanasios wrote:I agree about the toolbar that normal size should remain, or it will brake compatibility with 640x480. A larger one is usefull for high resolutions and there should be switches about which one to use on each standard resolution.
GeekToo: I noticed that in the 32bpp screenie there are footpaths and street lamps whereas in the first not. May I suppose you pressed "fund new buildings", to "announce" to the toyland inhabitants the construction of the first 32bpp buildings for their land? :wink:
You're right, I used the scenario editor, and it continues to build new structures, given enough time

@dannys9: the autosize sounds perfect, if it is tested it should be considered to be in trunk.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

And as update: today we added 32bpp-anim blitter, which is a blitter that brings back the palette animation, so you can enjoy the sea again as it was meant to be :) Isn't it wonderful? :)
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Post by GeekToo »

Cool, a 16.7 million color palette :D
User avatar
dannys9
Engineer
Engineer
Posts: 29
Joined: 23 Nov 2004 17:16
Location: Dassendorf, Germany

Post by dannys9 »

I've posted a diff for the autosize feature at the suggestions section, as it is off-topic here. Please feel free to test it.
English™ - powered by Dictionary™
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

TrueLight wrote:And as update: today we added 32bpp-anim blitter, which is a blitter that brings back the palette animation, so you can enjoy the sea again as it was meant to be :) Isn't it wonderful? :)
That was great news and I wanted to thank you PM, but then I read your post. I thought it wouldn't be easy task and would take look to solve or it was impossible and that would mean that we would have to draw a lot of new sprites. Once again thanks. :D

I would like the following to be clarified:
animation applies:
1. only TTD pallete 8bpp sprites?
2. any pallete 8bpp sprite?
3. even 32bpp pngs? (= I suppose not.)

If 2. is correct, that means that:
a. animation will get colors of sprites' own pallete?
b. animation will get colors of original TTD pallete?

Please clarify what is applicable now and what is the target.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

athanasios wrote: I would like the following to be clarified:
animation applies:
1. only TTD pallete 8bpp sprites?
2. any pallete 8bpp sprite?
3. even 32bpp pngs? (= I suppose not.)
In the 32bpp-anim blitter, palette animation works for both 8bpp as 32bpp images, the same was as it did in 8bpp. If you read the 32bpp specs, you see that there is a so called 'mask' or 'remap' channel. This remap channel is needed to support both 8bpp and 32bpp. It in fact is a 8bpp image, but only those pixels that match something useful in the old 8bpp palette. In case of animation, it means that if you put a pixel there with a palette value > 217, it will animate in exactly the same way as 8bpp did. In the same way you can get company colours. The alpha channel is used if the remap channel has a value not-equal to zero.

Of course this means that palette animation in 32bpp is still limited to the same set as the 8bpp was, but it was never the intension to extend it, only to allow it. And of course it uses the TTD palette (as we don't want to see any difference if we load either a 8bpp blitter or a 32bpp blitter when using 8bpp graphics).
The only thing necessary for the triumph of evil is for good men to do nothing.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

Some other good news: 32bpp-anim is faster in palette animation on sdl + linux than 8bpp-optimized is. Depending on how many animation is going on in your current screen, it changes from 30% faster till 5% faster. So that in fact is very good news: our 32bpp palette animation blitter is faster than our 8bpp palette animation blitter (which is the default one from the original game, FYI).

This doesn't mean that normal 32bpp drawing is faster, as it isn't. It is about 2-15% slower (depending on what it is drawing) than 8bpp drawing is. But, for sure it isn't that slow as my primary testing suggested :) We might say 32bpp works very well :)
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Post by GeekToo »

TrueLight wrote: If you read the 32bpp specs, you see that there is a so called 'mask' or 'remap' channel. This remap channel is needed to support both 8bpp and 32bpp. It in fact is a 8bpp image, but only those pixels that match something useful in the old 8bpp palette. In case of animation, it means that if you put a pixel there with a palette value > 217, it will animate in exactly the same way as 8bpp did. In the same way you can get company colours. The alpha channel is used if the remap channel has a value not-equal to zero.
Trying to understand this, but did not quite succeed. Do you have a link for the 32bpp spec ( probably the png-spec )? Can you give an example how to use this when creating images ?

BTW, nice to hear the animation works fast on linux ( I'm on Gentoo). And indeed, the 32bpp does work very well, compliments
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

GeekToo wrote: Trying to understand this, but did not quite succeed. Do you have a link for the 32bpp spec ( probably the png-spec )? Can you give an example how to use this when creating images ?
Read docs/32bpp.txt :)
The only thing necessary for the triumph of evil is for good men to do nothing.
TrueBrain
OpenTTD Developer
OpenTTD Developer
Posts: 1370
Joined: 31 May 2004 09:21

Post by TrueBrain »

The only thing necessary for the triumph of evil is for good men to do nothing.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 6 guests