Aggressive Map AI

正在查看此主题的用户

zyzyx

Recruit
Hi, I'm fairly new to modding.  I am trying to make the map ai a bit more aggressive. The idea is to make war between factions a bit more fast paced (currently it seems like all that ever happens is a castle changes hands every now and then, maybe I havent played long enough but it's kind of slow for my tastes - I dont like the idea of the player being the sole force doing almost all the capturing). 

So I thought I would try to implement something like: When two factions are at war with one another they attack each other constantly, as much as possible. I have a few questions about this:

Is this feasible/possible? I'm not sure how the ai works.  I have a little programming experience, but trying to analyse module_scripts.py is a little confusing and i'm sure there are people here who know their way around it so if you could also give me some guidance on how to do this it would be appreciated.


As a side note, how would you make it so that a battle continues even after the player is knocked unconcious?  I know there's a mod out there that does it (Sword of Damocles I think) but how would it be implemented (if I were to add this to native, for example?)

Thanks.

Edit: oops, typo.

 
AI that is not aggressive is caused by two or more cause.
1, Lord had no denars for recruit.
2, Lord didn't want to serve for marshal.
3, Marshall had not enough armies for besiege enemy base.

1,The Load gets 750 denars and some tax from own fiefs per week. You gain load's income.
modify #script_calculate_hero_weekly_net_income_and_add_to_wealth in module_scripts.py

2, If lord served marshal for a long time, The lord don't serve for some time.
I think you should not modify this script, because when player was marshal, players can make other lord serve at any time.

3, If 1 and 2 were settled, 3 will be settle.
 
zyzyx, I had a similar problem to you. Basically, I modified game_simulate_battle in module_scripts.py. Where it says:
          (store_div, ":defender_strength", ":defender_strength", 1),
          (val_min, ":defender_strength", 500),
          (val_max, ":defender_strength", 100),
          (store_div, ":attacker_strength", ":attacker_strength", 1),
          (val_min, ":attacker_strength", 500),
          (val_add, ":attacker_strength", 100),
You'll have different values in yours but basically, the first number smaller, the second number bigger and the third number bigger will give you faster AI battles (they'll kill each other faster). I haven't tried out rucci's script_calculate_hero_weekly_net_income_and_add_to_wealth idea. That one is probably the one that we both need to make AI attack each other more often. I'll give it a go, thanks rucci!
 
also note ai lords don't fight at night.  i don't have mod system currently, but in module_scripts there's a line concerning fighting at night.  comment out that line and they fight to the finish.
 
And consider making lord parties just bigger.  The native troop numbers almost never get high enough for lords to decide to besiege towns.  You can do this easily by raising the leadership skill of all lords to the 8-10 level.
 
Thanks for the suggestions!  I always thought it strange how slow the ai vs ai battles went, whereas when the player was involved large battles seem to take no game time at all. Thanks for pointing out how to change that.

About making lord parties bigger: So lords will attack castles and towns by themselves if their party sizes are increased? I ask because the only time sieges seem to happen is when the marshal gathers everyone into a big group, which doesn't happen often enough IMO.  I will have to play around and test that a bit, but I hope it will make sieges by AI much more frequent.

Some more questions:

If what I just mentioned doesn't work, is there a way to increase the frequency that the marshal calls campaigns? Is it possible to make the marshal call a campaign immediately after the current one ends?

Also, do lords automatically go to defend friendly town/castles/villages when they are attacked? If so I think I will try to stop lords from patrolling so that they don't waste their time running around when they could be trying to take enemy territory.
 
You may or may not be interested to know that the Warband AI seems far more active (I've got a screenshot of half the map on fire).
 
If what I just mentioned doesn't work, is there a way to increase the frequency that the marshal calls campaigns? Is it possible to make the marshal call a campaign immediately after the current one ends?
That would be a good one, but I'm not sure what script controls that. Any ideas?

Zaro 说:
You may or may not be interested to know that the Warband AI seems far more active (I've got a screenshot of half the map on fire).
That's great news, thanks Zaro! :grin:
 
I have this: (simple_triggers)

################################################################################
(24*90,[#Every three months a massive campaign begins.

  (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),##All this trigger does is make lords more likely to form armies
      (troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero), ##It also makes yours more obedient.
      (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, 90),
      (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100),##Does this for just your lords
  (try_end),
  (display_message,"@A time of war is upon you. The lords have mobilized their forces!",0xFFFFFFAA),
  ]),
################################################################################

I dunno where I got it from, some kit or other  :lol:

It will make all the lords hyper every three months, you could make it happen how often you like, e.g. 24*30 for every month...
 
Aye the readiness makes lords super obedient when their marshall calls a campaign.  It also makes them more likely to form microparties.  And if you are the marshall they won't desert your army of lords.  Readiness is a stat that gradually decreases when they are following someone.  This sets all readiness to max.  So whenever the marshall gathers lords he will get all of them.  Expect some massive battles.  And they are finally capable of sieging towns especially if the party sizes are increased a little bit.
 
Dragon_Lance 说:
That's a very tasty tidbit, WookieWarlord. Spicing things up a bit, thanks.  :twisted:
Don't get me wrong, I didn't write it, I just found it  :lol:

P.S. I like your avatar...
 
Lord Leoric of Wercheg 说:
I'm interested. Can we see screenies plox?

This is the one I took, but every direction looked kind of the same :smile:.

mb5682.jpg
 
WookieWarlord 说:
I have this: (simple_triggers)

################################################################################
(24*90,[#Every three months a massive campaign begins.

  (try_for_range, ":kingdom_hero", kingdom_heroes_begin, kingdom_heroes_end),##All this trigger does is make lords more likely to form armies
      (troop_slot_eq, ":kingdom_hero", slot_troop_occupation, slto_kingdom_hero), ##It also makes yours more obedient.
      (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_join_army, 90),
      (troop_set_slot, ":kingdom_hero", slot_troop_readiness_to_follow_orders, 100),##Does this for just your lords
  (try_end),
  (display_message,"@A time of war is upon you. The lords have mobilized their forces!",0xFFFFFFAA),
  ]),
################################################################################

I dunno where I got it from, some kit or other  :lol:

It will make all the lords hyper every three months, you could make it happen how often you like, e.g. 24*30 for every month...
Yes this is exactly what I was trying to write! Obedient lords and massive campaigns (though I thought it was a script). Thanks so much WookieWarlord :grin:

P.S Nice screenshot Zaro
 
I guess I have to reiterate  :razz: I did not write this...
For some reason I feel guilty when people think I did it  :neutral:
 
WookieWarlord 说:
I guess I have to reiterate  :razz: I did not write this...
For some reason I feel guilty when people think I did it  :neutral:
If this alleviates you :razz: - I was thanking you for finding it
If the person who actually wrote it recognises it, feel free to post your outrage in the High Tower of TRA sub-forum.
 
Earl of Swadia 说:
WookieWarlord 说:
I guess I have to reiterate  :razz: I did not write this...
For some reason I feel guilty when people think I did it  :neutral:
If this alleviates you :razz: - I was thanking you for finding it
If the person who actually wrote it recognises it, feel free to post your outrage in the High Tower of TRA sub-forum.
Ok, I guess that is alright then . . .
 
I wrote it but wookie is my buddy so I don't really mind.  I also posted it with other code for everyone to use in my Kingdom Management thread. So I am glad it is getting out there.
 
Berserker Pride 说:
I wrote it but wookie is my buddy so I don't really mind.  I also posted it with other code for everyone to use in my Kingdom Management thread. So I am glad it is getting out there.
Oh right, that's where I got it from  :lol:
 
后退
顶部 底部