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

zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Post by zombie »

Hi.

The 32bpp inclusion is a very nice feature of OpenTTD. I found some 32bpp images, set the x_offs and y_offs settings to reasonable values for the sprites and they really look great. But there seems to be a performance problem when the 32bpp blitter is enabled. OpenTTD consumes up to 90% cpu capacity (45% on HT enabled system) while showing main screen. More frightening is the fact that the task manager shows a value of more then 1 GB of data being read (I/O bytes (read)) after about 5 minutes.

After starting a game it gets even worse. You have to be very patient when you zoom out or zoom in and the mouse movement es a bit rocky.

What's going on there? I don't think that my computer is the reason for the performance problem. My P4 3.0 GHz with 2 GB DDR400 dual channel memory should be adequate for every version of OpenTTD. The performance problems even exists, when there are no 32bpp sprites in the data subdirectory.

Kind regards

Zombie
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Post by Rubidium »

What happens when you set the value for sprite_cache_size in openttd.cfg to something higher, like 32 or 64?
zombie
Traffic Manager
Traffic Manager
Posts: 153
Joined: 19 May 2005 22:19
Location: Germany

Post by zombie »

Wow. I'd call that an instant reply. The game now runs smoothly with 32bpp graphics. Thank you very much.

Kind regards

Zombie
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

I wish I could say same about my ancient P3 :( Still it helped me a lot. Before 32bpp was practically unusable in my PC. Now I can run it better but it is still slow.

Note for those in similar state with me: Disable animation.

Thanks a lot Rubidium.
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 wish I could say same about my ancient P3 :( Still it helped me a lot. Before 32bpp was practically unusable in my PC. Now I can run it better but it is still slow.

Note for those in similar state with me: Disable animation.

Thanks a lot Rubidium.
Or just run 32bpp-simple :)
The only thing necessary for the triumph of evil is for good men to do nothing.
User avatar
Octopussy
Engineer
Engineer
Posts: 122
Joined: 01 May 2006 21:57

Post by Octopussy »

Where can I found a 32bpp toolbar which would run with the last nightlies ?
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Post by GeekToo »

AFAIK at the moment you can't directly.
You can pickup the 149 tar from this thread. Untar it, rename and PNGcodec the png and put them in the correct directory for the 32bpp sprites.
I think I will create a new tar for the 32bpp-trunk version soon, or maybe Dannys9 already has it covered, since he was busy with an auto-resize for the toolbar.
User avatar
dannys9
Engineer
Engineer
Posts: 29
Joined: 23 Nov 2004 17:16
Location: Dassendorf, Germany

Post by dannys9 »

I still *am* busy with it :D
I have only the 28x28 versions of the images. They look ugly when used with the nightlies.
English™ - powered by Dictionary™
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Post by GeekToo »

dannys9: I didn't mean to imply you stopped it ( english is not my native language ).

For Octopussy ( and everybody that wants to use it ), I've created a tar with the png's of JOED, with the correct names and png-codec'd.

You have to untar it in the bin/data/sprites/trg1r directory (at least on Linux, don't know if it's the same on Windows).
On Windows I guess a program like Winrar is able to do the un-tarring, on Linux use a simple tar xvf command in the trg1r dir.
Attachments
toolbar_trunk.tar
toolbar for 32bpp trunk version. Graphs by Joed. Note: does not work on 32bpp branch version
(50 KiB) Downloaded 277 times
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

I noticed you omitted the cursor. Was this done intentionally because it is no part of the toolbar? I suppose the aim is to change all the GUI, so we 'd better gather all the sprites under the name 'GUI' and not 'toolbar'.'Toolbar' was the first step.

:evil:
Fast Forward doesn't work again.
To DEVELOPERS:
32bpp replacements, unlike 32bpp branch, work only for original grfs?
If not, can you, please, provide us a way to get the sprite numbers of extra grfs like openttd.grf 'cause seems they change over time (Peter, DaleStan we had a discussion about it before. Any way to get it from the code?).
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.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

What happens if you put things in bin/data/sprites/openttd/ ?
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
dannys9
Engineer
Engineer
Posts: 29
Joined: 23 Nov 2004 17:16
Location: Dassendorf, Germany

Post by dannys9 »

Fastforward is defined in openttd.grf, so you need to place the file 57.png into data/sprites/openttd.

[edit]Beaten by seconds[/edit]
English™ - powered by Dictionary™
User avatar
GeekToo
Tycoon
Tycoon
Posts: 961
Joined: 03 Jun 2007 22:22

Post by GeekToo »

@dannys9 / DaleStan: thanks for the addition, it works.

@athanasios: there's no special reason for omitting the cursor, just started to make it a little easier to use 32bpp. By creating the tar, there's no need for everybody to do the same pngcodecing and renaming again: so more time's available to do other useful things.
We can name and order the tars anyway we want, or what is requested. There probably will be some discussion about it in the future.

@developers: the performance of the 32bpp was mentioned above, and increasing the spritecache size did help a little, but for me the generating of the world was incredibly slow( 256x256 tile world took over 8 minutes). So I took a little peek into the code, and made a dirty hack in genworldgui.cpp version version 10276 lines 905-911:

Code: Select all

//	MarkWholeScreenDirty();
//	SetGeneratingWorldPaintStatus(true);

	/* We wait here till the paint is done, so we don't read and write
	 *  on the same tile at the same moment. Nasty hack, but that happens
	 *  if you implement threading afterwards */
//	while (IsGeneratingWorldReadyForPaint()) { CSleep(10); }
This is certainly not a final solution: the progress window is not shown anymore during generating, but what's more important, the complete screen is not updated for every tree etc that is planted.
But it reduced the generation of the world to ~20 seconds!
It's just a suggestion, but maybe you can look into this.
User avatar
osai
Traffic Manager
Traffic Manager
Posts: 132
Joined: 22 Sep 2004 14:56
Location: 10.0.1.254
Contact:

Post by osai »

I tried this with MacOSX (10.4.10 + PPCG5),

untared to /data/sprites/trg1r/

And I started OpenTTD (r10295) with ./openttd -b 32bpp-anim
but it aborts with the following Message:

Code: Select all

/compile_farm/openttd/nightly/compile_dir/src/gfx.cpp:612: failed assertion `sprite->width > 0'
Abort trap
:(

Any Idea,
Greetz Osai
Rubidium
OpenTTD Developer
OpenTTD Developer
Posts: 3815
Joined: 09 Feb 2006 19:15

Post by Rubidium »

GeekToo wrote:But it reduced the generation of the world to ~20 seconds!
It's just a suggestion, but maybe you can look into this.
Generation of a 256x256 map takes 20 seconds? Even a full debug build on my computer at the lowest possible CPU speed takes way way less. What hardware are we talking about here?
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

Thanks DaleStan, thanks dannys9.
I didn't know it used number of grf in belongs too, because I already tried to use openttd with several numbers but I didn't use 57. I though it was an addition to original sprites like in branch. It is cool like that because all new grfs can have their 32 bpp sprites without much effort. Thanks developers. 8)

GeekToo: It is very odd. I tried 2048x2048 and it took me 12min with high industries and towns, low sea, on my ancient PIII .933 GHz hardware. 256x256 took only 12 sec. Nevertheless those 12 mins are too much. I'd appreciate such a patch for big maps.

osai: As you can understand, with what I 've stated, there was no problem with Win32 binary under WindowsXP. Please don't ask to check under Linux, I am lazy to reboot ... MAC: impossible, I don't have one :(
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.
DaleStan
TTDPatch Developer
TTDPatch Developer
Posts: 10285
Joined: 18 Feb 2004 03:06
Contact:

Post by DaleStan »

athanasios wrote:It is cool like that because all new grfs can have their 32 bpp sprites without much effort.
Indeed. It makes great sense. Until you add a sprite to somewhere other than the end of a GRF file. Then it suddenly becomes most horribly and violently wrong.
To get a good answer, ask a Smart Question. Similarly, if you want a bug fixed, write a Useful Bug Report. No TTDPatch crashlog? Then follow directions.
Projects: NFORenum (download) | PlaneSet (Website) | grfcodec (download) | grfdebug.log parser
User avatar
bobingabout
Tycoon
Tycoon
Posts: 1850
Joined: 21 May 2005 15:10
Location: Hull, England

Post by bobingabout »

so... these PNG files go loose in a directory?

this means it is impossable for me to continue running OTTD on my USB drive, i have to keep the FAT as small as possable, else my DivX player won't read the drive.

it already struggles to read it with a FAT of 100 files, the windows "System Restore" snapshots are a total nightmare, as are the "Thumbs.db" files... i've turned those features off for the drive on my home PCs, but when i use it on someone elses PC, it creates them all over again, which slows it down even more. i delete them all regularly...

can't you have something like a GRF, where it is all stored in a single file? maybe some kind of zip or rar file? and how does NFO type coding work for 32bpp sprites?
JPG SUX!!! USE PNG!!!
There are times when JPG is useful, TTD screenshots is not one of them. Please use PNG instead.

[/url]
User avatar
Zephyris
Tycoon
Tycoon
Posts: 2897
Joined: 16 May 2007 16:59

Post by Zephyris »

The current intention is to (eventually) allow packaging into one .tar per .grf, as was done in the 32bpp branch. Hence less files...
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Post by athanasios »

DaleStan wrote:"Until you add a sprite to somewhere other than the end of a GRF file."
So let us add it in the begining of the GRF file! :lol: :lol: :lol:
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.
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: No registered users and 21 guests