-
Notifications
You must be signed in to change notification settings - Fork 65
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
Unable to build any constructionSite of a type, if structures + sites of that type are higher than RCL allows #59
Comments
The concept of keeping track of changes in game state that affect the validity of other actions mid-tick-processing is one that is absent from the engine architecture, as far as I've discerned. Due to that, the engine has no way to prevent you from performing the last build step on all the sites in the same tick other than preventing you from doing it to any of them. |
Other creep actions seem to get resolved through conflicts just fine, but this one would probably be a lot more involved to resolve. |
I am new to the engine source. Can you give me an example of other conflicts that aren't resolved by just processing all of them? |
That might be what I mean I guess, where the processing takes it into account so that only the allowed combination of results happens. Like two creeps trying to move to the same tile, or two creeps trying to withdraw the same resource from a container, etc. |
withdrawing is easy, because all the necessary information exists in a single entity. simply modifying the target's storage values during the first withdraw causes the later withdraw to [silently] fail. creeps moving is a special case, with conflicts in the processor/intents/creep/move.js intent handler resolved by processor/intents/movement.js resolving the build/rcl conflict would require something akin to the creep solution |
Why is the building completion blocked at all though? Blocking construction from completing doesn't appear needed since the system supports dynamically disabling Structures as needed to get the room to a legal level already. If a room gets downgraded with too many extensions built then some of them get disabled (flashing red tint filling the square they're in). Same with labs if the room drops under 6, and all similar situations. |
Probably because having the structure as a disabled structure instead of a construction site gives some slight advantages, at least if we ignore the increased cpu cost and code complexity of dealing with disabled structures. |
@WolfWings so you're suggesting allowing the excess structures to finish building, then disabling some of the built structures? That's not a terrible idea, but would open a minor exploit where a player could build a whole new RCL worth of extensions/etc ahead of time, and have them become usable the moment the controller upgrades. |
That would also be a huge advantage for defense, since it's easier to destroy a building that doesn't exist, or stomp a construction site, than it is to tear down already built up structures. |
Exactly. |
@sparr and @tedivm No you wouldn't, because you still can't place ConstructionSite points in excess of your RCL. createConstructionSite will return ERR_RCL_NOT_ENOUGH in that case. :) But for example:
Suddenly not being able to complete ANY of those extensions seems broken. The game already prevents excess Structure's from being used, so how does allowing successfully placed ConstructionSite's to always be able to be completed allow for any exploits? My thinking is that once you successfully place a ConstructionSite? Let it be completed and converted to a true Structure. |
Good point, re it being prevented. OK, I retract my objection. Allowing completion and then immediately disabling some of the structures (as if they had existed at the time of the RCL loss) seems like a reasonable solution here. |
Agreed. |
Now, someone who cares has to code it and PR it :) |
I'm tracing through the code to write one up actually, why not? I already have 2 minor PRs in, I enjoy tackling lots of small things when I can, good way to learn the codebase! :) |
engine/src/utils.js
Line 340 in 14ddd4a
For example, if a room had previously been RCL 3, and somehow ends up being RCL 2 with no extensions currently built, and 6 constructionSites for extensions placed (before the downgrade of controller happened), then it is not possible to perform the last build action on any of the sites.
The text was updated successfully, but these errors were encountered: