Are you, in fact, a pregnant lady who lives in the apartment next door to Superdeath's parents? - Commodore

Create an account  

 
Building queues

So, I have a new idea on how to implement build queues for the game.
We had 3 problems preventing it before :

1. No space to store the queue data.
This can be solved by a workaround.
Currently buildings are stored in form of an array with each element containing -1 for not built, 0 for replaced, 1 for built, and 2 for destroyed (rubble) buildings. If I were to say numbers 10+X means that building is in the Xth place in the queue, then we managed to store the queue. This however requires going through every single building related procedure, making sure they check "building status =0 or 1" for the building existing. Those that instead check for "building status not equal to -1 or 2" would need to be changed.
This means units can't be queued, but I think that's fine. You usually don't know in advance how many of those you'll want anyway - depends on how your wars are going. (and most often once a city starts producing units, it keeps doing that for a while)

2. Checking requirements for queuing.
The above workaround actually already solves this, if we make an exception and for the "buildings available for production" procedure only, and nowhere else, we consider buildings in the queue as already built (so replacing the "status =0 or 1" with "status isn't -1 or 2", the opposite of what we normally need to do), then building requirements would automatically work. We need to only do this for buildings, not units.

3. User interface
This one is tricky, but I think we can manage with the existing two buttons on the production screen.

"cancel" would no longer be a thing, instead it would have the function "clear queue". 
"Ok" would have two functions. If a building is selected, it adds the building to the queue.
If nothing is selected, then it leaves the production screen, so to build a building without queueing, you'd need to press it twice.
And finally if a unit, housing, or trade goods are selected, it would produce those immediately, replacing whatever is currently produced, or pushing it into the building queue (if it was a building). The building queue would keep existing, but won't have an effect until production is switched away from these options.
We would however need a way to have "nothing" available for selection, maybe by clicking anywhere else that's not a building, unit or button.

Two other changes will also be necessary - conquering a city will need to clear the queue to ensure AI players never meet the queued buildings since we won't make the AI used the queues obviously but it might confuse them (since it's a building with an effectively invalid status code from the AI's perspective), and, when a building is destroyed, the entire queue needs to be scanned for anything that requires that building, and if one exists, the destroyed building has to be queued immediately to the front of the queue instead of the usual end of it. (alternately, the entire queue could be cleared but that defeats the purpose of queues being an easy way to deal with earthquakes and meteor storms.)
Oh and of course the most important, when the building completes, it'd need to start building the next in queue automatically instead of showing the usual "completed" window.

Do let me know if there are any flaws in my logic and this can't be done. If there aren't any, then space might still be an issue (we'd need to add a lot of new code, to at least 3 different places, but then it's worth a try.
Reply

I would actually like to have something where if earthquake or meteor storm destroy a building, that automatically puts the city into examine mode.

For instance, if I'm building a cathedral for a city that only few resource production, and earthquake destroys the magic mart, I want to immediately change back to magic mart.

But I don't want to put every destroyed building to front of queue. If I'm building a fighters guild in a city I've recently used transmute to get adamantium I probably don't care about rebuilding a shrine.
Reply

I don't see why a Cathedral would already be in your queue if you are building a fighter's guild and used transmute there?
Destroyed buildings would only get added to the queue if something already in the queue required them. (or, we can make it optional to add only those, or everything.)
Reply

Ok I didn't explain well.

I would like when an overland spell destroys a building, to always be brought to that city on the next turn, regardless of queue or what I'm building, or whether the thing I'm building needed the building that got destroyed.

Basically, when the spell (or comet) destroys a building, I just want to be brought to that city no matter what so I can reevaluate immediately.

It's too easy to miss destroyed buildings otherwise.

Right now that doesn't happen, so meteor storm is HORRIBLE. And the queue proposal you suggest could actually make it worse, if the queue was long and meteor storm destroyed something really important, that wasn't required by the queue.

So I don't just want whatever is destroyed to be added, nor do I only want whatever is destroyed to be added if it's required. I want to make that choice ever time, without searching every city during meteor storm in case they lost something.

Something like any building destroyed by an overland effect sets the current building to either destroyed (if it was destroyed) or 19 'bring player to the city on the next turn no matter what the current building being built is'.
Reply

Oh I see. Basically, a separate feature request - building destruction marking the city for a production interrupted prompt even if it didn't actually interrupt your production. That's doable, in theory, although I'm not entirely sure, that thing had plenty of problems in the past. Once queues are done and working, remind me to try adding this, as an optional setting. I'd like to point out though, adding queues is exactly for the purpose of making these prompts happen significantly less often than currently, not the other way around. I feel they take a very significant amount of playtime to respond to them all and generally makes me lose track of what I was doing. Still, getting prompted on earthquaked cities would be pretty useful (meteor storm, more like annoying).
I guess easiest solution would be to just clear the existing information from the production interruption prompt (which can only happen if buildings are destroyed anyway) and just make it show a generic "buildings were destroyed in this city" prompt instead. You can see what exactly on the city screen from the rubble.)

Okay, I'm starting to think this is definitely worth adding. Lost alchemist guilds going unnoticed when the city is damaged in battle is not very fun.

Do note however, you CAN'T add buildings to the front of the queue manually. Only if you clear the entire queue. Since anything in the queue counts as "already built" for purposes of what building you can click on to add to the queue, you can only add to the end of it. 

btw interesting find, I see the code currently supports setting fame requirements for buildings (but none of them have any), probably a leftover from the old Armorer's Guild discussions. I'm not going to bother keeping this functionality, as I'm remaking that entire procedure to create space for the rest of the feature.
Reply

Yeah my thought was that alchemist guild and amplifying tower are horrible to lose without noticing (admittedly 7 skill usually doesn't make or break things, but when you expect to be able to cast your third flame strike, and suddenly can't, that can be really aggravating when you don't know which city the meteor storm destroyed the building in).
Reply

Bad news : the rubble gets cleared away at the end of the old turn and the city prompts happen at the start of your next one. So while I managed to make the game show the city, you won't see what was lost, so in the end you have to remember the monthly report anyway, making the whole thing kinda useless (in fact, outright bad - at least if you click the city after reading the report, you'll know what to do. If you are just asked to do it without information, not so much.).

I wonder if swapping the order is possible, I see no reason why it wouldn't be.
Reply

Can there be a prompt like 'something was destroyed in this city' when that triggers, so at least the player knows to search?

Or if that city was set to array 19, the prompt could list all buildings with that value, and then clicking ok on that prompt sets the value of the city to 'not built' or whatever the standard value is.
Reply



Forum Jump: