Flatlander
Species Developer
First, I would like to provide a video where I tested some of the FPS Dropping issues on the OTClient:
From other conversations and forum threads, it has been suggested the OTClient has the following issues:
Large Textures:
Bad Lighting System:
Bad Screen Drawing System:
If you have any information or ideas, regarding optimization to the graphics drawing capabilities of the OTClient, please share them here.
Also, if you think you could help with fixing any of the above issues, or know of tutorials on other websites that show how it should be done, post them here.
From other conversations and forum threads, it has been suggested the OTClient has the following issues:
- Large Textures: The way the OTClient draws animated items, and outfits is bad.
- Bad Lighting System: The way the OTClient draws lighting effects is bad.
- Bad Screen Drawing System: I've looked into this myself, when on the flash client, or Tibia 11 Client I notice that the client draws all of one texture at the same time.
Large Textures:
In regards to Animated items and Outfits:
I was told the OTClient currently works like this: (I have not verified this, but it sounds reasonable due to how the frames drop when displaying animated items or outfits)
When the OTClient has to draw an animated item, currently it saves the entire animation as one giant texture, and sends this to the GPU to be drawn, then the GPU draws the one frame of that animation needed for the screen.
What this means, is if you have an item with 5 animation frames, it sends the entire texture to the GPU each frame. (item is 32x32 pixels, 5 frames means 32x32x5=5120 pixel sized texture sent to GPU each frame)
Now, most computers can handle this, but the issue is when you start having multiple creatures with the smooth walking animation. (7 frame walking animation, players are 64x64 pixels, and there are 4 directions, so the OTClient makes a huge texture of 64x64x7x4=114688 pixels)
It then sends this texture to the GPU EVERY SINGLE FRAME. this doesn't count add-ons which is a separate template.
I was told this should be changed, so instead of making one giant texture per outfit, it should make a library of textures, then send the one needed for that frame, which would reduce the pixels sent to GPU per outfit per frame from 114688 down to 4096. (28x less pixels)
I'm not sure if this is true, but from what I have looked into by reading the OTClient source code it SEEMS true.
I was told the OTClient currently works like this: (I have not verified this, but it sounds reasonable due to how the frames drop when displaying animated items or outfits)
When the OTClient has to draw an animated item, currently it saves the entire animation as one giant texture, and sends this to the GPU to be drawn, then the GPU draws the one frame of that animation needed for the screen.
What this means, is if you have an item with 5 animation frames, it sends the entire texture to the GPU each frame. (item is 32x32 pixels, 5 frames means 32x32x5=5120 pixel sized texture sent to GPU each frame)
Now, most computers can handle this, but the issue is when you start having multiple creatures with the smooth walking animation. (7 frame walking animation, players are 64x64 pixels, and there are 4 directions, so the OTClient makes a huge texture of 64x64x7x4=114688 pixels)
It then sends this texture to the GPU EVERY SINGLE FRAME. this doesn't count add-ons which is a separate template.
I was told this should be changed, so instead of making one giant texture per outfit, it should make a library of textures, then send the one needed for that frame, which would reduce the pixels sent to GPU per outfit per frame from 114688 down to 4096. (28x less pixels)
I'm not sure if this is true, but from what I have looked into by reading the OTClient source code it SEEMS true.
Bad Lighting System:
From another post, it was suggested by Shadowsong that the best way to do the lighting would be using Vertex Shaders. But also he stated he changed the Necronia Client to use Fragment Shaders, then also reduced the amount of lights on screen to increase FPS.
I find that reducing the size of lights is the main thing that helps reduce frame rate drops.
I above in the video I created as a test, you can see that the animated effects with lighting cause more FPS drops than the animated effects.
I find that reducing the size of lights is the main thing that helps reduce frame rate drops.
I above in the video I created as a test, you can see that the animated effects with lighting cause more FPS drops than the animated effects.
Bad Screen Drawing System:
This is all from looking at how Tibia 11 client and the flash client draws items. It seems when these newer clients pull up a texture, it will use it to draw all of that item on the screen before going to the next texture.
In the following video, you can see (when the character teleports mainly) that the drawing system works as I stated above.
Here is a screenshot from 54 seconds into the video, where it is attempting to draw an entire new screen right after teleporting:
In the following video, you can see (when the character teleports mainly) that the drawing system works as I stated above.
Here is a screenshot from 54 seconds into the video, where it is attempting to draw an entire new screen right after teleporting:
If you have any information or ideas, regarding optimization to the graphics drawing capabilities of the OTClient, please share them here.
Also, if you think you could help with fixing any of the above issues, or know of tutorials on other websites that show how it should be done, post them here.