Skip to content
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

Refactor the legions code #16 #85

Merged
merged 4 commits into from
Aug 9, 2015
Merged

Refactor the legions code #16 #85

merged 4 commits into from
Aug 9, 2015

Conversation

rquinio
Copy link
Collaborator

@rquinio rquinio commented Aug 2, 2015

I've refactored the legions code to solve some issues/discrepancies, could you please review ?

I've discovered that:

  • vassalized mercenaries can always be hired by their liege, whatever the allow conditions
  • count tier mercenary companies cannot be destroyed

I've extracted the list of Romance cultures (that can re-organize legions and won't cause legions to disband). There was some condition on Armenian and some religions in the previous allow trigger, I'm not sure what to do with this.

Changes:

  • Use always = no for legions hire trigger in landed_titles, so that they are not visible from other rulers. Vassalized mercenaries are always hirable by their liege, whatever the allow trigger.
  • Remove condition on e_wre, e_ere or k_soisson: any Romance culture character with matching historical Roman title can re-create the legion.
  • Removed usage of global flags, as they were missing in title history, and not really needed anyway.
  • Move completely_controls from potential to allow trigger, to give clue to the player if some parts are not controlled
  • Workaround count tier mercenary companies that cannot be destroyed, by making the legion independent (without possibility to be hired by anyone).
  • Reduced legion disband condition from completely_controls title, to has title and has Romance culture, so that legion won't be destroyed by temporary revolts, or minor land loss.
  • Extract duplicated Romance culture condition to scripted_triggers
  • Add 'organize legions' as a feature of Romance cultures
  • Add missing decisions / events for Eastern legions
  • Add localization for creation and disband legion narrative events.
  • Merge WtWSMS_western_legions_on_restoration.txt into WtWSMS_legion_events.txt
  • Split decisions/events for multiple legions at a time (Dalmatia and Africa) into multiple decisions/events, for consistency and because cost was unaffordable.

- Use always = no for legions hire trigger in landed_titles, so that they are not visible from other rulers. Vassalized mercenaries are always hirable by their liege, whatever the allow trigger.
- Remove condition on e_wre, e_ere or k_soisson: any Romance culture character with matching historical Roman title can re-create the legion.
- Removed usage of global flags, as they werer missing in title history, and not really needed anyway.
- Move completely_controls from potential to allow trigger, to give clue to the player if some parts are not controlled
- Workaround count tier mercenary companies that cannot be destroyed, by making the legion independent (without possibility to be hired by anyone).
- Reduced legion disband condition from completely_controls title, to has title and has Romance culture, so that legion won't be destroyed by temporary revolts, or minor land loss.
- Extract duplicated Romance culture condition to scripped_triggers
- Add 'organize legions' as a feature of Romance cultures
- Add missing decisions / events for Eastern legions
- Add localization for creation and disband legion narrative events.
- Merge WtWSMS_western_legions_on_restoration.txt into WtWSMS_legion_events.txt
- Split decisions/events for multiple legions at a time (Dalmatia and Africa) into multiple decisions/events, for consistancy and because cost was unaffordable.
@loup99 loup99 changed the title Refactor the legions code Refactor the legions code #16 Aug 2, 2015
@loup99
Copy link
Owner

loup99 commented Aug 2, 2015

Looks good! Changed the title in order to make it reference to the dedicated issue. I will let @EWattman look into this, as he was the one who reimplemented them and discussed the conditions.

@EWattman
Copy link
Collaborator

EWattman commented Aug 3, 2015

The Armenians should be able to use them as well, if they are properly Roman Christian or Hellenic Pagan (+Heresies), in essence within the Roman Sphere of Influence and not the Persian. I want the Legions to be restorable by King-level Romans or above. Meaning Emperors and Pretender Kings, so that Soissons can restore them, but currently no one else.

Also, could some event-thing be added so that the newly-restored legions fall under the control of however owns, for example, the Duchy of Mesopotamia and not automatically the liege?

@rquinio
Copy link
Collaborator Author

rquinio commented Aug 3, 2015

  1. I'll add the Armenian culture, but I don't understand the condition on religion: are there any non-Christian or non-Hellenic Armenian ruler in some start dates ? If we really need a condition on religion, then for consistency it should also apply to all Romance cultures, shouldn't it ?

  2. Given the amount of money needed to take the decision, I would be pissed off if the control of the new legion was given to another ruler :-)
    Maybe a solution would be to restrict taking the decision if holding BOTH the duchy and de jure kingdom title (we can inform the player via the allow conditions) ? It would solve the requirement of being at least king tier at the same time.

  3. There is an additional case: in case a Kingdom/Duchy title is transferred to another ruler, what happens for the legions ?
    For gameplay, transfer should not be forced: ideally new ruler should have a big opinion malus because the legion is "de jure" to him, which should be an incentive for AI/player to transfer it. But not sure if the malus works out of the box for mercenary companies, or it needs to be managed manually by events. I'll check that.

@EWattman
Copy link
Collaborator

EWattman commented Aug 3, 2015

  1. Armenia is Christian at start, but as it is a Persian subordinate, it is at risk of converting to Zoroastrianism. And we don't want Armenians with Persian loyalties running around with roman armies now do we? And religious requirements for Romans are not neccesary, because a Roman is a Roman, regardless of religion.

2/3. This is my way of simulating the Legions being stationed throughout the Empire, rather than having them all at Constantinople, making the Emperor invulnerable. Ideally, the Legions would be vassalized under however controls their home territory, which in-game translates into whoever controls the Duchy/Kingdom-title they have as creation-requirement.

@rquinio
Copy link
Collaborator Author

rquinio commented Aug 3, 2015

  1. There don't seem to be any Armenian legion in there yet, so this can be handled later.
  2. I've committed the change for kingdom titles.
  3. I've done some testing, the "de jure" doesn't work well for county level titles: de_jure_liege command has no effect (similar to destroy_landed_title), so no real solution...

@EWattman
Copy link
Collaborator

EWattman commented Aug 3, 2015

That is too bad, because the current Dejure Kingdoms that we have, the Dioceses, were more civil in administation than military. For example, the IV Parthica, in the 5th century, is under the command of the governor of Osroene in Edessa, not the Comes in Antioch. And Osroene is a duchy in the game.

Look, if we can't find a solution to that problem, we will return the Legions to Duchy-level for the sake of game mechanics.

@rquinio
Copy link
Collaborator Author

rquinio commented Aug 4, 2015

I'll do some more testing, as apparently de_jure_liege only works with n+1 tier.
What I tried and doesn't work was the following:

c_legio_i_dalmatia = {
  de_jure_liege = k_dalmatia
}

@EWattman
Copy link
Collaborator

EWattman commented Aug 4, 2015

Have you tried the d_salona or d_andautonia? We could spread the non-historical Provincial Legions out all we want.

- Set de_jure_liege via province history (note: hast to be a duchy tier title)
- Workaround destroy/deactivate of count tier titles not fully working, by killing the owner.
@rquinio
Copy link
Collaborator Author

rquinio commented Aug 4, 2015

Ok, it works when using duchy as de_jure_liege !
The behavior is the following:

  • If a legion is not owned by its dejure liege, that liege will get the standard -25 "Wants control of the Legio xxx" opinion modifier.
  • When transferring a duchy title to another ruler, any existing dejure legion will transfer automatically (even without checking "include lower titles") - probably because it's landless.

So I've set their duchies for some historical legions, using title history (you'll need to double check / balance). Not sure about the legions controlled by the emperor directly: could be either dejure to the capital duchy, or have no dejure. The requirement completely_controls = e_byzantium for some decisions might be a bit too strong.

Also I've found a workaround for the destroy_title not working (need to kill the title owner).

@loup99 loup99 added this to the 0.9.6 milestone Aug 8, 2015
@loup99
Copy link
Owner

loup99 commented Aug 9, 2015

I fixed that conflict, and Erik said it was OK to merge so I will merge it and close down.

loup99 added a commit that referenced this pull request Aug 9, 2015
@loup99 loup99 merged commit 6474cf2 into master Aug 9, 2015
@loup99 loup99 deleted the bugfix/legions branch August 9, 2015 17:36
IhateTrains added a commit that referenced this pull request Aug 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants