Results 1 to 22 of 22

Thread: Free Upkeep in Castles

  1. #1

    Default Free Upkeep in Castles

    Anyone know what it would take to have castles accept the free upkeep attribute?

    I am trying to have some free upkeep units in cities and others in castles. Any thoughts?

    Thanks

  2. #2
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: Free Upkeep in Castles

    Well for the unit portion of things, I don't think it's possible to differentiate between units that can be free in a castle versus ones that can be free in a city - there's just the one attribute, free_upkeep_unit. However, units do not become free upkeep unless the particular settlement can actually build the given unit, so this will in fact give you a way to differentiate between city-free and castle-free units, as almost nothing is able to be built in both. Thus in the case of say the English, town militia would never be free upkeep in a castle as they can never be recruited there, and likewise units like dismounted english knights would never become free in a city as the city will never be able to recruit them. So really, that fact should be perfect for your purposes.

    As for the castles giving free upkeep, this should be as simple as adding a line like "free_upkeep bonus 3" to the "capability" section of each level of castle wall in the file, of course substituting in the number of free upkeep slots you intend that castle level to give. The castle and city walls are the first few things that appear in the export_descr_buildings.txt file, and so should be easy to locate.


    See my Sig+ below! (Don't see it? Get info here)

  3. #3

    Default Re: Free Upkeep in Castles

    Thanks, worked like a charm.

    Im trying to force the campaign AI to build up armies for war but disband them afterwards. To that end im significantly increasing the maintenance cost of armies and hoping it will be smart enough to know it has to disband units if it wants to build. With luck this will be all it takes and i wont have to poke around the "I" aspect of the AI to make this work. In all likelihood it wont be that easy.

    thanks for your help

  4. #4

    Default Re: Free Upkeep in Castles

    In case anyone is curious. It doesn't appear that the AI is willing to disband a unit for any reason.

    Any guesses as to where this behavior may be changed?

    Thanks

  5. #5
    Harbinger of... saliva Member alpaca's Avatar
    Join Date
    Aug 2003
    Location
    Germany
    Posts
    2,767

    Default Re: Free Upkeep in Castles

    Quote Originally Posted by Fat Buddha
    In case anyone is curious. It doesn't appear that the AI is willing to disband a unit for any reason.

    Any guesses as to where this behavior may be changed?

    Thanks
    Probably not at all. Such stuff is usually hardcoded.

  6. #6

    Default Re: Free Upkeep in Castles

    Quote Originally Posted by alpaca
    Probably not at all. Such stuff is usually hardcoded.
    Unfortunate. Oh well.

    Thanks

  7. #7

    Default Re: Free Upkeep in Castles

    Quote Originally Posted by Fat Buddha
    Unfortunate. Oh well.

    Thanks
    I believe this is one of the areas where the computer's psycho-aggression in the vanilla diplomacy works to its own interests. It ensures that old units get killed off and will be replaced with higher quality units. Unfortunately, it also ensures the AI gets into half a dozen wars and gets torn to pieces and is impossible to reason with, so I'd call it a net loss.

  8. #8
    Member Member SilentResident's Avatar
    Join Date
    Dec 2006
    Location
    Macedonia, Greece
    Posts
    48

    Default Re: Free Upkeep in Castles

    An way is to mod the export_descr_buildings.txt file.

    Simply, add the (without the "")
    " free_upkeep bonus 9 requires factions { byzantium, } "

    in the capability of all the Core Buildings / Walls and you will get free Upkeep for more units per settlement.
    Macedon or Macedonia (from Greek Μακεδονία) was the name of the ancient Greek kingdom in the northern-most part of ancient Greece. For a brief period it became the most powerful state in the ancient Near East after Alexander the Great conquered most of the known world, inaugurating the Hellenistic period of Greek history...

  9. #9
    Clan Takiyama Senior Member R'as al Ghul's Avatar
    Join Date
    Jan 2003
    Location
    ignores routers who aren't elite
    Posts
    2,554

    Default Re: Free Upkeep in Castles

    Quote Originally Posted by Foz
    However, units do not become free upkeep unless the particular settlement can actually build the given unit, so this will in fact give you a way to differentiate between city-free and castle-free units, as almost nothing is able to be built in both. Thus in the case of say the English, town militia would never be free upkeep in a castle as they can never be recruited there, and likewise units like dismounted english knights would never become free in a city as the city will never be able to recruit them.
    Yes, but what if you move a city-recruited unit into the castle?
    As you've said, the attribute "free_upkeep" is connected to each unit. Once you mod a free upkeep slot for castles I don't see how you want to prevent city-units to hang out in castles for free.
    I'm not saying that's a bad thing but it won't work as you suggest!?

    R'as

    Singleplayer: Download beta_8
    Multiplayer: Download beta_5.All.in.1
    I'll build a mountain of corpses - Ogami Itto, Lone Wolf & Cub
    Sometimes standing up for your friends means killing a whole lot of people - Sin City, by Frank Miller

  10. #10
    Relentless Bughunter Senior Member FactionHeir's Avatar
    Join Date
    Dec 2006
    Location
    London, UK
    Posts
    8,115

    Default Re: Free Upkeep in Castles

    jousting lists and training grounds are supposed to give castles the free_upkeep capability but so far moving any unit into the castle or building any unit type didn't actually trigger that capability.
    Does that mean that it is inherently bugged?
    Want gunpowder, mongols, and timurids to appear when YOU do?
    Playing on a different timescale and never get to see the new world or just wanting to change your timescale?
    Click here to read the solution
    Annoyed at laggy battles? Check this thread out for your performance needs
    Got low fps during siege battles in particular? This tutorial is for you
    Want to play M2TW as a Vanilla experience minus many annoying bugs? Get VanillaMod Visit the forum Readme
    Need improved and faster 2H animations? Download this! (included in VanillaMod 0.93)

  11. #11
    Clan Takiyama Senior Member R'as al Ghul's Avatar
    Join Date
    Jan 2003
    Location
    ignores routers who aren't elite
    Posts
    2,554

    Default Re: Free Upkeep in Castles

    Does that mean that it is inherently bugged?
    In the vanilla game (and LtC) there's an entry "free upkeep bonus 1" at the wooden castle level. All other castle levels don't have that line.
    Without testing I'd assume that if you add those lines to the other castle line structures like motte_and_bailey, castle, etc. it should work. Judging by the edu file it was intended for castles to have free upkeep slots.

    R'as

    Singleplayer: Download beta_8
    Multiplayer: Download beta_5.All.in.1
    I'll build a mountain of corpses - Ogami Itto, Lone Wolf & Cub
    Sometimes standing up for your friends means killing a whole lot of people - Sin City, by Frank Miller

  12. #12
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: Free Upkeep in Castles

    Quote Originally Posted by R'as al Ghul
    Yes, but what if you move a city-recruited unit into the castle?
    As you've said, the attribute "free_upkeep" is connected to each unit. Once you mod a free upkeep slot for castles I don't see how you want to prevent city-units to hang out in castles for free.
    I'm not saying that's a bad thing but it won't work as you suggest!?

    R'as
    You missed what I said earlier, and that is that the unit only becomes free upkeep if it can be recruited at the current location (we know this is the case because spear militia do not become free upkeep in a town until you build the building that lets the town recruit them). No city units are castle recruitable, ergo they can never be free upkeep there.

    Quote Originally Posted by FactionHeir
    jousting lists and training grounds are supposed to give castles the free_upkeep capability but so far moving any unit into the castle or building any unit type didn't actually trigger that capability.
    Does that mean that it is inherently bugged?
    See what I posted as reply in the bug thread. The gist is that they don't work because none of the castle-recruited units can be free upkeep (in the EDU this is set) so you get the free upkeep slot, but it's useless since no unit that is produced in a castle is also allowed to be free upkeep.

    Quote Originally Posted by R'as al Ghul
    In the vanilla game (and LtC) there's an entry "free upkeep bonus 1" at the wooden castle level. All other castle levels don't have that line.
    Without testing I'd assume that if you add those lines to the other castle line structures like motte_and_bailey, castle, etc. it should work. Judging by the edu file it was intended for castles to have free upkeep slots.

    R'as
    Yup they'll have free upkeep slots then, but they won't do anything until you designate some castle-recruited units as free upkeep capable. The actual attribute is free_upkeep_unit, and you'll need to add it to anything that you want to allow to be free upkeep in a castle (again, the unit has to be able to be produced at that castle to become free upkeep).

    Hope that helps everyone.


    See my Sig+ below! (Don't see it? Get info here)

  13. #13
    Clan Takiyama Senior Member R'as al Ghul's Avatar
    Join Date
    Jan 2003
    Location
    ignores routers who aren't elite
    Posts
    2,554

    Default Re: Free Upkeep in Castles

    Quote Originally Posted by Foz
    You missed what I said earlier, and that is that the unit only becomes free upkeep if it can be recruited at the current location (we know this is the case because spear militia do not become free upkeep in a town until you build the building that lets the town recruit them). No city units are castle recruitable, ergo they can never be free upkeep there.
    Ah, I see. I wasn't aware of that.


    Singleplayer: Download beta_8
    Multiplayer: Download beta_5.All.in.1
    I'll build a mountain of corpses - Ogami Itto, Lone Wolf & Cub
    Sometimes standing up for your friends means killing a whole lot of people - Sin City, by Frank Miller

  14. #14
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: Free Upkeep in Castles

    Well, seeing as it's a royal pain in the butt to go through the file and set all the units to be free_upkeep_unit, I wrote yet another of my nifty programs to do it for me (and you!).

    Basically this is intended as a fix for the problem where the free upkeep slot from tourney fields doesn't work (due to no castle recruitable units being able to be free upkeep). See the earlier posts of this thread for a complete explanation of the problem. I just tried it myself and had some Sherwood Archers receiving free upkeep in one of my castles

    Here's what happens with the fix applied:

    - Castle units can fill free upkeep slots in castles where they can be recruited (i.e. a dismounted gothic knight can be free provided you've built the barracks level that recruits him at the castle you want him to be free at).
    - City units can fill free upkeep slots in cities where they can be recruited.
    - City units will never fill free upkeep slots in castles as they can never be recruited there.
    - Likewise castle units will never be free upkeep in cities since they can never be recruited there.

    As a side benefit, this will also make any free upkeep slots that you give to castle walls work correctly too (people have speculated that castles are supposed to have free upkeep slots, because the first level castle DOES have 1 free upkeep slot).

    Anyway, here's the file patcher: http://www.goldeneaglecomics.com/Files/Free Upkeep.exe

    Put it in the directory with your export_descr_unit.txt file, run it, and out pops New EDU.txt which you'll have to rename to export_descr_unit.txt after you've backed up your old one. Enjoy!
    Last edited by Foz; 01-27-2007 at 19:47.


    See my Sig+ below! (Don't see it? Get info here)

  15. #15
    Clan Takiyama Senior Member R'as al Ghul's Avatar
    Join Date
    Jan 2003
    Location
    ignores routers who aren't elite
    Posts
    2,554

    Default Re: Free Upkeep in Castles

    Hey Foz,

    I totally missed this post. Thanks for your .exe file. It's appreciated.
    Now, for me and others that do follow this, I still need to edit the export_descr_buildings.txt to enable the upkeep slots for castles, right?
    In vanilla there's only one level of the castle line that has the upkeep bonus, that's the wooden castle. I assume that I need to copy/paste that line into all the other castle levels?

    R'as

    Singleplayer: Download beta_8
    Multiplayer: Download beta_5.All.in.1
    I'll build a mountain of corpses - Ogami Itto, Lone Wolf & Cub
    Sometimes standing up for your friends means killing a whole lot of people - Sin City, by Frank Miller

  16. #16
    Masticator of Oreos Member Foz's Avatar
    Join Date
    Dec 2006
    Posts
    968

    Default Re: Free Upkeep in Castles

    Quote Originally Posted by R'as al Ghul
    Hey Foz,

    I totally missed this post. Thanks for your .exe file. It's appreciated.
    Now, for me and others that do follow this, I still need to edit the export_descr_buildings.txt to enable the upkeep slots for castles, right?
    In vanilla there's only one level of the castle line that has the upkeep bonus, that's the wooden castle. I assume that I need to copy/paste that line into all the other castle levels?

    R'as
    You're quite welcome.

    Yes you'll need to edit the export_descr_buildings.txt file if you intend to have upkeep slots granted in castles by anything other than the wooden castle and any tourney fields you've built. Personally, I made the 2nd through 5th castle levels grant 1 to 4 upkeep slots respectively, taking the 1 slot that the 2nd level castle has to indicate intent of an upward scale from there. It seems only fitting since I don't think the lowest level castle recruits anything at all (therefore no use for upkeep slots), and the castle units typically have higher upkeeps than the militia units, so 2 less free upkeep slots in a castle than the same level city would have seems to make the free upkeep slots about balanced in amount they'll give you free.


    See my Sig+ below! (Don't see it? Get info here)

  17. #17
    Clan Takiyama Senior Member R'as al Ghul's Avatar
    Join Date
    Jan 2003
    Location
    ignores routers who aren't elite
    Posts
    2,554

    Default Re: Free Upkeep in Castles

    I've tested this now and it works even with savegames.
    It's a very nice change. I think this is as intended by CA.
    I'm not far enough into the campaign to give an educated opinion but having those free upkeep slots certainly does help my economy and so I suppose it does the same for the AI. It may even encourage the AI to keep some good troops garrisoned in castles.

    Singleplayer: Download beta_8
    Multiplayer: Download beta_5.All.in.1
    I'll build a mountain of corpses - Ogami Itto, Lone Wolf & Cub
    Sometimes standing up for your friends means killing a whole lot of people - Sin City, by Frank Miller

  18. #18
    The Philosopher Duke Member Suraknar's Avatar
    Join Date
    Dec 2002
    Location
    Navigating the realm of Ideas
    Posts
    707

    Default Re: Free Upkeep in Castles

    So far the AI seems to keep 1 unit in castles...as per vanilla, has been a breeze taking over citadels and I play at VH-VH (no boasting intended, just stating observable fact).

    Thank you Foz and everyone for this discussion here, I am gonna change this for castles. And see how it goes :)

    As for the economy I agree it will help, I usually just mod the faction I intend to play with to start with several million coins, but I noticed many nice changes in M2TW from CA to address economical issues, so I am trying this Vanilla...still..I am in financial trouble by turn 50.
    Duke Surak'nar
    "Η ΤΑΝ Η ΕΠΙ ΤΑΣ"
    From: Residing:
    Traveled to: Over 70 Countries, most recent: and

    ~ Ask not what modding can do for you, rather ask what you can do for modding ~
    ~ Everyone dies, not everyone really fights ~

  19. #19

    Default Re: Free Upkeep in Castles

    Unfortunately it does not appear to be design intent, as the abberrant free upkeep castle line is missing in the leaked 1.2 I got. Shame, it seems to be a great idea, and I'll be using this mod.
    "Let us wrestle with the ineffable and see if we may not, in fact, eff it after all." -Dirk Gently, character of the late great Douglas Adams.

  20. #20

    Default Re: Free Upkeep in Castles

    Does this still work after patch 1.2? I'm sure it does and I've screwed something up, but I don't notice this working after making all the above changes.

    Does the free castle unit's look the same as the city (the blue background) or show the same mouse over message?

    Thanks-I'd really like to get this working.

  21. #21
    Member Member -Amon-'s Avatar
    Join Date
    Sep 2003
    Location
    Amon..The Last Jedi..
    Posts
    139

    Default Re: Free Upkeep in Castles

    hi there !

    i download freeupkeep.exe,when i run this an error screens comes up to screen like "freeupkeep.exe blah blah with error..do you want to send a report? 1-send an error report 2- don't send."..

    any solutions?
    The Truth is from thy Lord; so be not at all in doubt. The Heifer (Al-Baqarah)-147

  22. #22
    warning- plot loss in progress Senior Member barocca's Avatar
    Join Date
    Dec 2000
    Location
    (*disclaimer* - reality may or may not exist, in some societies reality is a crime, punishable by life)
    Posts
    5,341

    Default Re: Free Upkeep in Castles

    make doubly sure the exe is in the correct folder
    in the directory WITH export_descr_unit.txt - it needs to read that file to create the output file.

    B>
    The winds that blows -
    ask them, which leaf on the tree
    will be next to go.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Single Sign On provided by vBSSO