[Idea] Founding Custom Knighthoods

正在查看此主题的用户

That was Sich studios who did that - not taleworlds. In fact there is another product already announced by Sich studios - with a naval theme. Lets not talk about them too much though.
 
Good news, peoples: with Duh's help I'm (I think) making rapid progress in learning to code. If my completely amateur and barely informed guestimation is correct I'll have it done before... M&B 3.
 
Windyplains 说:
Setherythe 说:
Could you point out the relevant python file in native where the campaign AI behaviour is coded, so I can better understand the existing conditions for hiring/spending decisions of the AI? And then I'll develop/share some ideas (this would help me learn some things to start my own mod too, so I'd do it gladly).
Probably the most central part is "script_decide_faction_ai" found in module_scripts.py.  Though I will say if you're brand new to using the module system this is not a great starter script to learn from as it is very long and somewhat complex.  The "reference book" of the module system can be found in header_operations.py for most commands and header_trigger.py for triggers specifically.  The system itself isn't python, even though you have to install that, which is used to translate the module files into text files.  The module system language is fairly readable and fun to learn once you get a few basic concepts down.  Caba'drin's introduction to the module system syntax really is the best place to start for picking those concepts up.

Technically, yes, this seems to be the central part for faction AI, thanks; but I think the AI we should consider for building orders would be more suitable to integrate into 
插入代码块:
script_troop_does_business_in_center
. But I wasn't planning to get into the code and syntax myself, merely to put forth something plausible in "pseudocode" and analytical style, as per Caba`drin's request.



Now, my general ideas (AI-wise):
Note: in the below, "order" is used to designate any society/guild/troupe envisioned by OP



1. AI decision to build an order
1.1 Discussion
This could be either a faction object, or a lord's object. Let's consider the pros and cons of either approach
    a) If it's a lord's object: PROs - can decide this simply by adding a decision 'checklist'
插入代码块:
script_troop_does_business_in_center
, that is, we only need to worry about whether the lord in question wants to found an order, has the money to, is in a city where he can (probably defaulting to one that he owns, or a friendly town for lords that do not have a town fief, in the AI's case); CONs - excessive amounts of orders could theoretically spawn if this is not balanced properly (the cost for the order has to be sufficiently high, lord's reputation with the town should be taken under consideration or somesuch serious limitations to ensure that most lords will not be able to start a knightly order)
    b) If it's a faction's object: PROs - there will at most ever be 6 orders in addition to one potential player founded order; also, this could be decided in the same manner as accepting peace with reparations: does the king have money, does it suit the current global needs of the faction -  e.g. does the faction need more military might? - which would be the case if the faction's AI state is currently set as offensive or defensive campaign. CONs - (i) these would spawn almost at the very beginning of the game, so long as the faction is in any sort of war - might as well start the game with them already constructed in the faction capitals (the king owned towns); (ii) it would be somewhat unbecoming for the player to found one before he/she is at least war marshal if not leader of a faction when as far as the AI is concerned, it can only do so by faction decision.

Personally, I'd go with a), because it suits the spirit of Ogrecorps's suggestion - notably, that a knight/warrior should be able to found a knightly order/warrior society, regardless of nobility.

1.2 Suggestion - in pseudocode
note: operated/called from within
插入代码块:
script_troop_does_business_in_center
, where other 'business in center' is also called from, namely courting, recruiting, and collecting taxes.
Center is a city?
    if Y: Center is the party leader's city?
          if Y: Party leader meets conditions for wanting and able to build order? (I really don't care so much about the actual conditions, someone else fill in these
                blanks, they should be the same conditions as for the player as much as possible; Ogrecorps's and Deis's suggestions are quite good for filling in the
                blanks here in terms of "able to build")
              if Y: does this town already have a chapter house of the party leader's order?
                    if Y: Can't build.
                    if N: Start building!
              if N: Cannot and will not build an order in this center
          if N: Center is a friendly city AND liege of center is a friendly lord? (numbers should be played with and balanced for rarity of order spawning, probably a 
                50+ relationship with lord, and a 10+ relationship with city would be sufficient... if these numbers even exist for AI lords, which I'm not sure they do,
                so if they don't, then default to considering whether lord counts as 'friend' and city is part of same faction as the party leader)
              if Y: Party leader meets conditions for wanting and able to build order?
                    if Y: does this town already have a chapter house of the party leader's order?
                        if Y: Can't build.
                        if N: Start building!
                    if N: Cannot and will not build an order in this center
              if N (to both friendly city and friendly lord conditions): Cannot and will not build an order in this center
    if N: Cannot and will not build an order in this center

Define "Start building!" => A given amount of money is reduced from party's wealth, and all martial lords (and honourable lords?) in the party leader's faction get a boost in relationship with the party leader; a timer for the construction of the order's chapter house is set; party leader becomes master of order; order is named according to a random mix of two words the first from an adjective list, the second from a noun list, perhaps limited by culture considerations, if not too much trouble.

2. AI decisions on troop tree design for order
2.1 Discussion
Since the point for the player is customizing troops, the point for the AI founded orders should be the same. Customization allows for a set of troops that would enrich the player's army balance and tactical possibilities, but for the AI it should also be limited by cultural-tactical preferences. To simplify things, there should be a tactical theme for the AI founded order basically creating a troop tree with increasingly better troops of pretty much the same type (so ranging from, say, an order recruit that is an archer to an order elite that is also an archer; or from an order recruit that is a blunt melee troop to an order elite that is also a blunt melee troop - the quality of weapons, shileds and armour increasing with each tier of the tree, as do the attributes, skills, and proficiencies); or the AI could pick from among a number of templates. Mind the cultural limitations! Khergits Noyans would hardly ever pick to found a chapterhouse based on an infantry template, or Rhodoks on a cavalry template, etc. Also, the templates would be adaptable to cultural item selection - so for example, if the template specifies mail for the tier 4 troop, when a Sarranid AI lord picks to implement the template, the mail will be Sarranid mail; imodbit 'guarantees' can be used for the highest tiers, so that the highest troops of the order will have knightly or master-crafted stuff only. Anyway, this should be discussed by someone with suggestions for template design, I'm just gonna suggest how the AI uses such information. It would make sense that the AI would build an order corresponding to the current troop distribution in their party - so that either the AI will want to specialize the party (i.e. if 50% of party is infantry, well, pick an infantry themed order troop tree), or supplement a lack therein (i.e. if 10% is cavalry, pick a cavalry template to boost that proportion).

So technically, yes, the troop trees would be premade - a good number of them, which requires a lot of work, but I think far less than actually programming the AI to pick each item of equipment and each attribute/skill/proficiency for each level of the order's troop tree... Doing so randomly would be easy, but doing so with some degree of artificial "intelligence" would be an insane task.

2.2 Suggestion - in pseudocode
(this script is triggered when the first chapter house is built, regardless of where the order master is)
Get chapter master's faction
插入代码块:
culture
Consider troop composition for chaptermaster's party (get % infantry, % archers, %cavalry)
Randomly choose between specialization or diversification (consider that specialization means picking a template favouring the troop type with highest %, and diversification means picking a troop type with the lowest %, so this randomization returns one of the three
插入代码块:
troop types
)
Using
插入代码块:
culture
and
插入代码块:
troop type
, select the first template that matches both by using a try for range loop or some such to consider whether the templates fit the need.
Adapt template to cultural equipment.

3. AI decisions on troop recruitment/upgrading - including order troops
3.1 Discussion
Let's consider what recruitment into an order means. Basically, this depends on the nature of this order. If, like the historical crusader orders, or a thief's guild, the membership criterion is ideological (religion, or willingness to convert to religion, or the (im)moral prerequisite for commiting crimes), then recruits are apprentices, in no ways skilled in the ways of the order. If, like the Special Ops forces of various countries today or a fantasy-RPG stereotyped assasin's guild, membership in the 'order' is on the basis of ability and skill, this means a recruit is already a force to be reckoned with. I would suggest the former be true for all orders, because it simplifies things in terms of who can hire, and when can they hire.

(Alternatively, if we like complicated, there can be two kinds of orders - ideological and skill based orders; for skill-based orders, recruitment is moot: you wouldn't recruit order members, you would upgrade your high tier levy troops into order members, so for example, a Swadian Knight could be upgraded into a Knight of the Thundering Steed, then into a Sergeant Knight of the Thundering Steed, etc.; you would only have access to these upgrades if you are the order master.)

Now back to simple. If the order's lowest tier troops are apprentices of the order - so basically peasants that have been inducted to learn the ways of the order, and thus are no better than levy recruits (e.g. Swadian recruit, Rhodok tribesman, etc.) - then the recruiting is theoretically done through the order: the commander wanting to hire order members would ask the order to provide some fresh men from their order, and the order would give him a number of apprentices with a much smaller number of journeymen or the order who could instruct these apprentices in their development. So, you would never get only recruits, but rather a proportion of tier 1 troops to a proportion of tier 2 troops - let's say 5:1. Recruits are available in the same number as levy troops, because, basically, instead of the commander taking a peasant and telling him to get whatever weapons he has ready and wear his colours to war, the order is taking the same peasant, giving them the order's standard equipment for his tier, and sending him to fight under that commander. So practically, the AI lord is picking to recruit from a pool of available recruits in any village that is associated with the town with the/a chapterhouse, and the AI lord is either favouring levy recruits or order recruits.

3.2 Suggestion in pseudocode
(this is triggered under the
插入代码块:
#Recruit volunteers
section of the existing
插入代码块:
script_troop_does_business_in_center
)
Is party leader on recruiting business in a village associated to a town (as opposed to one associated to a castle)?
      If Y: Is that town housing the chapterhouse of (at least) an order? #see how this gets complex with multiple chapter houses and multiple orders spawning     
              chapter houses all over?
            If Y: Is the party leader the chapter master?
                If Y: The party leader will recruit between 50% and 60% (randomly) of available recruits as order recruits (e.g. Neophyte of the Thundering Steed),
                and the rest as levy recruits (e.g. Swadian recruits).
                (optional: even if not the order master, a party leader who is of honourable personality will be happy to have members of an honourable order join 
                him/her; this additional condition dould be implemented, but would require that the order have an honour rating, most likely one equal to the master's
                honour rating).
                If N: The party leader will recruit between 0% and 10% (randomly) of available recruits as order recruits, and the rest as levy recruits.
            If N: The party leader will recruit 100% levy recruits
      If N: The party leader will recruit 100% levy recruits


4. AI decisions on order master prioritizing the defense of chapterhouse(s)
Basically, if a chapter house is under siege, how will the order master react? Considering that the loss of cities is a serious threat, and that the faction AI already takes city defense very seriously, the whole faction would probably be defending any given chapter house indirectly, mainly because the defense of cities is super important. So I wouldn't worry about actually making any AI determinants for whether the order master should rush to the aid of his chapter house(s)'s towns when they are besieged, because either the faction will take care of it with a serious army-wide campaign, or his party alone won't be able to make a difference.


Well, I'm done, for now. Hope this helps.
 
As Windyplains suggested,  "decide_faction_ai"  is the faction-level checklist-style script.
For parties, refer to "npc_decision_checklist_party_ai" (both are found in module_scripts)

That said, cheers Setherythe for taking this to task quite so earnestly and quickly! Mighty impressive.

And excellent points, well thought through to boot. Thanks for taking the time.
 
Excellent ideas. Though from what Ive gathered, these are the issues that are preventing this idea from coming to life (just wanna confirm):

Large, time consuming task
Large amount of code involved
More important things need to be address before this

Am I correct? Any more info to add?


And if it hasnt been suggested already, would it be possible to recruit lords into your order, and have any number of events happen because of it. (i.e. name change, as in title, vassalage, increase in stats or items for both you and/or that that lord.)
 
rbcarter101 说:
Excellent ideas. Though from what Ive gathered, these are the issues that are preventing this idea from coming to life (just wanna confirm):

Large, time consuming task
Large amount of code involved
More important things need to be address before this

Am I correct? Any more info to add?


And if it hasnt been suggested already, would it be possible to recruit lords into your order, and have any number of events happen because of it. (i.e. name change, as in title, vassalage, increase in stats or items for both you and/or that that lord.)

First: I just bombed the OP with a larger, more complete vision of not only knighthoods but also all custom troops as I see them fitting into the game.

Second: This absolutely is a huge and time consuming task, hence the reason I am coming off the sidelines and learning to code myself. It will be a while before I produce anything worth including in this effort but considering how long it will take pretty much no matter what I think I'll be in time to take on the brunt of the work.

Third: I'd say absolutely not on recruiting AI lords to an order, even as a Chapter Master. I don't have any particularly good reasons but it just seems like that is opening a huge can of worms that is not worth the effort.

Fourth: There is a huge post a few posts above this one I haven't read. I'm going there now.
 
rbcarter101 说:
More important things need to be address before this
Not necessarily more important. The ideas have just been there before and most of them have a bit of time invested into them already. So they will have to get finished before we move on to sth. else.
 
rbcarter101 说:
Sorry to intrude on your reading, was just curious. Thank you.
You didn't intrude. I was writing up my huge new block of text and when I got here to post it I needed to post down here somewhere to let people know I had editted the OP to add like 2500 words and figured I'd address your questions too while I was at it. I hope I didn't come off snippy. My head's kinda spinnin trying to keep it all from getting out of hand.

Edit: just added forgotten renown requirement to knighthoods (400) as well as the fact that orders find and begin training their own recruits who continue to advance on their own in the chapter house - so long as the money is there to support them.
 
Ogrecorps 说:
forgotten renown requirement to knighthoods (400)
That seems rather low, imho the renwon should be like 700-1000. The lords wouldn't want some little known of adventurer who has some battle experience but they would want a experienced veteran every king wants as a vassal to help conquer all of Calradia :smile:
 
chargers1783 说:
Ogrecorps 说:
forgotten renown requirement to knighthoods (400)
That seems rather low, imho the renwon should be like 700-1000. The lords wouldn't want some little known of adventurer who has some battle experience but they would want a experienced veteran every king wants as a vassal to help conquer all of Calradia :smile:
I'm confused. The player character needs to have a minimum of 400 renown to form an order. The other lords and whatnot factor into that action not at all.
 
Ogrecorps 说:
chargers1783 说:
Ogrecorps 说:
forgotten renown requirement to knighthoods (400)
That seems rather low, imho the renwon should be like 700-1000. The lords wouldn't want some little known of adventurer who has some battle experience but they would want a experienced veteran every king wants as a vassal to help conquer all of Calradia :smile:
I'm confused. The player character needs to have a minimum of 400 renown to form an order. The other lords and whatnot factor into that action not at all.
I may not fully understand but aren't the orders placed in a vassals city? And isn't there a loss of relations when said order is placed in said city? If so then if the vassal was to allow a order in his city to create troops for him then you would think only the best of the best would be allowed this honor hence why I believe more renown would be require plus you have already stated an amazing comapnion was needed so why not make accomplishing this order even harder in raising the renown more than 400. Sorry if I'm not fully comprehending what you want but that is what i percieved from your OP.
 
chargers1783 说:
if the vassal was to allow a order in his city to create troops for him
The PC is not creating troops for the lord but for the PC.

chargers1783 说:
you have already stated an amazing comapnion was needed so why not make accomplishing this order even harder in raising the renown more than 400.
I see what you mean but a little known person who is great friends with a lord is still a viable character for starting a knighthood. Given the other challenges already in the way of creating an order I don't think renown needs to be added to it. However, when I eventually learn to code well enough to get around to that part if the general concensus is to raise it to something higher, I'll do it.
 
chargers1783 说:
Well good luck to you and I am really anticipating this mod/minimod, I don't know what you would call it.
I don't know either. I'm hoping it can/will be integrated into Floris (some pack or another) but I dunno.
 
Ogrecorps 说:
chargers1783 说:
Well good luck to you and I am really anticipating this mod/minimod, I don't know what you would call it.
I don't know either. I'm hoping it can/will be integrated into Floris (some pack or another) but I dunno.
Well one of the moderators sounded like he enjoyed the idea so all it needs to be is compatible to make an amazing mod pack even more godly.
 
Personally I would prefer a higher renown requirement, you get 400 while your still fooling around killing sea raiders for profit  :lol:
 
Ogrecorps 说:
chargers1783 说:
Well good luck to you and I am really anticipating this mod/minimod, I don't know what you would call it.
I don't know either. I'm hoping it can/will be integrated into Floris (some pack or another) but I dunno.
Before we (as in the devs) decide whether to include this or not, a basic version will have to be created and put to a test. Depending on what ogre decides, this version will be publically available so that it can be given feedback by the players.
 
后退
顶部 底部