Switch to an 8bpp graphics mode and it'll cost almost no extra CPU time at all...athanasios wrote:Seems that animation slows the game a lot.
OpenTTD optimizations
Moderator: OpenTTD Developers
I think madman is working on including slope info in the map.Bilbo wrote:I have though of another optimization. During some tests with callgrind and one of my savegames I discovered that GetTileSlope in tile.cpp, some "complicated" function is eating 6.95% of cpu time, which is relatively lot.
I though of possible fix: cache slope data (1 byte/tile) in some array, this will mean max. 4MB of memory "wasted" on largest map (2048x2048), but those 7% of CPU cycles will be reduced to neglibigle lookups.
Do you think it is a good idea?
Actually, root cause of this was GetSlopeZ_Track in rail_cmd.cpp, eating 7.96 % of cpu time, so if this function can be rewritten to do more effectively without GetTileSlope (I have no idea what for this function is), things may be beter too and without any extra memory usage
Code: Select all
if (YouAreHappyAndYouKnowIt) {
ClapYourHands();
}
But rest of the desktop will be in 8bpp also which is .... not goodpeter1138 wrote:Switch to an 8bpp graphics mode and it'll cost almost no extra CPU time at all...athanasios wrote:Seems that animation slows the game a lot.

If you need something, do it yourself or it will be never done.
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
My patches: Extra large maps (1048576 high, 1048576 wide) (FS#1059), Vehicle + Town + Industry console commands (FS#1060), few minor patches (FS#2820, FS#1521, FS#2837, FS#2843), AI debugging facility
Other: Very large ships NewGRF, Bilbo's multiplayer patch pack v5 (for OpenTTD 0.7.3)
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
And how did you come into the conclusion that I didn't?peter1138 wrote:Switch to an 8bpp graphics mode and it'll cost almost no extra CPU time at all...athanasios wrote:Seems that animation slows the game a lot.
Actually it makes almost no difference if you use 8bpp-optimized or 32bpp-anim. The slowdown from animation applies to both modes. OK, when game progresses and AI players join the game 32bpp is affected more. But in the beginning of the game there is no difference. I may have to repeat what I said: Use Fast Forward in any mode with/without animation and you can tell the difference.

NOTE:
This behavior I tested in Windows versions.
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.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Because I guessed you'd confuse "blitter" with "video mode"...athanasios wrote:And how did you come into the conclusion that I didn't?
Under Windows, OpenTTD is only in an 8bpp mode when you run full screen and have fullscreen_bpp set to 8, or if your whole desktop is set to 256 colours.
He's like, some kind of OpenTTD developer.
true old-fashioned 8bpp palette-shifting through interrupts is very costly... I can imagine that in real 256 color mode the speed gain is only minimal.
Creator of the Openttd Challenge Spinoff, Town Demand patch
After action reports: The path to riches, A dream of skyscrapers
After action reports: The path to riches, A dream of skyscrapers
- athanasios
- Tycoon
- Posts: 3138
- Joined: 23 Jun 2005 00:09
- Contact:
peter1138: OK, you are right regarding running in 8bpp, I forgot to change my .cfg.
Yet you are wrong in suggesting this would improve speed with animation. There is a slight improvement but it is negligent, minimal as Korenn said.
So what I previously asked/suggested remains.
I was thinking about SimuTrans: Their approach to animation in sea is not ideal. Any other way for animation like gifs or multiple sprites?
OK, I am not a programmer, but I hope my reference to this, will triger a fruitfull discussion.

Yet you are wrong in suggesting this would improve speed with animation. There is a slight improvement but it is negligent, minimal as Korenn said.
So what I previously asked/suggested remains.
I was thinking about SimuTrans: Their approach to animation in sea is not ideal. Any other way for animation like gifs or multiple sprites?
OK, I am not a programmer, but I hope my reference to this, will triger a fruitfull discussion.

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.
"If no one is a fool I am also a fool." -The TTD maniac.
I prefer to be contacted through PMs. Thanks.
Who is online
Users browsing this forum: No registered users and 13 guests