-
Notifications
You must be signed in to change notification settings - Fork 231
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
Adjust extractor capping #3484
Adjust extractor capping #3484
Conversation
lua/SimCallbacks.lua
Outdated
for key, location in locations do | ||
if CanBuildInSpot(mex, msid, location) then | ||
IssueBuildMobile({builder}, location, msid, {}) | ||
for _, builder in builders do | ||
IssueBuildMobile({builder}, location, msid, {}) |
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.
why not IssueBuildMobile(builders, location, msid, {})
?
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.
Because of:
Sadly, the function IssueBuildMobile has some unexpected behavior: instead of giving all the units the same order (as you'd expect when doing a similar action as a player) it gives the orders to the nearest engineer to each structure. E.g., if you have all your engineers to the north of an extractor then only one gets to build all the storages. If you have them surrounding the extractor then four engineers start building each of the storages individually. Both are not acceptable.
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.
Interesting, thanks
Last argument is named ListOfCells, format is { {x, z}, ... }, used by game, set also inside brain:BuildStructure. |
Thank you for looking into it - that means that it wouldn't fix the issue described in my post (instead of all engineers doing the same order, the nearest are chosen and the rest is ignored). A few more ideas after WhenDayBreaks approached me:
(see down below) These are not as volatile as capping a pgen with energy storages and they're regularly used, but then through templates. |
Instead of pre-defining all layers, you now make a callback per layer.
It is working - see also the list of things you can now cap down below. BehaviorThe things we can cap and the number of clicks:
When there are engineers of multiple factions in a selection the faction with the most engineers is chosen as the 'main builders', engineers of other factions (or units that can't build storages, poor ACU) assist one of the chosen engineers. Note that a choice here was made: instead of looking at the tech level of the engineers or the build power, the one with the most engineers is chosen. In turn the code significantly easier / robust - if people want the highest tech engineer to take the lead then please make a post and provide rationale as to why it is better. PerformanceAnd of course: the approach is significantly more optimized in terms of table allocations. I don't think it will have a noticeable impact on the game performance, but everything helps. Question
Answer: turns out it is not possible. The blueprint field is not set when repairing something - we need that in order to determine the viability of capping. |
Will it be possible to disable the assist order somehow? |
The assist order with the extractor? For what reason? |
Of course not. assistance to engineers . You wrote Maybe you can do it as an add-on. Everyone will be able to edit the code as they like. |
We have three situations:
(See below) What are you proposing we do different? |
in all three situations, there is no order to assist. Builders who cannot build buildings do not receive orders at all. |
I'm not sure if there is a general consensus for that - what are the opinions of other people? I could also make this a game option (as part of the options menu) but it feels strange to add this (to assist or not to assist) as a separate option. |
And how about capping T1 Point Defense? |
I think no consensus is possible. There will be endless arguments. I would immediately build a cannon in the construction menu with capping. for default. |
Adding options for the sake of options isn't favorable either. There is no rush for this PR as I am trying to finish it before Monday, lets see what other people think on the matter. I would immediately build a cannon in the construction menu with capping. for default. |
Good. but I would make an option now. and did not return to this anymore. |
By the way. and other engineers will go too. that's exactly what they wanted to get away from. |
I see no reason for adding such an option, if you select your ACU with engineers and double click the mex to make storages then it means you want the ACU to make the storages so it should be assisting. |
Another issue with the assistance of engineers is the problem when you have a couple of engies assisting a mex already and when you issue a new assist command on the mex with a new engineer (that was not assisting the mex) sometimes it queues the storages even though it shouldn't. |
The task was to remove the order for assisting. |
There is no task - and if any - it is to improve the current situation. And that is what we're doing here. |
I don't know the language well. the translator suggested so. |
and then. everything remained as it was. |
That is fundamentally not true - the assist order is gone when you have a bunch of builders that can all the build capping structure. As stated in a previous post |
)))))) |
And the order for assistance is removed for the typical case - the one that is used 99% of the time when you have a group of engineers that can build the same structure that is used for capping. I'd say you got exactly what you wanted. |
Good find - it mentions the following list:
When discussing this feature with WhenDayBreaks we decided against using larger structures (anything with a larger footprint than a storage) because the amount of APM you save with that is minimal and the implementation requirements become significant. Do you want me to look into capping a t1 point defense? |
I've added support for a T1 point defense and I've made sure that it is harder to accidentally cap structures multiple times due to lag. |
Now we'd need to change the option description in the game options 😄 . |
Great stuff being done here as always and after playing around with it a bit on faf develop, I got some suggestions as well. |
* Adjusts how storages are build * Adding support for arbitrary capping * Refactoring mass extractor capping code * Refactor callback logic Instead of pre-defining all layers, you now make a callback per layer. * Refactor for documentation and performance * Add documentation, remove logging * Tweak behavior of capping * Update documentation (with thanks to KionX) * Add support for T1 point defense * Small performance tweak * Use skirt size instead of footprint size * Improve performance, add basic exploit prevention * Adjust double clicking logic slightly * Adjust logic slightly * Remove log statements * Add proper check in case we have an invalid layer due to mods * Bits and pieces of feedback from Balthazar * Fix typo
* Adjusts how storages are build * Adding support for arbitrary capping * Refactoring mass extractor capping code * Refactor callback logic Instead of pre-defining all layers, you now make a callback per layer. * Refactor for documentation and performance * Add documentation, remove logging * Tweak behavior of capping * Update documentation (with thanks to KionX) * Add support for T1 point defense * Small performance tweak * Use skirt size instead of footprint size * Improve performance, add basic exploit prevention * Adjust double clicking logic slightly * Adjust logic slightly * Remove log statements * Add proper check in case we have an invalid layer due to mods * Bits and pieces of feedback from Balthazar * Fix typo
* Adjusts how storages are build * Adding support for arbitrary capping * Refactoring mass extractor capping code * Refactor callback logic Instead of pre-defining all layers, you now make a callback per layer. * Refactor for documentation and performance * Add documentation, remove logging * Tweak behavior of capping * Update documentation (with thanks to KionX) * Add support for T1 point defense * Small performance tweak * Use skirt size instead of footprint size * Improve performance, add basic exploit prevention * Adjust double clicking logic slightly * Adjust logic slightly * Remove log statements * Add proper check in case we have an invalid layer due to mods * Bits and pieces of feedback from Balthazar * Fix typo
* Update changelog * Update changelog * Update changelog * Update changelog * Update changelog * Update changelog * Update changelog * Update changelog * Update changelog * Update changelog * Add more info for 3316 * Update changelog for #3417 * Added #3522 to changelog * Add #3523 to changelog * Add #3349 to the changelog * Add #3440 and #3512 * Add #3461 to the changelog * Update #3461 in changelog * Add #3419 to the changelog * Add #3525 to the changelog * Add #3526 to the changelog * Add #3490 to the changelog * Add #3527 to the changelog * Add description for #3527 to changelog * Improve description of #3490 to changelog * Add #3528 to the changelog * Add #3531 to the changelog * Add #3535 to the changelog * Add #3543 to the changelog * Add #3533 to the changelog * Add #3411 to the changelog * Add #3552 to the changelog * Add #3550 to the changelog * Update wording of #3447 in the changelog * Update wording of #3484 in the changelog * Add #3554 to the changelog * Add #3557 and #3558 to the changelog * Add #3582 to the changelog * Add #3581 to the changelog * Add #3587 and #3589 to the changelog * Add #3600 and #3601 to the changelog * Add #3599 and #3598 to the changelog * Add #3596 to the changelog * Add #3590, #3588 and #3586 to the changelog * Add #3567 to the changelog * Add #3597 to the changelog * Add suggestions of Rowey * Add #3606 to the changelog * Add #3605 to the changelog * Add #3604 to the changelog * Refactor changelog * Refactor changelog * Fix version of changelog * Refactor description: only applies to t2 artillery * Add #3607 to the changelog * Add translator * Add #3480 to the changelog * Add #3610 to the changelog * Add #3609 to the changelog * Add #3612, #3616, #3618, #3614 and #3613 to the changelog * Add #3602 to the changelog * Update changelog, add it to the game * Remove temp changelog * Add message from game team
This PR is based on #3483 which is based on this forum topic.
The current implementation is best described by looking at the changes of this PR, but for clarities sake:
Sadly, the function
IssueBuildMobile
has some unexpected behavior: instead of giving all the units the same order (as you'd expect when doing a similar action as a player) it gives the orders to the nearest engineer to each structure. E.g., if you have all your engineers to the north of an extractor then only one gets to build all the storages. If you have them surrounding the extractor then four engineers start building each of the storages individually. Both are not acceptable.Instead - we now queue the same order for all valid engineers. In turn, they all build the same storage. But they do not share the same build queue, e.g., manipulating the build queue (by removing a storage from the queue) is not possible when having multiple engineers selected, and it doesn't do the job when you only remove it from the queue of one engineer. Long story short: you'd need to give all the engineers a new order to cancel the storages.
@KionX Can you find out what the table (last argument) of
IssueBuildMobile
is supposed to do? It needs to be either{ }
or{ {x, y} }
wherex
andy
are some number - but it doesn't appear to be doing anything.