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

Change: Smooth AI CPU usage by spreading out AI ticks in relation to competitor speed. #7262

Closed
wants to merge 2 commits into from

Conversation

PeterN
Copy link
Member

@PeterN PeterN commented Feb 22, 2019

Before this change, all AI ticks are run on the same game tick, causing a burst of CPU usage. Overall usage will not change, but stuttering with heavy AI will be reduced.

…competitor speed.

Before this change, all AI ticks are run on the same game tick, causing a burst of CPU usage.
@PeterN
Copy link
Member Author

PeterN commented Feb 22, 2019

Urgh, regression tests fail on the result of random :-)

@PeterN
Copy link
Member Author

PeterN commented Feb 22, 2019

Not happy with this, it's still very lumpy in some cases.

@PeterN
Copy link
Member Author

PeterN commented Feb 23, 2019

My alternative idea of splitting the max_opcodes and spreading them out over game ticks (and taking account of waiting the appropriate number of ticks when suspended) sort of works but is a bit too intrusive, and also messes up AIs which query their remaining ticks, as the value is too low.

@stale
Copy link

stale bot commented Mar 25, 2019

This pull request has been automatically marked as stale because it has not had any activity in the last month.
Please feel free to give a status update now, ping for review, or re-open when it's ready.
It will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale bot added the stale Stale issues label Mar 25, 2019
@stale stale bot closed this Apr 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Stale issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant