Results 1 to 11 of 11

Thread: Faction Economy Script

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1

    Default Faction Economy Script

    I was looking through the Campaign script for SS 6.4 because I was curious how much money the AI got if they went below a certain threshold and saw:

    Small AI debt - don't disband their mercenaries
    monitor_event PreFactionTurnStart IsFactionAIControlled
    and Treasury < 0

    if I_CompareCounter turn_fid = 0
    add_money slave 2147483647
    add_money slave 2147483647
    add_money slave -2147483647
    add_money slave 101

    Am I right in see that the AI gets 2147483748 money if their treasury is < 0 ?

  2. #2

    Default Re: Faction Economy Script

    Im pretty sure this is not in the original SS6.4 campaign script

    And no it does not. This number is the maximum amount of cash you can have in the game.

    So if the treasury is below 0, twice the max amount you can have gets added. So you are at the maximum amount of cash you can get. Then the cash gets set to 0 by subtracting this number. Then it adds 101 florins.
    So the AI amount of florins gets set to 101.

  3. #3

    Default Re: Faction Economy Script

    In the same file, does this give AI factions extra purse per turn?

    if I_IsFactionAIControlled england
    increment_kings_purse england 700
    end_if

    If that is the case, then I may prefer to simply increase this, if I find the AI runs out of money too easily.

    Also, what exactly happens if you go negative on your treasury? I have no idea if the AI does that in vanilla, and what happens then. (For myself, I take pains not to go below and immediately stop spending to get back on the positive side next turn - does the AI not do this?)

    Edit: To clarify, if I simply delete the money script and only increase purse - would that not boost the AI the same way without having these ridiculous, sudden AI stack infusions? Or is this not enough, and the AI can't but help go bankrupt no matter how much money you give them?
    Last edited by lampros69; February 06, 2015 at 08:05 PM.

  4. #4
    Byg's Avatar Read The Manual
    Patrician

    Join Date
    Nov 2005
    Posts
    4,569

    Default Re: Faction Economy Script

    ThAt bit of script would not function in isolation I don't think, but if it did it would add 700 to the amount that is given every turn, so in turn two you would get 1400 more and turn three 2100 more. As far as I recall. I imagine the wider script tells it to only happen on a certain turn or under a certain condition.

    In long since forgotten older versions of SS we used to have a simple money boost like you suggest, but the current one was supposed to be an advance on that, giving money to the AI, in the main, when it needed it rather than all the time.

    One problem, without modification, is that the AI seems to favour recruitment over advancing buildings, which might in the long term help to pay for them.

    Do you mean the spawned armies at the start and again at turn 20?
    I made them optional in my mod, but added other difficulties. remember if you just remove them that your game will be easier. I don't know how much you have played,but if it is only one or two short campaigns then if you remove all these AI things you will find your game mind numbingly boring well before you reach the end of your campaign.
    Last edited by Byg; February 07, 2015 at 06:57 AM.

    NEW BGR V 20150324! . . . . . . . .. . . .BGRIV_E

  5. #5

    Default Re: Faction Economy Script

    Quote Originally Posted by Byg View Post
    ThAt bit of script would not function in isolation I don't think, but if it did it would add 700 to the amount that is given every turn, so in turn two you would get 1400 more and turn three 2100 more. As far as I recall. I imagine the wider script tells it to only happen on a certain turn or under a certain condition.
    Ah, ok. That really stinks.

    Quote Originally Posted by Byg View Post
    In long since forgotten older versions of SS we used to have a simple money boost like you suggest, but the current one was supposed to be an advance on that, giving money to the AI, in the main, when it needed it rather than all the time.

    One problem, without modification, is that the AI seems to favour recruitment over advancing buildings, which might in the long term help to pay for them.
    I was not aware of that. Thank you so much for your patient, thorough explanation. It looks like I have to re-insert the money script. Or perhaps convert SSHIP's script into SS 6.4 campaign script somehow?

    If I do re-insert the money script, is there anything you'd suggest I'd do to avoid the worst aspects of the economic distortion? Mainly, the AI seems to have way too much money: For instance, no cash-based diplomacy is possible, because the AI seems to never need/want money. Also, stuff like blockading is useless.

    I'd also be very open to suggestions on how to tone down the economy in general, because there are too many army stacks roaming around, even with approximately doubled upkeep costs.

    Quote Originally Posted by Byg View Post

    Do you mean the spawned armies at the start and again at turn 20?
    I made them optional in my mod, but added other difficulties. remember if you just remove them that your game will be easier. I don't know how much you have played,but if it is only one or two short campaigns then if you remove all these AI things you will find your game mind numbingly boring well before you reach the end of your campaign.
    That's another issue: I've seen stacks materialize out of thin air. But it looks like from looking at the campaign script file that that happens only 2-3 times a game? Can you confirm if that is correct? If that is indeed the case, then I am not so unhappy. But someone else on this forum (perhaps ill-informed) said that the AI gets free stacks whenever it is low on military and/or whenever it is down to 1 province?

  6. #6

    Default Re: Faction Economy Script

    Quote Originally Posted by lampros69 View Post
    (For myself, I take pains not to go below and immediately stop spending to get back on the positive side next turn - does the AI not do this?)
    No, it does not. The AI spends it's money every turn, prefering troops over buildings like byg said. Then at a time the upkeep becomes too much and the AI is broke until it looses troops (->war).
    That's why I invented this script for SSHIP (based on a part of the G5 script which was not working, after that optimized turn time wise by gsthoed). So the AI actually acts like that. If their income isn't positive (to a certain amount) unit recruitment gets stopped.

    Increasing kings purse would not change anything but increase stacks slightly and still result in a broke AI (if it is not constantly at war).

    As byg said, increasing kings purse is a constant and doing this every turn would get the AI to snowball out of control pretty soon.

    So trust us that there is not really an easy solution. If you want to, you can try out the different commands and variables with which the AI should be able to check it's income, but half of those won't work at all and in general it's a really testing intensive thing. The current script in SSHIP is the best thing I could come up with.

  7. #7

    Default Re: Faction Economy Script

    Quote Originally Posted by MWY View Post
    No, it does not. The AI spends it's money every turn, prefering troops over buildings like byg said. Then at a time the upkeep becomes too much and the AI is broke until it looses troops (->war).
    That's why I invented this script for SSHIP (based on a part of the G5 script which was not working, after that optimized turn time wise by gsthoed). So the AI actually acts like that. If their income isn't positive (to a certain amount) unit recruitment gets stopped.
    I've thought of one solution just now. Could I simply transfer SSHIP's money script over to SS 6.4 campaign script file, and then simply change the faction names? Or do I need to do more? If that alone is sufficient, then it doesn't seem a lot of work.


    Quote Originally Posted by MWY View Post

    So trust us that there is not really an easy solution.
    Yes, I am beginning to see that!

  8. #8

    Default Re: Faction Economy Script

    As I said in another thread, the AI does not get more money than in vanilla. It gets less. But uses it better with the Savage and Gracul AI. The reason the AI does not want your money is that it wants to be at war with you. If you prefer that the AI is not at war with you, try the Lusted AI or play at a lower level of difficulty. Chances are it will accept money from you then.

    The Lusted AI works and is perfectly playable. There is no reason to use another AI, then dumb it down to make it like Lusted, when there is Lusted.

    Similarly there is no need to play on the harder difficulty levels when you can play at an easier level. Most of the difficulty is in the money the AI gets, so playing on hard difficulty then giving the AI less money is about the same as playing on normal or easy. Except for diplomacy, which you also seem to want to tone down. Why bother messing around with the scripts when you can play on the easier levels?

  9. #9

    Default Re: Faction Economy Script

    Quote Originally Posted by Geoffrey of Villehardouin View Post
    As I said in another thread, the AI does not get more money than in vanilla. It gets less. But uses it better with the Savage and Gracul AI. The reason the AI does not want your money is that it wants to be at war with you. If you prefer that the AI is not at war with you, try the Lusted AI or play at a lower level of difficulty.
    Ok, given the campaign scripts look so abstruse as to be beyond my comprehension, I am going to take your claim on faith - albeit provisionally.

    I am not sure if I want to play at lower difficulties, given that the difficulty ratings mess with other stuff as well - e.g. I don't want to get breaks on stuff like spying/assassination attempts or auto-resolve.

    Quote Originally Posted by Geoffrey of Villehardouin View Post
    Similarly there is no need to play on the harder difficulty levels when you can play at an easier level. Most of the difficulty is in the money the AI gets, so playing on hard difficulty then giving the AI less money is about the same as playing on normal or easy.
    Even if the AI gets less money than the vanilla, as you claim, the AI seems to have larger armies - though I have done no precise, empirical studies. Is this because of the "reinforcements" then? If so, isn't the effect of SS reinforcements system so huge that the AI might as well be considered to have more money than vanilla?

  10. #10

    Default Re: Faction Economy Script

    The only difference between the easier and harder levels is that the AI gets more money on the harder levels and diplomacy is harder. Nothing else changes, campaign-wise, unless there are special scripts within the campaign script (e.g. reinforcements). However, because the AI gets more money, that alone can change the way the campaign AI behaves, for example it can be more aggressive, and may seem more intelligent because the increase in cash gives it more options. So it makes some decisions that one may not see at the easier levels such as building armies when needed. However, it is not inherently any more intelligent than at the easier levels, just at the easier levels it does not have as much cash so its options become restricted and it often becomes passive.

    Some special scripting within the campaign script on the Mongols and Crusades, Jihads, etc, give the AI additional bonuses, cash or reinforcements. These bonuses are extra and usually more than in vanilla, depending also on the version of SS. I had one campaign in which I lifted the fog of war to count no less than 65 Mongol stacks. So these reinforcements can be a little excessive. Nonetheless, with enough experience the human player can find ways around those. These reinforcements are not inevitable, you can tailor your game in such a way that you do not end up facing 65 Mongol stacks. Whether or not you want to change the way you play - e.g. migrate to Scotland, ally with the Mongols, never fight them, or whatever - to avoid being overwhelmed by Mongol or Jihad armies, in the end the player is under no obligation to play on the hardest levels with the most aggressive AI.

    Quote Originally Posted by lampros69 View Post
    Even if the AI gets less money than the vanilla, as you claim, the AI seems to have larger armies - though I have done no precise, empirical studies. Is this because of the "reinforcements" then? If so, isn't the effect of SS reinforcements system so huge that the AI might as well be considered to have more money than vanilla?
    Some players like to face an aggressive AI and to be challenged more having played at the easier levels and won their campaigns. So on hard and very hard the campaign script gives you the extra challenge.

  11. #11

    Default Re: Faction Economy Script

    Quote Originally Posted by Geoffrey of Villehardouin View Post
    I had one campaign in which I lifted the fog of war to count no less than 65 Mongol stacks. So these reinforcements can be a little excessive.
    That is absolutely insane. I don't think you can generate a comparable military even if you have half the map conquered. So are the Mongols basically irresistible? I have yet to play one of the Eastern factions (nor do I ever go on crusades), so I have no idea what effect they have on the game. At any rate, a bit ironic in that sheer numbers is actually not what won them their massive empire.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •