How to make the AI save money?

Discussion of all aspects of the game engine, including development of new and existing features.

Moderator: Forum Moderators

Post Reply
Kharn
Posts: 83
Joined: December 12th, 2005, 7:50 pm
Location: Dallas, Tx

How to make the AI save money?

Post by Kharn »

I am looking for a way to have the AI be willing to save up gold.

Problem is my realism WWII mod where 160 dollars = 1 gold still has tanks historically costing 80-900 gold. The AI will only build tanks on turn 1 and only if it has the funds.
The recruitment pattern does not help, some categories have only expensive items and it appears the AI just tries a different category if it can not afford.

Easiest thing I can think of is stopping the AI from recruiting unless it has over X gold. Preferably where X is Y times their gross income per turn.

Next idea is to only have AI recruit once every 4 turns.

Next idea is to only build units of the classes light_antitank and heavy_antitank if enemy units of these classes are spotted. Sounds the most complex.

So to people who know the AI system better than me, what is a good option?
Creator of 120+ units Lord of the Rings era and campaign now outdated & lost.
Creator of WWII Battleground Europe mod with 120+ units most with custom wml and animations. Every variable is mathematically derived based on WWII stats such as historical cost & mm armour.
User avatar
StandYourGround
Posts: 256
Joined: May 13th, 2009, 2:16 am
Location: On a blue ball spinning through space at incomprehensible speed

Re: How to make the AI save money?

Post by StandYourGround »

How about giving the AI only so much gold on the first turn, then some more on the next turn you want it recruiting, and so on? You can also modify the recruit list between turns, so the AI only recruits what you want it to recruit.
I will now resume lurking silently.
mattsc
Inactive Developer
Posts: 1217
Joined: October 13th, 2010, 6:14 pm

Re: How to make the AI save money?

Post by mattsc »

If you're using Wesnoth 1.11.7 or later, you can use the recruitment_instruction aspect.
Kharn
Posts: 83
Joined: December 12th, 2005, 7:50 pm
Location: Dallas, Tx

Re: How to make the AI save money?

Post by Kharn »

I solved it partially for the time being by restricting the number of each type of unit the AI can recruit.

It still has the bad side effect of the AI making only cheap units until they max out
Creator of 120+ units Lord of the Rings era and campaign now outdated & lost.
Creator of WWII Battleground Europe mod with 120+ units most with custom wml and animations. Every variable is mathematically derived based on WWII stats such as historical cost & mm armour.
Post Reply