-
Notifications
You must be signed in to change notification settings - Fork 1
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
Reduce cpu time for "find" operation #1
Comments
This has been partially solved. Most "working" tasks now use a "target" in memory. Sources are still being 'found' each tick. They need to be set as "creep.memory.target" in the not working state, and the script should be modified for this to function. |
This is solved now, right? if so, go ahead and close it. Reference a PR or commit that fixed it if possible. |
Not entirely, I thought I had put a comment on here describing it, but our
store creeps are still running a find on every tick. We need to modify
worker manager so that the store creeps can go to a target, fill it, and
then receive a new Target from worker manager without a trip to the source.
…On Thu, Aug 23, 2018, 4:45 PM Brian Schoolcraft ***@***.***> wrote:
This is solved now, right? if so, go ahead and close it. Reference a PR or
commit that fixed it if possible.
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub
<#1 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGh19G31ZsDckPeLCrRnj26Lxg4sI0cKks5uTxRMgaJpZM4VybyM>
.
|
Oh, and the sources are still being found every tick as well, I just packed the old logic into a function to make things cleaner and more modifiable |
Made a further improvement to this, finally allowing sources to be stored in memory instead of being found every tick. At this point, I am pretty sure finds are only being run when target is null and a new target needs to be found. Closing issue. commit cc29cf9 |
The first issue ever is finally closed ;) |
and there was much rejoicing! |
If you look at my creeps, most of them are running a "find" on every tick, which is expensive. We should make them use memory instead to find a target and store its ID only when switching from "not working" to "working" state or vice versa. Then they can move toward it until they can work/harvest and clear the target. If you start poking around, that would be a cool thing to work on.
The text was updated successfully, but these errors were encountered: