Page 1 of 38

32bit Graphics Extra Zoom Patch

Posted: 15 Jan 2008 19:26
by GeekToo
As I already told on the forums a couple of times, I did miss the extra zoom levels for the 32bpp graphics a lot. So now the graphics creation is progressing quite nicely, I decided to take a look at the code and try to create a patch to make the extra zoom levels possible again. It did cost me quite a lot of time, but I succeeded!
It is still heavily in development, but I could not wait any longer to present it to you.

Features
---------
-2 extra zoom levels
-transparency options give real transparency
-For now, it only works for the 32bpp-optimized blitter.
-Better zoom out graphics
-Bigger company manager faces
-32bpp company colours iso just 8 colours
-Interpolate 8bpp sprites when zooming in. (V13)
-User modifiable saturation and brightness of company colours

Difference with the now dead 32bpp branch
----------------------------
-in sync with trunk version 16366
-uses new tarloader as used in trunk, so png s must be pngcodec'd. The naming convention (similar to the 32bpp branch: default level zoom: nnnn_z2.png (nnnn is the sprite number), one level zoomed in nnnn_z1.png, 2 levels zoomed in nnnn_z0.png.
-no pixels are left when scrolling most zoomed in level, or moving a window over the viewport. This meant changing the use of the coordinate system, which took a lot of time.
-transparency options give real transparency
-reimplemented the spritecache of Egladil in the trunk
-reimplemented the sprite resizing of Egladil in the trunk, actually this meant only taking the idea, and completely reimplement according to the new situation.

Installation instruction
------------------------
up/downgrade trunkversion to the version indicated in the diff file name

apply the patch and recompile ( maybe someone can create a windows binary(testers, not the one I sent you, some changes were made afterwards), cause I want to spend my time on improving the patch, and not on porting to windows ( I develop on Gentoo Linux ))
put the tar file in the data directory (it's just an example tar, with the new grass)

modify openttd.cfg:
-set sprite_cache_size to 64 to prevent out of sprite memory errors

Done. Start openttd with the 32bpp-optimized blitter. It only works for this blitter. This can also be set in the cfg file, if you want it to be default.


Known bugs
----------

-clicking on cities etc does not work correct on zooms other than default
-smoke on zoom out levels is not correct
-minimap is not always correct
-no sound when you build a train track in most zoomed in level
-problem with foundation on traintrack half tiles
-once reported, when removing crashed trains, game crashes.

-------

Solved
--------
-names of cities etc are not updated correct on zooms other than default, esp. on zoomed out levels.(solved in v7)
-no colour remapping on transparency sprites (solution is known, I will start a discussion about this soon) (solved in v7)
-when loading the sprites, no check is done yet whether a higher level zoom sprite exists, and rescale that. Solution also known, just need to implement it. (solved in v7)
-plane shadows not correct (solved in v8)
-resize of sprites to zoomed out levels is worse than in 32bpp branch (solved in v8)
-implement improved company colour and recolour mapping algorithm ( that is, with more colours than just 8, as in trunk) (implemented in v7, for some colour variations)
-rescale of sloped sprites to half size leaves a black pixel (check this on the zoom out levels) (solved in V9)
-8bpp graphics do not rescale right when zooming outl (solved in V9)
-mixing 32bpp trunk tars with tar in the format of this patch does give graphical problems (solved in V9)
-applying company colours on 32bpp sprites on an RGB pixel value of (0,0,0) does apply fully saturated CC iso black. (solved in V9)

TODO/ Suggestion list
------------
-no optimization has been done yet
-code needs some cleaning up (like commented debug statements, partly improved in V9)
-implement other blitters
-user adjustable transparency
-improve hue of gray/white/transparent colours


------
A lot of thanks must go to the alpha testers for their useful input: Anathasios, Ben Robbins, Wacki, Soeb,
and someone who wants to stay anonymous. Although the bug list is still impressive, so I don't have to be bored the next weeks, they also told me the quality of the patch is equal to, or higher than the last 32bpp branch version, so it is fit to present to a larger audience.

So try it, give some feedback what needs to be solved first, and most important of all: have fun and post those zoomed in tars and screenshots!

Latest version: here

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 15 Jan 2008 19:33
by DeletedUser5
--- NEW POST ---
Isn't needed any more because there's wiki page already:
http://wiki.openttd.org/index.php/32bpp ... oom_Levels

---- OLD POST ---
So I decided to make a list of graphics posted in this theard, or anywhere else.
Tars
Wagons, train and rails and part of station - Graphics by Slye Fox and Ben_Robbins_ coded by Ben_Robbins_
New faces - Graphics by Ben_Robbins_ coded by Ben_Robbins_
Landscape for temperate - Graphics by Ben_Robbins_ coded by Ben_Robbins_ - download interesting graphics ( with or without grid lines ), unpack them to /data/sprites/trg1r and you can play with them. in game!
Desert tiles - Graphics by Wacki coded by Wacki
Tropical bank - Graphics by LordAzamath coded by Soeb offset tweaked by LordAzamath


---- OLDER POST ---
quote="GeekToo"
The naming convention (similar to the 32bpp branch: default level zoom: nnnn_z2.png (nnnn is the sprite number), one level zoomed in nnnn_z1.png, 2 levels zoomed in nnnn_z2.png.
quote

I guess you've meant in last nnnn_z0.png :D

quote="GeekToo"So try it, give some feedback what needs to be solved first, and most important of all: have fun and post those zoomed in tars and screenshots!
quote

So you mean we should post some tars with graphics?
Great work on that.

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 15 Jan 2008 19:51
by GeekToo
Soeb wrote: I guess you've meant in last nnnn_z0.png :D
Correct, I'll edit it.
Soeb wrote: So you mean we should post some tars with graphics?
Yes, absolutely, after all, what's the fun of this patch without beatiful graphics? So let's keep the 32bpp graphics development in the same tempo the 8bpp replacement is progressing.

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 15 Jan 2008 19:59
by DeletedUser5
Here are few first tars. All graphics by Ben_Robbins_.
Names say all. I did not resized any graphics.

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 15 Jan 2008 20:18
by Tesseract
nice trees. good work

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 15 Jan 2008 20:33
by GeekToo
Thanks,
And a couple of tars ( only deepest zoom ) more, graphics also by Ben Robbins:
Roads and bumpy grass

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 15 Jan 2008 21:08
by bazil14
im guessing this cant be used on windows yet :( and also i couldnt find the nightly 11813 only 11814 i could find that was near

cant wait to use it

Bazil14

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 15 Jan 2008 22:22
by broodje
Hmm, I fear there are some problems left. It compiled without any problems, but as you can see in the attached screenshot the result for the zoomed in levels are less than optimal ;).
If I zoom out the whole game hangs and won't come back to life.
I'm playing on vista btw.

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 15 Jan 2008 22:54
by GeekToo
Don't use the animated blitter, only the optimized blitter works ( I think that is the problem )
It is supposed to look like the attachment, tested on Gentoo Linux and Windows XP pro, and probably by some other windows variants too by the alfa testers.
If that does not work, provide a savegame, and what tars you used.

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 12:42
by DeletedUser5
Well GeekToo posted some of those graphics but I'll post them anyway. Graphics by Ben_Robbins_

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 12:52
by Bilbo
So finally solution for people with large screens compaining that they can't see these tiny things? :)

What about zoom-out? Is the zoomout same as in the "proper zoomout" patch, thus with some sort of antialiasing?

http://tt-forums.net/viewtopic.php?f=33&t=35311

If not, perhaps it would be nice to merge these two together :)

I'll try it and i'll see how many bugs I'll find :)

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 13:04
by DeletedUser5
Another .tar. Graphics also by Ben_Robbins_.

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 16:29
by DeletedUser5
Sorry for double post, but I've noticed a bug. All foundations work but there are some problems with those:

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 17:07
by broodje
GeekToo wrote:Don't use the animated blitter, only the optimized blitter works ( I think that is the problem )
It is supposed to look like the attachment, tested on Gentoo Linux and Windows XP pro, and probably by some other windows variants too by the alfa testers.
If that does not work, provide a savegame, and what tars you used.
Ahh, now I remember, you have to read before you complain.... Thanks, you were right, setting the blitter to optimized fixed the problem.

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 18:32
by bazil14
Could you please attach a link to the revision or the zip of it, because trunk version 11813 does not seem to be with all the other revisions on openttd... you know the site :wink: , i cant wait to use this patch and i bet it is good 8), keep developing it mate

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 19:12
by Nickman
I've just tried this and I must say it is looking really great!
Yeah, there are some bugs, but it's just cool to see the new zoom levels with the very detailed sprites!

Best of luck with the progress of this project!

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 19:26
by Wacki
Thank you once again GeekToo :P
Now, I am able use sprites from trghr so there is first creenshot from tropical climate ;)

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 20:16
by GeekToo
Bilbo wrote: What about zoom-out? Is the zoomout same as in the "proper zoomout" patch, thus with some sort of antialiasing?
Well, I do not know that patch in detail, so I don't know if it's the same. I'll check one of these days.
It does not use 'real' antialiasing, but takes an average (mean?) of four pixels, and then combines them to a resized one. The trunk version just takes one pixel out of 4, and skips the others, and that already makes a lot of difference.


Bazil14: you (or someone else) can build a Windows version by using BuildOTTD ( search on the forum or wiki ).

Soeb: thanks for creating the tars, keep going ! I've added the foundation problem to my bug list.

Wacki: looking very nice, this is a promising start of tropical in 32bpp.

All others, thanks for the nice comments, things will even improve in the near future (when my employer will let me have some time)

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 16 Jan 2008 21:34
by Nickman
I'll post a win 32 binary tomorrow ;).
Now it's sleepy time, I have an exam tomorrow so... :D
And I'm on another Pc right now...

Re: [32bpp] Extra zoom levels ! (revived)

Posted: 17 Jan 2008 02:11
by RMJ
not one single of these work :P how come?. The ones from the Openttdwiki works fine for me..

//RMJ