Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SuperTux is very very slow #1051

Open
communist1917 opened this issue Jan 22, 2019 · 22 comments
Open

SuperTux is very very slow #1051

communist1917 opened this issue Jan 22, 2019 · 22 comments
Labels
common-issues:general-lag When it's about the game going overall slowly (not for lag on particular instances)

Comments

@communist1917
Copy link

communist1917 commented Jan 22, 2019

Always, especially in levels with rain.
OS: Manjaro Linux
Supertux version: 0.6.0, installed from official repos.

@qwertychouskie
Copy link
Contributor

What hardware are you on? Also there is a command line option to change the renderer, try the two options.

@communist1917
Copy link
Author

communist1917 commented Jan 22, 2019

opengl — very slow
sdl — much faster

@qwertychouskie
Copy link
Contributor

Can you post the output of glxinfo | grep "OpenGL version" and glxinfo | grep Core?

@communist1917
Copy link
Author

$ glxinfo | grep "OpenGL version"
OpenGL version string: 4.3 (Compatibility Profile) Mesa 18.3.1
$ glxinfo | grep Core
OpenGL core profile version string: 4.3 (Core Profile) Mesa 18.3.1

@qwertychouskie
Copy link
Contributor

What graphics card do you have?

@communist1917
Copy link
Author

NVIDIA Corporation GK208B [GeForce GT 730]

@qwertychouskie
Copy link
Contributor

You probably need to use the official Nvidia driver, seems that reclocking support on that card is still WIP (see NVE0 on https://nouveau.freedesktop.org/wiki/PowerManagement/).

@communist1917
Copy link
Author

communist1917 commented Jan 23, 2019

I have installed nouveau. Do you recommend to install proprietary video driver?

@HybridDog
Copy link
Contributor

Maybe qwertychouskie meant the proprietary driver when he/she wrote "official".

@qwertychouskie
Copy link
Contributor

Yes, sorry, that's what I meant. Unfortunately Nvidia cards and open drivers don't go well together.

@HybridDog
Copy link
Contributor

I've tried to find out why rain reduces the framerate.
I first thought that rain drop collision calculation is bad for performance, but when I disabled it, I still had low FPS.
Then I changed the code so that the raindrops do not move. When the drops are drawn on the screen I have low FPS, and when I walked right so that the drops are not drawn, the framerate increases significantly.

The raindrop drawing works like this in each frame:
Firstly, for each particle the draw_surface function is called.

for (auto& particle : particles) {
context.color().draw_surface(particle->texture, particle->pos, z_pos);
}

This function enqueues the texture, position, etc. in the drawing requests queue.
m_requests.push_back(request);

Then the requests are sorted and the drops are drawn one by one with the draw_texture function.

@HybridDog
Copy link
Contributor

HybridDog commented Nov 4, 2019

The tower_of_ghosts.stl level in the current ghost forest is so slow that I cannot play it: I get less than 10 fps.
In the Editor I noticed that this is caused by the lava tilemap.
@serano01, do you have the same problem?
tower_of_ghosts_slow.stl.zip

@serano01
Copy link
Member

serano01 commented Nov 4, 2019

Weird, I do. This comes from the lava tilemap? Last time I played it, it worked.

@HybridDog
Copy link
Contributor

After I have disabled the fire property of the two lava body tiles id 1700 and id 1705 in tiles.strf, I get a lot more frames per second.
In the code I noticed that a PulsingLight game object is added for every lava tile; disabling its draw function or reducing the window resolution did not increase the framerate, so the lag is not caused by rendering.
In this level, when the lava tilemap is not removed, there are ca. 2400 game objects (probably mostly PulsingLights); in another level there are only 240 game objects.
Maybe SuperTux is very slow when there are many game objects.

@Wuzzy2
Copy link
Contributor

Wuzzy2 commented Nov 27, 2019

I can confirm that Tower of Ghosts is extremely slow in 0.6.1 beta 1. It's so slow it's almost unplayable. I estimate 5-10 FPS.

I noticed something is written into my console:

[WARNING] ~/supertux/src/supertux/sector.cpp:221 [/levels/world2/tower_of_ghosts.stl] Tried spawning Tux in solid matter. Compensating.
[WARNING] ~/supertux/src/supertux/sector.cpp:221 [/levels/world2/tower_of_ghosts.stl] Tried spawning Tux in solid matter. Compensating.

@Ordoviz
Copy link
Contributor

Ordoviz commented Dec 22, 2019

@Wuzzy2 The warning is unrelated. It occurs when the spawnpoint is directly next to solid matter. I already fixed it: #1288

@HybridDog
Copy link
Contributor

#1301 #1300

@HybridDog
Copy link
Contributor

I don't know if this is related: There seems to exist a bug with SDL_PollEvent(): https://stackoverflow.com/questions/53644628/sdl-pollevent-stuttering-while-idle
(SDL_PollEvent in SuperTux)

@tobbi
Copy link
Member

tobbi commented Nov 14, 2021

I've improved the rain speed in the latest nightly. Please re-test.

@Semphriss Semphriss added the common-issues:general-lag When it's about the game going overall slowly (not for lag on particular instances) label Jan 24, 2022
@romulasry
Copy link

Still having a problem on the latest:

supertux2 --version
supertux2 v0.6.3

@tobbi
Copy link
Member

tobbi commented Jun 26, 2024

Try downloding a version from here: https://download.supertux.org/

@romulasry
Copy link

That fixes it. By chance are you going to make a v0.6.4 so distros fix it earlier than 0.7.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
common-issues:general-lag When it's about the game going overall slowly (not for lag on particular instances)
Projects
None yet
Development

No branches or pull requests

9 participants