Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Economy mode #1314
Economy mode #1314
Changes from 14 commits
ff3449b
0c7dc4f
1a1531a
16df88b
686c2ca
ab4388c
293c063
ddca852
1cf3e80
3acc6ce
f743cc9
f9a6af5
f6b007e
47e9ee7
099b96e
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to update each GF? or should we also say its calculated every "now and then"? specially for lower end computers these calculations are a heavy load at the moment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
besides this question everything looks good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you go for the "now and then" approach: I remember that there is a "statistics step". I guess that would be a good occasion.
@Flow86 Is the "heavy load" measured? If so, maybe we can improve that?
BTW: Do our toolchains support OpenMP? That would be a simple way to get some more speed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at this. Indeed, if I open the Economic progress window the framerate (without frame limiting) drops significantly. So I analysed and optimized a bit and even changed it to only update the iwEconomicProgress content at most once every second, because that's certainly enough (the statistics step seemed a bit too far apart).
But it doesn't make a significant difference in the frame rate. Indeed, when you do some perfomance analysis, I think you will see that the only thing for the ingame windows that takes any significant amount of time at all is drawing. And this seems to depend on the number and type of control elements displayed in the window, for example the tool window with tool ordering enabled is even much worse than the economic progress window. So I recommend that if the goal is to reduce the load while displaying ingame windows the Draw routine should be optimized, for example by prerendering/baking the whole windows except elements that change into textures or if possible by using vector buffers instead of directly drawing quads or whatever takes time there. But this is vastly beyond the scope of this pull request.
So tldr: I checked, and no, in comparison with the whole situation of drawing an ingame window these calculations are not a heavy load at all.
PS: But now I see that I broke my own test by not updating everything... oops, brb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be all good now again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought about this again, and to be honest, I don't like these last three "performance optimization" commits I made very much, because of stylistic and clarity reasons, and as I wrote it's probably unnecessary to have them. I regret them and think I will revert them tomorrow. Should also make it easier to review as @Flow86 already said before that it basically looks good.