Opened 10 years ago

Closed 9 years ago

Last modified 7 years ago

#2614 closed enhancement (fixed)

[PATCH] Clean up productionQueue in preparation for capturing

Reported by: sanderd17 Owned by: sanderd17
Priority: Should Have Milestone: Alpha 19
Component: Core engine Keywords:
Cc: Patch:

Description (last modified by sanderd17)

When capturing a building, you can't disable the productionQueue (it would make capturing useless). You also can't allow people to keep producing the units that were available before (as it would make mercenary-civs lose their uniqueness, and it will be hard to keep track of your army when you have 2 versions of every unit).

So I propose to have a list of trainable units per civ, and in the productionQueue filter those units on Class combos. With the newly possible AND and OR combinations. This should be as versatile as possible.

I did have to add some classes. Like I needed to make a difference between CitizenSoldiers that could be trained from the CC only, or also from the Baracks. Or to make a difference between the Champions available in the barracks (for which you need to research a tech), or those in the fortresses.

I also opted to not replace the current Entities list, but rather extend it. So if you have a special building that should really produce that one specific unit, and not other champions, you can still use the Entities list.

The proposal is about finished for the CC, fortress and barracks. Other unit producing buildings (temple, houses, docks, special buildings ...) are still mostly missing.

Please take a look at it

Also see #997 and #996 for the tickets about capturing.

Attachments (1)

prodQueue.diff (109.7 KB ) - added by sanderd17 10 years ago.

Download all attachments as: .zip

Change History (18)

by sanderd17, 10 years ago

Attachment: prodQueue.diff added

comment:1 by sanderd17, 10 years ago

Description: modified (diff)

comment:2 by leper, 10 years ago

Milestone: Alpha 17Alpha 18

comment:3 by mimo, 9 years ago

Milestone: Alpha 18Alpha 19

comment:4 by leper, 9 years ago

This seems to be mostly duplicated by the patch at #996. Can we close this one?

comment:5 by sanderd17, 9 years ago

After some consideration, it looks like this method is better than the one in #996. With this method, Carthagians or Persians will be able to capture the Mauryan elephant stables, and be able to train their own elephants in those stables. That's a lot better than training the Mauryan elephants, or nothing at all.

So I'll update this patch, and look into committing it. It doesn't affect #996 much, the productionQueue changes should just be taken out.

Currently, the biggest problem with this patch seems that the AI doesn't know which units it can train.

comment:6 by mimo, 9 years ago

May-be I missed something, but wouldn't it be simpler to remove the explicit mention of a civ in the ProductionQueue templates (i.e. units/maur_infantry_spearman_b -> units/{civ}_infantry_spearman_b).

That would be consistent with the fact that every civ can product only its own units in captured buildings, and that would make it also compatible with the way the AI works.

comment:7 by sanderd17, 9 years ago

@mimo, right, that could also work (though some changes to the productionQueue code and the AI are still needed).

Allowing to produce similarly named units would be almost as versatile as class-based selection, and also make the change easier.

comment:8 by mimo, 9 years ago

Hi sanderd17, to answer your question on IRC, yes your (reverted) changes from r16494 corresponds to what I had in mind. With such approach and your changes in ProductionQueue, the convention would be that units which we want to be produceable after capture should have {civ}_something while the ones we do not want should have the explicit mention of their civ, and there would be no need of an additional list of trainable units in the civ json file.

But as the devil is in the details, there is still one question to solve: what shall we do for example with champions. According to the civ, they are produceable in temples or gymnasions or fortresses or ... (also barracks, but this case is fine as we have special barrack templates). So if a civ which can't produce champions in its temples captures a champion-producing temple, should it be allowed to produce champions ? We have the same question for quiquereme which most civ produce in docks while cart needs a shipyard, and also for siege units (mace needs a workshop)..

comment:9 by sanderd17, 9 years ago

I think buildings should keep the types of units they can produce.

So if a dock can produce a quinquereme under the Romans, it should also be able to produce a quinquereme under the Carthaginians. It would make capturing special buildings more interesting.

Except the heroes maybe. I guess heroes should only be trainable from a building of their own civ. But thanks to them having very specific names, that's no problem.

comment:10 by sanderd17, 9 years ago

In 16506:

Fix the productionQueue for capturing. Needs the AI to be fixed in a similar way, and still needs template changes to see the full effect. Refs #2614

comment:11 by sanderd17, 9 years ago

In 16511:

Modify ProductionQueue of Civil Centres in preparation of capturing. Refs #2614

in reply to:  10 comment:12 by mimo, 9 years ago

Replying to sanderd17:

In 16506:

Fix the productionQueue for capturing. Needs the AI to be fixed in a similar way, and still needs template changes to see the full effect. Refs #2614

r16519 allows the AI to deal with structures from a different civ (for training and techs).

comment:13 by sanderd17, 9 years ago

In 16521:

Make barracks ready to capture. Refs #2614

comment:14 by sanderd17, 9 years ago

In 16524:

Make docks ready to capture. Refs #2614

comment:15 by sanderd17, 9 years ago

Owner: set to sanderd17
Resolution: fixed
Status: newclosed

In 16525:

Make all champion, hero and siege producing buildings ready for capture. Fixes #2614 (hopefully)

comment:16 by sanderd17, 9 years ago

Keywords: patch review removed

comment:17 by elexis, 7 years ago

In r18562:

Prevents training of unexpected units in buildings introduced in r18024, lets mace trains 2 mercs in captured stoa or in their own stoa for scenario map, fixes #4011.

Note: See TracTickets for help on using tickets.