Closed hackedpassword closed 1 year ago
You can disable auto city construction in settings
I don't want to disable construction, I want to disable certain construction.
Can we denounce our own cities
No but you can raze them. Should give the same satisfaction. You could also nuke them. If that's too slow or not brutal enough, there's a "raze-all", usually found as "shutdown" or "apps-uninstall" or somesuch.
Is that a hint? Ouch!
😈 just perpetrating your joke again
But - a "misfits" list would need to be persisted otherwise people would complain faster than light, and that's not quite trivial. Raises questions - per game per civ or per settings or (per game: clean. you want: global. possible conflict: mods)... One list or two to safely distinguish unit & building of same name...
If someone wants to try/test and can run from source: branch ConstructionBlackList - or as jar - to find the feature use right-click.
Shows the complications nicely:
😈 just perpetrating your joke again
LOL you know I got you. I'll check that jar out later maybe tonight at best, pressing priorities this day.
Implementation sounds tricky. I'm guessing then that the lists shown on the construction screen are generated with some inferred data structure magic rather than say a stored list of available construction. Makes sense, consequentially making more sense why a separate blacklist would have to be held.
Is there a structure for save games, some local per installation config that can associate data to individual saves? Hmm that wouldn't be optimal either when uploading saves.
I feel this idea may be proven technically impractical seeing the issues involved @SomeTroglodyte.
My review of your .jar - a new in-city menu that adds refreshing functionality!
I hope others give it a try! I'm certain not everyone will feel the same but since you have to long-press/right-click the menu, there's no UI change otherwise.
That's a frustration
Why? I thought that was the point?
4.
Oh, worth investigating.
That defeats the purpose - you're trying to prevent your other cities from consuming resources another needs, or, steer a city to a construction goal instead of it auto picking a poor build. Lots more reasons for individual city control.
Really nice work for this demo test! =)
- Disabling all buildings and wonders leaving units enabled will ignore units for auto-build next turn.
Can't repro. I start a small vanilla game, disable the Monument, enable autochooseproduction, and a Worker is queued as expected. How exactly? Can you demo with a save and the GameSettings.json?
That defeats the purpose - you're trying to prevent your other cities from consuming resources another needs, or, steer a city to a construction goal instead of it auto picking a poor build. Lots more reasons for individual city control.
Then I don't get it, not entirely. Prevent other cities from using up Uranium -> I disable Nuclear Plants, and queue it manually in the city I want it in. Or, disable Barracks and build it manually in the one city I got all other XP/Promotion giving buildings in. AI will follow up with Armory automatically. Sounds simple and easy. "goals" sounds more like implementing Queue templates - like "save this Queue as template" - "apply template" - "choose default city queue template"... Old idea and not extremely difficult, but a long chore. Hampered by the current Queue limitations. I had a queue code well over a year ago that was intelligent - queue a University after a Library, prevent reordering a dependent above a dependency, count max allowed correctly, and some more, but that went down some drain somewhere. I don't see per-city blacklists as very useful as you might spend a lot of time getting what you want, and might be quicker by disabling auto entirely and queueing everything yourself. Which that original menu (PR #9961) I used as UI helps with...
Github doesn't accept json files? lol!
Save game. In this state, Bejing produces nothing and maintains producing nothing.
Here's another good one - try removing "Nothing" from the active queue "in all cities". Unciv will be very upset about this.
I added "nothing" to the queue of all cities. Worked... for a little while then Unciv lost coherency and crashed:
D:\Dev\Unciv dev>java -jar Unciv-ConstructionBlacklist.jar
[LWJGL] [ThreadLocalUtil] Unsupported JNI version detected, this may result in a crash. Please inform LWJGL developers.
Exception in thread "main" java.lang.IndexOutOfBoundsException: index can't be >= size: 6 >= 4
at com.badlogic.gdx.utils.Array.get(Array.java:155)
at com.unciv.ui.screens.cityscreen.CityConstructionsTable.ensureQueueEntryVisible(CityConstructionsTable.kt:795)
at com.unciv.ui.screens.cityscreen.CityConstructionsTable.getQueueEntry$selectQueueEntry(CityConstructionsTable.kt:357)
at com.unciv.ui.screens.cityscreen.CityConstructionsTable.access$getQueueEntry$selectQueueEntry(CityConstructionsTable.kt:71)
at com.unciv.ui.screens.cityscreen.CityConstructionsTable$getQueueEntry$2.invoke(CityConstructionsTable.kt:362)
at com.unciv.ui.screens.cityscreen.CityConstructionsTable$getQueueEntry$2.invoke(CityConstructionsTable.kt:362)
at com.unciv.ui.components.input.ActivationActionMap.activate(ActivationActionMap.kt:56)
at com.unciv.ui.components.input.ActorAttachments.activate(ActorAttachments.kt:42)
at com.unciv.ui.components.input.ActivationExtensionsKt.activate(ActivationExtensions.kt:17)
at com.unciv.ui.components.input.ActivationListener.longPress(ActivationListener.kt:20)
at com.badlogic.gdx.scenes.scene2d.utils.ActorGestureListener$1.longPress(ActorGestureListener.java:58)
at com.badlogic.gdx.input.GestureDetector$1.run(GestureDetector.java:58)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.loop(Lwjgl3Application.java:208)
at com.badlogic.gdx.backends.lwjgl3.Lwjgl3Application.
The general problem with manual queuing comes when your empire is vast and it is no longer practical to micromanage. That's why I'm a big fan of selective automation. As I mentioned in discord, you might have hundreds of troops and a multifront war, I'm going to automate the entirety of say a couple/few unit types and let them run amok while I focus certain units against crucial targets. Meanwhile, I'm not trying to split my attention on if city J and city W are stealing my uranium or building a temple. We're at war people, what are you doing?! Definitely denouncing someone.
fyi, I super really appreciate you taking the time to give this feature a good go @SomeTroglodyte.
Having read how you were assigning to the queue, it makes sense now and I did try your way. So items are assigned then basically from disabled to the queue to isolate construction to that city. Now it makes sense.
That save should demonstrate nothing being superseded with a decision to build.
Adding the right click menu in 4.8 is so awesome. Of course in context to this thread, the more challenging aspect didn't make it (yet?) which is not only understandable, it is commendable that the new feature was implemented in a productive way that carries much of the feature with it.
I don't think players have yet to comprehend the addition. I guess that's the norm though I'm this moderately paced environment of updating.
What's the disabled construction feature looking like now? Might that move forward?
didn't make it
No, it's just 2 separate PR's. Menu was already in the queue and of course I used that UI. You think global disabling by name, as in the demo, is worthwhile to add or would you rather think "nah, per city or nothing"?
In my opinion, the matter that began this thread is the benefit goal. It remains a constant struggle with my own empire to handle themselves conducively to war objectives, not oooo I can build X yea that's a great option! without having consulted the strategic interests of other cities not the emporer/ss themselves. Wait, are we emporers? Has that ever been addressed?
btw the logical process described above would be a nice AI addition, verbalizing the thought (not a request).
I suppose another way to approach this could be flagging a do-not-build constructor, negative connotation where an internal list is referenced and any city that hasn't been told to build X, don't.
Per city has it's benefits also. When not caring about how other cities are going about their business, then you have some new cities and/or recently annexed cities and you want those to focus away from say culture or spirituality buildings, drop those from being queued and check back on them in 20-30 turns cause they're not really contributing anything to the civ at this point.
I started this thread for the former, so that's my vote. I see the second option as viable also, so both features would be great additions. If limited to one or the other, I'd point that call at the community.
Uh, found that last post hard to parse. I'll have to wrap this up as is, just ensure no known bugs. Had to redo the branch from scratch, merging resulted in chaos...
GameSettings
OK, just wanted to make sure no surprises. None in there.
"Nothing"
Treated "long ago", just didn't redo a fresh jar. Actually more of a problem with existing code, re-using it in new ways just brings the issue to light.
China save
Debugging... No, works as intended: militaryUnits > max(5, cities * 2)
says the civ has enough military (5 units 2 cities and at peace), and since there's no other units allowed, no wish to build units.
having consulted the strategic interests of other cities not the emporer/ss themselves
This is an open idea towards better AI.
hard to parse
A bit scattered, yes, verbalizing rationale can do that lol
works as intended
Hmm a formula, ok! Since the city/s have decided to produce nothing, would it be reasonable to produce a line under Cities in Notifications, something like "[city] reports no units need producing."? This seems similar to when terrain destruction occurred silently due to units configured to destroy terrain when attacking - a notification was included to convey what occurred removing confusion as to why the mystery destruction. Useful civ telemetry.
would it be reasonable to produce a line under Cities in Notifications, something like "[city] reports no units need producing."
... hmmm ... naaah. One, the decision is a bit removed from UI, two, at that point you don't know yet it won't choose anything else, cuz it's where a "pool" of worthwhile stuff is collected to then pick the best one. "Disable" removes at that stage from decision-making. AI uses the same code, only for them the blacklist is always empty.
Oh, and of course hotseat multiplayer share the blacklist - it's in GameSettings after all, so such ~masochists~ players would need to cooperate with this UI feature - or agree to ignore it.
multiplayer
WHAT? LMAO how would that even work?? I've never played unciv in multiplayer so I'll go with whatever. That concept amuses me to no end. Players better pay close attention....
We'll see how this works in-game when published. I'll thank/blame/applaud/complain trying the results of said madness. Ok not madness but useful exclusion policy. Looking forward to it. :D
Sounds like you're asking how multiplayer as a concept could work - no idea. Schizophrenia, contrary to public prejudice, is not really multiple minds in one skull...
@SomeTroglodyte
Your implementation of blacklisting is beautiful in execution.
Step 1: Disable construction of building/unit/wonder - > all cities respond, no one builds Step 2: Individual cities then may select to construct Step 3: Reestablish build across empire when desired
It looks good, feels good, plays good. :100:
Muchas gracias.
This may or may not be intended - using the add to all cities option includes puppet cities. That supersedes their queue, when usually their queue is out of the player's control.
includes puppet cities
Unintended! Facepalm-level. Good catch.
I love this menu.
@SomeTroglodyte fyi found a problematic situation.
258 turns in, discovered a half dozen buildings under Disabled left over from the previous game that my civ should have been working on.
The immediate problem here is that for the rest of this game, I'll have to monitor the Disabled menu for unexpected disabled buildings.
However, a workaround will be to start a new game in the Future era, clear the menu, return to the current game.
edit: Stepped through new games for each era. Found one where 2 buildings were not revealed as disabled in any later era. Only one occurrence.
I tire of fighting with my own cities not to build certain things, and sometimes they sneak it through anyway. Then for say uranium for example, hey where's that resource? It was here a minute ago? Someone prob built a reactor now I have to audit 15 cities and find the perpetrator. Can we denounce our own cities?? Let's do that.
So the proposed feature here is to long press the + (plus) on a construction, any unit, building, wonder, other, whatever. That item is then sent to another section like "Disabled", looking like any other section in construction, still with a plus like any other. If the player hits the plus on the disabled item, pops it back where it should be. Meanwhile, anything in the disabled section is not factored when a city is choosing constructions on its own.