Results 1 to 1 of 1

Thread: [Tool] Program for boost/nerf factions by batch editing parameters in the EDU file

  1. #1
    Member Member Kassatka's Avatar
    Join Date
    Jun 2021
    Location
    Ukraine, chicken coop near Kyiv
    Posts
    5

    Default [Tool] Program for boost/nerf factions by batch editing parameters in the EDU file

    KsS RTW/M2TW Faction Booster by Kassatka aka Chornomoh
    The program is designed to boost/nerf individual factions in the games “Rome: Total War” (Remastered) and “Medieval II: Total War” by batch editing parameters in the “export_descr_unit.txt”/“feral_export_descr_unit.txt” file. Before starting a new campaign, we can change the price of each unit upkeep in the EDU-file and other parameters separately for the AI and for the player in order to increase/decrease the number of units that AI can hire, as well as increase or decrease the difficulty of the game. You can force the AI to hire more powerful armies.
    The author of the program is Kassatka, aka Chornomoh.
    Sorry for the bad english. I had to use an automatic machine translator because I don't speak English well.

    Prehistory and main idea of the program
    For many players, the standard AI seems too weak, because in many cases it creates too few units. Increasing the difficulty of the game on very hard does not solve this problem in any way. A user with the nickname Sonar from one russian forum determined that the number of army that an AI hires and upkeeps depends solely on the ratio of the total income per turn and the cost of upkeeping this army. Even if you throw in a couple of million money into the AI treasury, it will still not contain more army. Therefore, if you reduce the cost of upkeeping units, then the AI will immediately start hiring more of them. The cost of upkeeping each unit is set in “feral_export_descr_unit.txt” or in “export_descr_unit.txt”, it is possible before starting the game, for example, to reduce the cost of upkeeping units for all AI factions, but at the same time not to touch the parameters of the units of the faction for which we are going to play, well, it is also advisable not to touch the mercenaries. Doing this in a text editor is a very dreary and unpleasant job, and if we want to start the game for a different faction, we will have to redo it every time. I decided to write a program that automates this process. We specify the source file “feral_export_descr_unit.txt” or “export_descr_unit.txt” without edits as a source, we set the coefficient by which the cost of upkeeping each unit should be multiplied, we set the list of fractions, for the units that need to apply this coefficient, press the button and save the finished “feral_export_descr_unit.txt”/“export_descr_unit.txt”, in which the cost of upkeeping units for the selected factions is changed by the specified coefficient.

    Program description
    At the same time, I thought, what other parameters in “feral_export_descr_unit.txt”/“export_descr_unit.txt” are useful to batch change to strengthen or weaken individual factions. He decided that it would be useful to change the “attack factor” and “attack bonus factor if charging” parameter in “stat_pri”/“stat_sec”, as well as the “range of missile” and “amount of missile ammunition per man” if the attack is ranged, armor parameters (“armor factor”, “defensive skill factor” and “shield factor” in “stat_pri_armour”, as well as “armor factor”, “defensive skill factor” for animals in “stat_sec_armour”), cost parameters in “stat_cost” (“Number of turns to build”, “Cost of unit to construct”, “Cost of upkeep”, “Cost of upgrading weapons” and “Cost of upgrading armour”). It is convenient to set all these parameters either in the form of a coefficient by which the original value should be multiplied, or in the form of a positive/negative number of percent by which the original value should be changed.
    It will also be useful to change the health parameters (Hit points for man and hit points ridden horses and camels in “stat_health”). In this case, it is better to set not the coefficient by which you need to multiply, but the term in the form of an integer addition, which should be added/subtracted to the original value.
    It is also useful to change “The base morale level” parameter in “stat_mental”. In this case, it was decided that it would be useful to be able to change the morality parameter both through the coefficient to be multiplied, and through the term in the form of an integer addition, which should be added/subtracted.
    Another parameter of the number of moves for recruiting is also useful to be able to change both through a multiplier and through a addition. The factors are applied first, if any, and then the additions.
    The “ownership” line of the “feral_export_descr_unit.txt”/“export_descr_unit.txt” file specifies either a faction or a culture. Accordingly, if you check the selection box for a faction in the program, then only those units for which there is a faction in the ownership line will be selected, and if there is a culture in the ownership line, then to select such a faction, you need to check the box in front of the culture. Rebel and mercenary units are considered outside cultures and normal factions. You can also apply the changes immediately to all units of any factions, rebels and mercenaries, if you check the checkbox at the top opposite “All cultures and factions”.
    I wrote the program, and then significantly improved it. First, he made a list of individual quests, each with its own modifiable parameters and its own list of factions. You can either alternately complete all tasks for each unit, or for each parameter, apply the coefficient/addition that gives the greatest boost or nerf, or from the most extreme left or right task, which is the first one that matches the list of factions for this unit. The number of tasks is selected by the counter. He also made that if the specified value of the coefficient/addition brings a boost of the fraction, then it is displayed in green, if the nerf — in blue, if nothing changes — in black.
    For the program to work, it needs to be given access to the source file “feral_export_descr_unit.txt”/“export_descr_unit.txt”, as well as to the “descr_sm_factions.txt” file, from which it will read the list of factions. I made that you can specify the “data” folder of the game/mod, from which it will load the source files, or specify the location of each of these files separately. Also, the program has a folder “Presets\”, which stores the combinations of the “feral_export_descr_unit.txt”/“export_descr_unit.txt” and “descr_sm_factions.txt” files already set in advance by the author of the program or user, any of them can be selected in the drop-down list. The “Presets\” folder contains the default folders for each of the “Rome: Total War Remastered”, “Rome: Total War”, and “Medieval II: Total War” games. Each combination of files is stored in a separate subfolder of one of these three folders.
    Now there:
    • for the game “Rome: Total War Remastered”, there are 3 pre-built source files for base game 270 BC. + two addons “Barbarian Invasion” and “Alexander”;
    • for the old original game “Rome: Total War”, there are 4 pre-built source files for the base game 270 BC. + two addons “Barbarian Invasion” and “Alexander”, as well as for the mod “Amazon: Total War v3.0c”;
    • for the game “Medieval II: Total War”, there are 5 pre-built base game source files + four additional campaigns for the “Americas”, “British_Isles”, “Crusades”, and “Teutonic” of the addon “Kingdoms”.

    You can create in the “Presets\” folder any of your subfolders for any mods or for modified source files. Regardless of the source from which the program loaded the data, by pressing the “Run tasks” button, the changed state of “export_descr_unit.txt”/“feral_export_descr_unit.txt” is saved on the “export_descr_unit.txt” and “feral_export_descr_unit.txt” tabs in the second column. You can scroll, see the contents of this column before saving, and even manually edit something. The contents of the second column of the active tab are saved by clicking the “Save as...” button and in the file save dialog box you will need to specify where to save the modified “export_descr_unit.txt” or “feral_export_descr_unit.txt” file.

    Enhancements
    I has tightened the localization of the program interface. The program now supports English, Russian and Ukrainian interface languages. Interface languages are stored in the “Localization\” folder. The program is provided with three *.ini-files for English, Russian and Ukrainian languages, respectively, anyone can, following their example, create a new *.ini-file to translate the program interface into any other language.
    Also added help, too, in English, Russian and Ukrainian, it is also available for editing. Help is stored in the “Localization\Help\” folder.
    I screwed the saving of the state of the working window into the “Settings.ini” file. If there are changes, the program tries to save them in “Settings.ini” in the folder next to the *.exe-file of the program when closing. If there is no write access, then no saving occurs. When the program starts, it loads its previous state from this file.
    The program is compiled in x32 and x64 bitness, therefore two *.exe-files are included.

    How to work with a program based on an example? Screenshots.
    Let's say we want to play as Armenia in Rome: Total War Remastered base game 270 BC campaign. First, let's select a preset for the base game to work specifically with the 270 BC campaign files. Go to the tab “From ready-made presets”, select “Rome: Total War Remastered” from the list “Select a Total War game or collection of mods:”, and select “001. Base Game (270 BC - 14 AD)” from the list “Select a preset for this game from folder "Presets\Rome Total War Remastered":”.
    Let's boost all the other factions, except Armenia, we will do it in “Task 1”. In the “Include” column, put a checkmark “All cultures and factions”, and in the “Exclude” column, we will specify our culture “eastern”, the faction “armenia” and mercenaries “Mercenaries”, since the player does not need to be able to hire cheating mercenaries.
    Now we will increase the attack by one and a half times (including the charge), by 20% range of missile, by 30% the amount of missile ammunition, by 20% all the parameters of armor for humans and animals, the number of turns for recruitment will be halved (units that were hired for 2 turns will now be in 1 turn), the cost of recruitment, maintenance and upgrade will be reduced by 30%. We will also increase the health of both people and animals by one. To increase morale, we use both the multiplier and the addition — let the morale first be increased by one and a half times, and then add two more to the result.
    And now we decided that the Romans did not need to be boost so much. We create a second task, for this in the counter “Number of tasks:” we specify 2. Select in “Task 2” the Roman culture and all four Roman factions. Let their attack and charge, after multiplying by a factor of 1.5 in the first task, decrease by 25% by multiplying by a factor of 0.75 in the second task. As a result, for the Romans, these two parameters will increase by 1.5×0.75=1.125 times. We also decided that we didn't want the Romans to change the cost of hiring a squad relative to the original file. Since in the first task we multiplied the cost of hiring a squad by 0.7, here we multiply by 1÷0.7=1.42857142857143. As a result, after two consecutive multiplications, the cost of hiring will not change (multiplied by 0.7×1.42857142857143=1 time). As for morality, let the Romans also have an increase of 1.5 times, but there will not be a subsequent increase by two points. To do this, subtract the number 2 in the term for morality. The final morale of Roman units will be calculated using the formula <Initial morale>x1.5+2-2=<Initial morale>x1.5. The program window will look like this.
    Appearance of the program and selected tasks, variant 1:


    Now we press the button “Run tasks”. The result of the work will be on the tabs “export_descr_unit.txt” and “feral_export_descr_unit.txt”. The left column shows the contents of the file before the changes, and the right column — after applying the tasks. Here is the result of applying our tasks for the unit “Egyptian Chariots”:


    And here is the result of applying our tasks for the Roman unit “Cohort of Praetorians”:


    Now all that remains is to save the modified file.
    If you play “Rome: Total War Remastered” and before starting the game, “Remastered” is selected for the “Unit balancing” parameter, then you will need to save the “feral_export_descr_unit.txt” file. To do this, select the “feral_export_descr_unit.txt” tab, click the “Save as...” button and specify the location where you want to save the modified “feral_export_descr_unit.txt” file.
    If you are playing “Rome: Total War Remastered” and before starting the game, “Unit balancing” is set to “Classic”, and also if you are playing “Medieval II: Total War” or the old original “Rome: Total War” then you will need to save the “export_descr_unit.txt” file. To do this, select the “export_descr_unit.txt” tab, click the “Save as...” button and specify the location where you want to save the modified “export_descr_unit.txt” file.
    For “Rome: Total War Remastered”, you can save both files alternately so that the modified unit parameters are applied with both the “Remastered” and “Classic” settings.
    In both cases, the contents of the second column with the modified file will be saved. If you manually make any changes to the content of this column, it will be saved along with your changes.
    Now it remains to transfer the saved files to the game folder and start the game.

    Also, you could not set the correction factors for the Romans with the help of an additional task, but simply indicate a separate task for all factions, except for Armenians, Romans and mercenaries, and a separate task for the Romans. The program window will look like this.
    Appearance of the program and selected tasks, variant 2:


    I am also attaching a screenshot of the window with help on using the program:


    Future plans
    It would be nice to boost/nerf factions not only by editing “export_descr_unit.txt”, but also by editing “export_descr_buildings.txt”, but there is a very complicated file format, you need to write a recursive parser until I can definitely master it. It would also be possible to display a localization of the type “House of Julii” instead of the faction keys of the “romans_julii” type. This would eliminate the confusion of mods when factions are renamed. And go and figure it out first that in the fashion about the Amazons “dacia” is not “Dacia”, but “Bean Sidhe” in fact. The file format for the localization of the game is quite simple, perhaps this improvement will be introduced in the future. Also write your comments, error indications and suggestions for improving the program.
    I can also try to make the text editors for “export_descr_unit.txt” appear next to it before and after the changes so that the scrolling of one editor causes the automatic scrolling of the second one by the same number of lines.

    System requirements
    The program must be able to work with files of three games “Rome: Total War Remastered”, “Rome: Total War” and “Medieval II: Total War”, as well as any mods for these games.
    The program should work on both modern and older versions of Windows. At least from Windows 2000 to Windows 10.
    A screen resolution of at least 1024 pixels in width and 720 pixels in height is required.
    The program is completely portable, installation is not required, it does not store information in the registry.

    Download the program
    Google Drive: https://drive.google.com/file/d/1D6S...ew?usp=sharing
    Yandex.Drive: https://disk.yandex.ua/d/M2Z0CLvaH8_nHQ
    Last edited by Kassatka; 06-10-2021 at 19:57. Reason: Caption font size 4

Tags for this Thread

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