The fact that Vezzra reported the mad adventure optimization actually reducing his framerate for the tech tree regardless of the zoom level made me suspect it was something to do with the drawing of the arcs. I did toy with them when initially figuring out the buffer based approach. The result of the toying was in fact inefficient since it recreated many small buffers for the arcs every frame. So here is a patch that stores the tech tree arcs in one large buffer and updates it only when necessary.
The performance benefit for me is close to the margin of error of my measurements, but it may be different for others. Regardless, TechTreeWnd.cpp is quite a large file so I think this patch is worth it just for moving the arc drawing logic to a small, focused file.
[patch] Tech Tree Arc Caching
Moderator: Committer
[patch] Tech Tree Arc Caching
- Attachments
-
[The extension patch has been deactivated and can no longer be displayed.]
Any code by me in this post is released under GPL 2.0 or later.
- Geoff the Medio
- Programming, Design, Admin
- Posts: 13603
- Joined: Wed Oct 08, 2003 1:33 am
- Location: Munich
Re: [patch] Tech Tree Arc Caching
Applies, builds, and runs (at least on 7758) OK for me. On the tech tree, showing all techs, zoomed to just close enough to see text, I get 15 FPS, and one step out (so no text) I get 25 FPS (using the integrated GPU in low power mode) or 33 FPS and 52 FPS (using the integrated GPU in balanced power mode).
Re: [patch] Tech Tree Arc Caching
Builds and runs fine on OSX. Windowed mode, showing all techs, zoomed in so that text is shown: ~60 FPS. Zoomed out so that text isn't shown anymore: ~68 FPS. Graphic card: AMD Radeon HD 6490M.
Re: [patch] Tech Tree Arc Caching
Let this not be forgotten without some thought. Are those numbers higher with the patch? Lower? Same? Opinions on this otherwise?
Any code by me in this post is released under GPL 2.0 or later.
Re: [patch] Tech Tree Arc Caching
The patch shifts my tech tree fps range (for all conditions I checked) upwards by about 3%.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: [patch] Tech Tree Arc Caching
Ripe for commit, I'd say. Anyone any objections?
Re: [patch] Tech Tree Arc Caching
I agree, no objections. I hesitate to do it myself though, since I wouldn't really know how to add the new file to the MSVC and OSX projects.Vezzra wrote:Ripe for commit, I'd say. Anyone any objections?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0
Re: [patch] Tech Tree Arc Caching
As no objections have been raised, I made the necessary updates to the MSVC and Xcode project files and committed the patch.