Slower game on Cheese 2 map

1 reply [Last post]
Wuzzy
Wuzzy's picture
User offline. Last seen 3 days 20 hours ago. Offline
Joined: 2012-06-20
Posts: 1301
I noticed a significant slowdown of the game when playing the map "Cheese 2" which I published [url=http://www.hedgewars.org/node/4195]here[/url] almost a week ago. I don't have [i]that[/i] high-end hardware, but I never ran into problems on any other theme and any other map. Can anybody else confirm this problem on this particular map?
Hi, I am a Hedgewars developer. Smile
Wuzzy
Wuzzy's picture
User offline. Last seen 3 days 20 hours ago. Offline
Joined: 2012-06-20
Posts: 1301
For your interest: I chatted with nemo today and this is what I've found out: The slowdown happens because I used a 1px×1024px sized background Sky.png for the background. Why just one pixel wide, you ask? That's because it is just a gradient. There's no point to make a wider image! But this has caused the slowdown. After I scaled the background to 64px×1024px everything is smooth again. Version 0.2 of "Cheese 2", which I posted today, includes this workaround. Actually, it is not the [i]background[/i] which causes the slow down, it is the engine itself because the background is rendered inefficiently if it is very thin. nemo explained to me that each the repetition of the background is inefficient because it causes a lot of more function calls than it should. And because my background was only 1 pixel wide, it caused thausands of function calls, one for each repetition. I am not really a coder, so don't throw a melon after me if I got some things messed up. Big Grin As far I know this problem has not appeared on the bug tracker list so far.
Hi, I am a Hedgewars developer. Smile
Copyright © 2004-2023 Hedgewars Project. All rights reserved. [ contact ]