Map Database  •  FAQ  •  RSS  •  Login

Setting up AI army plans

<<

Krom

User avatar

Knights Province Developer

Posts: 3281

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 11 Aug 2017, 05:51

Setting up AI army plans

For the KP I'm looking into setting AI army plans in a more convenient way that is in KaM (equip rate + type).

Typical aim is 75min session where AI gets an army of a few hundreds
That's roughly starting at 1 warrior per minute and ending with 10.
Let's average that to 5.

Now there are roughly 10 warrior types which could be trained
So on high end we might have requirements of 8 melee per min. On low end we could have 1 siege per 20 min

- Higher numbers naturally feel like more (instead of EquipRate which goes in reverse)
- It's more intuitive to set this in an integer format

So my proposed plan is:
- set army demand in form of "WarriorType per hour" for each warrior type
- allow to change this from dynamic script

This way AI could be set to train exact army proportions (e.g. a lot of swordsman and bows, or all in into militia and a couple of catapults, or just a few pikemen for remote villages)

What do you think about this feature?
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 11 Aug 2017, 11:21

Re: Setting up AI army plans

Sounds good to me!
<<

Krom

User avatar

Knights Province Developer

Posts: 3281

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 11 Aug 2017, 12:59

Re: Setting up AI army plans

I've started to implement this feature and while doing so had a back thought - perhaps it would be better to set up by "group types" (i.e. melee, ranged, mounted, siege) rather than "unit types". This way AI might have better chance of control over using available wood/iron resources.
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 13 Aug 2017, 11:41

Re: Setting up AI army plans

Sounds like less control for map makers... :P
<<

Krom

User avatar

Knights Province Developer

Posts: 3281

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 13 Aug 2017, 13:56

Re: Setting up AI army plans

I started implementing that today`s morning and first approach was working out better - so it will likely remain )
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 13 Aug 2017, 16:03

Re: Setting up AI army plans

Cool :)
<<

Ivan

Peasant

Posts: 1

Joined: 06 Mar 2017, 12:33

KaM Skill Level: Beginner

Post 19 Aug 2017, 18:53

Re: Setting up AI army plans

First, won't it cause some complex difficulties in game logic? I mean, what if AI, set up to make bowmen and swordsmen, for some reason (the storage with swords is destroyed) won't have sufficient resources to produce the latter? Will it replace them with other type of melee warriors? Will it restructure it's economy to build another type of warriors?

Will the economic development be correlated with the army production? If AI is set to a small army production, will it make a small economy?

Overall, I think it's an adequate way to regulate the strength of AI. Maybe adding an "aggressiveness" parameter, or how often AI attacks, will be useful.

My favorite type of customization of AI strength so far, is where you could predefine the "characters" of AI like in Stronghold Crusader: one AI type works toward a strong economy and is less involved in war, the other is very aggressive and militaristic and rushes Player all the time, the third builds very strong castle first, and so on. And map maker could select an AI type for a particular player on the map, and maybe tweak it a little.

Or if you want to give the mapmaker control over AI strategic thinking, then you could do it more or less complex, something like a script


if no enemy spotted, then develop economy.
else
__if no strong units spotted, then build 20 militia.
__if strong units spotted, then build 30 units complex army.
__if the enemy is not aggressive within 10 minutes after the first encounter, then build many guard towers.


This way the mapmaker can create a very challenging opponent AI for a player, maybe even with randomization (different AI strategy every time, heh :)

But I guess I'm trying to think too further ahead and ask for too much )
<<

Krom

User avatar

Knights Province Developer

Posts: 3281

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 20 Aug 2017, 11:21

Re: Setting up AI army plans

First, won't it cause some complex difficulties in game logic? I mean, what if AI, set up to make bowmen and swordsmen, for some reason (the storage with swords is destroyed) won't have sufficient resources to produce the latter? Will it replace them with other type of melee warriors? Will it restructure it's economy to build another type of warriors?
Such events are hard to handle anyway. But without some sort of guidance, AI won't do anything at all.
Will the economic development be correlated with the army production? If AI is set to a small army production, will it make a small economy?
Exactly so. AI will try to build its town in a way to meet warfare requirements for required army composition.
Overall, I think it's an adequate way to regulate the strength of AI. Maybe adding an "aggressiveness" parameter, or how often AI attacks, will be useful.
AI attacks are a different can of worms :-)
My favorite type of customization of AI strength so far, is where you could predefine the "characters" of AI like in Stronghold Crusader: one AI type works toward a strong economy and is less involved in war, the other is very aggressive and militaristic and rushes Player all the time, the third builds very strong castle first, and so on. And map maker could select an AI type for a particular player on the map, and maybe tweak it a little.
This is easy to add on top of other parameters once they are working. Atm I've added 3 AI presets (weak, strong, horse-oriented) and trying to make them work.
Or if you want to give the mapmaker control over AI strategic thinking, then you could do it more or less complex, something like a script


if no enemy spotted, then develop economy.
else
__if no strong units spotted, then build 20 militia.
__if strong units spotted, then build 30 units complex army.
__if the enemy is not aggressive within 10 minutes after the first encounter, then build many guard towers.


This way the mapmaker can create a very challenging opponent AI for a player, maybe even with randomization (different AI strategy every time, heh :)
This goes astray from skirmish AI and comes very close to story AI, which could be and should be configured manually (including changes from dynamic script).
But I guess I'm trying to think too further ahead and ask for too much )
Thanks for the feedback!
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

Krom

User avatar

Knights Province Developer

Posts: 3281

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 20 Aug 2017, 20:15

Re: Setting up AI army plans

On a second thought:

For the story mission, AI should train those troops required by the defence positions (set by mapmaker).
For the skirmish mode - AI should be autonomous - deciding whom to train based on it's preset (strength).
So army composition settings become obsolete ..
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 22 Aug 2017, 19:25

Re: Setting up AI army plans

Hmm that depends how defense positions will be defined. If it is as in KaM, that means you can get all sorts of units in one group: militia, axe fighters, sword fighters, barbarians, warriors... Or bowmen and crossbowmen in one group. I hate that. So if you can say: on this defense position only bowmen, on this defense position only sword fighters - then I agree. And what about campaign missions where the AI is allowed to build (for example missions where your territory is invaded)? Wouldn't you need skirmish AI for that?
<<

Krom

User avatar

Knights Province Developer

Posts: 3281

Joined: 09 May 2006, 22:00

KaM Skill Level: Fair

Location: Russia

Post 23 Aug 2017, 05:23

Re: Setting up AI army plans

I'm not sure how to manage that for AI.

If AI is set to train axemen and swordsmen in more or less "slack" proportions (especially one iron runs out), how does it choose where to put them?
If AI can not train more xbows, should it abandon DP instead of stocking it with bows?

Restricting that on mission start is doable, but later in the game - I don't see a clear way (

Story missions where AI can build - thats doable. I plan that each hands' AI could be configured to be either "story"-mode (guided by scripts) or autonomous (skirmish).
Knights Province at: http://www.knightsprovince.com
KaM Remake at: http://www.kamremake.com
Original MBWR/WR2/AFC/FVR tools at: http://krom.reveur.de

Return to “Knights Province Development”

Who is online

Users browsing this forum: No registered users and 1 guest