Slower game on Cheese 2 map

1 reply [Last post]
Wuzzy
Wuzzy's picture
User offline. Last seen 1 hour 14 min ago. Offline
Joined: 2012-06-20
Posts: 1062

I noticed a significant slowdown of the game when playing the map "Cheese 2" which I published here almost a week ago.

I don't have that 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 I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

Wuzzy
Wuzzy's picture
User offline. Last seen 1 hour 14 min ago. Offline
Joined: 2012-06-20
Posts: 1062

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 background 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 I accept personal donations in bitcoin. Heart 17fsUywHxeMHKG41UFfu34F1rAxZcrVoqH

Copyright © 2004-2017 Hedgewars Project. All rights reserved. [ contact ]