Results 1 to 14 of 14

Thread: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

  1. #1

    Default Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    So I have been developing a mod for Total War: Rome Remastered (TWRR) for the past weeks and wanted to share a tool I developed specifically of that. Feel free to use and enhance it in any way shape or form, it is still an early version and far from finished, but I will also keep updating it.

    I do not take any responsibility for anything related to this tool. All the tools source code (. py format) is shipped to you, so you can see exactly what it does. It deletes and regenerates TWRR data files in your modfolder (.tga, .dds, .txt, .json files).

    What is Atlas?
    Basically it is a Python program which changes the way you are modding Rome Remastered. You usually mod TWRR by touching the data files (most of them are in *.txt, *.json format). With Atlas, all Data is now inside a single Configuration.xlsx file organized in Tables (Units table with all units and so on...) and all *.tga and *.dds files are inside a new structure. Ok, not all Configuration and all *.tga and *.dds files as of right now, but I am getting there.




    How does it work?
    In a very simple way - the tool is reading data from the Configuration.xlsx file and the few subfolders which contain *.tga and *.dds files and generates the known *.txt and *.json files for you. It also distributes the *.tga and *.dds files into the right folders for you.



    Can you provide a simple example?
    Until now when you add a new faction, you have to create several files of the same faction logo in different sizes and styles (greyed out etc.). With Atlas, you have to place that logo a single time inside one folder and you are done. Resizing, restyling, renaming and placing in right folders is automated. Another example: You want to rename faction Sparta to Lakedaimon? Normally you have to change a lot of different files for that. With Atlas you change a single Name value "Sparta" to "Lakedaimon" and a single Attributive valie "spartan" to "lakonian" in the Factions sheet and you are done. Want to change a cities position? Just adapt the dot in the map_regions.tga and you are done. No need to enter coordinates in different files and so on, Atlas can calculate the position correctly and uses it for generation of files that need these coordinates.

    What are the advantages of that?
    Basically three things: Cleanness, error avoidance and speed due to removed redundancies and automation. You can for example create a new faction with all characters on the map, units, unit cards, descriptions and so on in just 30 seconds (if you just copy an already present faction and change the new factions name). Also, there are error checks which are proofreading your data and warning you if anything might go wrong. For example when you define a religion for a faction but you haven't defined the icon for that religion yet, Atlas will warn you about that. As of cleanness - all of information, you have to provide only one single time inside the Configuration.xlsx. For example, you no longer have to create text entries for "parthian spy", "partian diplomat", "parthian merchant" and so on. You just define the attribute "parthian" for faction "Parthia" and Atlas will create all the agent (and more) text entries for you. Also, Atlas randomizes campaign elements each time you execute it: For example, agents and resources are placed randomly on defined regions each and every time.

    Wait, creating a new faction in under 30 seconds?
    Yes, if you copy an existing faction. You just copy a line in the Factions sheet in Configuration.xlsx, rename the faction ID, place the faction logo inside the ui/faction_logos and assign the starting region in the Regions sheet as well as unit ownership in the Units sheet (just search and replace with your copied faction, e.g. replace ", sparta" with ", sparta, athens") and you are good to go - you start the game and the new faction is standing there with all the characters, units, regions. Atlas even creates family trees for all factions for you, but you still can define a fixed name for leaders and heirs, their age and their traits if you want. If you dont, they will get random names, ages and traits, but you still can define which ones can be get randomly.l and so on.

    Why would I want to use *.xlsx for modding - what are you, a Microsoft shareholder?
    Yes I am, but the reason for that is that Excel is a great tool for organizing data - and thats what basically the *.txt and *.json files in TWRR are. They just hold data in a very inefficient, redundant and fragmented way. In *.xlsx, you can play around with that data far easier and faster in regards of filtering, sorting, searching and so on. Data is organized in sheets which contain a single table, for example you have a Regions sheet where all region data is defined and you have a Units sheet where all unit data is defined and so on.

    Are there any downsides of using this tool?
    Two - firstly, it is far from finished which means that not all data is organized there yet. For example, the battle models are missing, you have to keep editing it the old way. And secondly, some stuff is automated but not yet configurable in the Configuration.xlsx. Say you add a faction - all of the factions starting regions will be filled with garrisons consisting of random units. You can configure how many units will be added and which ones but you can't yet define for example that city Athens will get w units of unit x and the city of Sparta will get y units of unit z.

    What TWRR objects can I mod already with Atlas?
    Factions, cultures, religions, names, regions, mercenary pools, resources, landmarks, settlement levels, units (but not battle models), mounts, building chains, buildings and some settings like start date.





    What is the tool automating for you as a modder for example?
    + Generation of all .txt and .json files you see in the templates subfolder
    + Generation of all .tga and .dds files you place in the resources and ui subfolder: portraits, building cards and pictures, unit cards and pictures, captain banners, faction icons (you place them one single time there and Atlas does the rest)
    + Positions on map are calculated automatically, no need to specify for example city and port positions, resource positions, agent and character positions, ...
    + Religion distribution in regions
    + New in Version 0.10 (see full list of new features below) - shadow factions are created for you, you just have to provide the shadow factions name and its logo:








    Will this tool be developed further?
    Yes, I am improving it day by day and I will upload new versions of it. Feel free to use the code to improve it by yourself and upload too.

    Is Atlas free?
    Yes. You can donate to me in Bitcoin though if you feel that I saved you some of your valuable time: 38Bum1WZ3Ust3WTbAEeQgnqQfSYR7BpT5e - I will continue to work on the tool nonetheless, I don't care about making money, I just love modding.

    Where can I download?
    Get it here in the attachements

    How do I use it?
    1. Make sure that you have installed the latest Python version on your computer https://www.python.org/
    2. Make sure that you have installed the latest pip version on your computer https://packaging.python.org/en/late...ling-packages/
    3. Install PIL python module (needed for image processing): WIN + R, cmd.exe, pip install PIL
    4. Put the atlas folder anywhere you want, it does not matter
    5. Change the PathRootMod variable inside atlas/Globals.py to your mod folders data folder (I strongly recommend to use it only with a fresh and empty mod folder, it will not work with your mod already in place because you first have to rebuild your data inside the Configuration.xlsx)
    6. Execute run.bat - WARNING: Files in your mod folder will be deleted and recreated like for example all faction portraits, all faction logos, the files descr_strat.txt, export_descr_buildings.txt and many more. DO NOT USE IT FOR AN EXISTING MOD, USE IT FOR A NEW MOD FROM SCRATCH. If you want to port your existing mod to Atlas, you have to remodel all the mod data (factions, cultures, religions, buildings, units, ...) in Configuration.xlsx! If you don't do that but still apply Atlas to your existing mod, you will lose most or even all your mod data as it will get overwritten by the mod data that is defined in Configuration.xlsx!



    Spoiler for Update 0.10 29.01.2022 Featurelist


    + Each faction automatically gets a shadow faction with inverted colors (e.g. romans are red-gold so roman rebels are gold-red) and same unit roster. You can define name of the shadow faction as well as the icon. These are the only things you have to do, all the other tasks the tool does for you automatically
    + This enables civil wars and loyalty functions
    + Each culture can have Hording ability configured
    + Buildings can now require a coast to be built (Atlas knows which region has one and which not)
    + Scripting added - define subscripts in templates/world/maps/campaign/imperial_campaign/subscripts, they will be merged together automatically (you can have for example one script for each functionality, the tool merges them for you)
    + You do not have to declare counters in your scripts, Atlas does it for you (it recognizes which counters you use in your script)
    + Use the advantages of quik templating for your script (while, for each loops, ifs combined with your data like factions, regions, ...) for example #for @Region in @Get.AllRegions():
    + A few first Scripting functions you can use in your campaign scripts (Atlas translates them to game script language) for example: ClickOn() to click on a specific button, MessageInfo() to display a specific message
    + MessageInfo() you declare the content of your message directly in the campaign script code - no need to enter it in text\expanded_bi.txt, Atlas translates the message content to a hashkey which serves as the ID of the message and links that ID with the message title and body inside the text-files
    + Includes fully functional subscripts:
    -- + Port blockades which cost/generate money
    -- + capital changes cost money
    -- + diplomatic actions cost money
    -- + sieges cost money
    -- + sieges require a general in army
    -- + settlements can be abandoned for rebels who pay you a tribute
    + You can define special buildings which only the player can build (previous version could only define AI-only buildings)
    + The #counters subscript provides you with a lot of useful variables (counters) to work with
    - Is faction x at war with the player?
    - Does region x belong to an enemy of the player?
    - Does region x have a port?
    - ...
    + Agent costs individually configurable per culture - if a culture gets any agent type cheaper, it gets automatically recognized as a culture bonus and will be display in faction selection screen
    + improved BAT launcher - it checks automatically if you have installed your Python and pip correctly and downloads the Python packages it needs to execute (Pillow/PIP, ...)
    + Balancing Analysis mode added (activate it in Configuraiton.xlsx under Settings) which shows you which units are used the most often, which buildings cost how much and how many rounds to build and so on

    Attached Files Attached Files
    Last edited by Ocyalos; January 29, 2022 at 10:34 AM.

  2. #2

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    If this is even half as useful as described I think it deserves front page announcement.
    FREE THE NIPPLE!!!

  3. #3

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    It needs more development. This is just an early but functioning version. Early access if you will.

    There is so, so much we can expand here on functionalities (especially generating campaign scripts for example which I havent even touched yet*).

    * You could do for example

    #for @Faction in Get.AllFactions(isPlayable=True):
    #for @Region in Get.AllRegions():
    begin_monitor
    do some stuff here with every @Faction and @Region
    end_monitor
    #end
    #end

    No need to repeat anything or adjust anything after any change
    Last edited by Ocyalos; January 21, 2022 at 04:02 AM.

  4. #4

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    getting an error "no module named PIL"

  5. #5

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    Quote Originally Posted by Cameron122 View Post
    getting an error "no module named PIL"
    Thanks for the feedback. You need to install PIL python module. In CMD (Windows + R, cmd.exe), type

    pip install PIL

    If pip is not installed on your machine, you need to install it first:

    https://phoenixnap.com/kb/install-pip-windows

    pip lets you install python modules via simple CMD commands like the one above.

    PIL is a python module (like a library of functions so that you and I dont have to program it from scratch) which Atlas needs to analyze the map_regions.tga and calculates city and port positions for you and also analyze ground_types.tga and map_heights.tga to determine where it can place resources, armies and so on. It also resizes and restyles the faction logos.

    I will include PIL in the next version of Atlas. I already implemented new features like

    + Hording configurable per Culture (you just configure CanHorde TRUE or FALSE and you are done, the faction is now a horde faction with units and so on)
    + Loyalty - every faction gets duplicated and has a shadow faction (you dont have to model that shadow faction or anything, its just copied automatically from its shadowed faction, you can however have a different faction logo - the faction colors are same like parent but inverted - Primary Color is Secondary and vice versa)
    + Scripter submodule for writing campaign scripts in a much simpler way. Example

    Code:
    script
    
    monitor_event ScrollOpened ScrollOpened seige_scroll
    and I_AgentSelected general
       @Scripter.ClickOn("siege_end_button")
       @Scripter.MessageInfo("Siege aborted", "Your besieging army ended the siege due to a lack of competence and logistics involved in the operation. You need to come back with a general leading your troops.")
    end_monitor
    
    end_script
    You can shorten and simplify your campaign script by using Scripter functions like ClickOn(), or MessageInfo(), MessageYesNo(). No need to declare counters, Atlas does that for you. Also the message gets automatically generated in text/expanded_bi.txt

    This is the campaign script code from the example above that Atlas translates to:

    Code:
    script
    declare_counter dummy_f
    declare_counter dummy_r
    
    monitor_event ScrollOpened ScrollOpened seige_scroll
    and I_AgentSelected general    
    select_ui_element siege_end_button
    simulate_mouse_click lclick_down
    simulate_mouse_click lclick_up
    message_prompt
    {
    flag_counter dummy_f
    result_counter dummy_r
    title 489C337C215FE8600B1CC0568AEDD583B3991911_TITLE
    body 489C337C215FE8600B1CC0568AEDD583B3991911_BODY
    image adoption
    }
    end_monitor
    end_script
    expanded_bi.txt
    Code:
    ...
    {489C337C215FE8600B1CC0568AEDD583B3991911_TITLE}Siege aborted
    {489C337C215FE8600B1CC0568AEDD583B3991911_BODY}Your besieging army ended the siege due to a lack of competence and logistics involved in the operation. You need to come back with a general leading your troops.
    Notice how much shorter and cleaner the version is you work with.

    That script btw prevent the player from doing sieges with armies that have no general.

    The weird, long number-and-character-combination used for the text strings is a hash generated by the content of the message so it can be identified across different files exactly, it gets generated automatically, you do not have to care about it.
    Last edited by Ocyalos; January 24, 2022 at 05:21 PM.

  6. #6
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,505

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    This Tools looks great - should be indeed very usefull for moding tasks
    +rep

  7. #7

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    Atlas 0.10 UPDATE - 29.01.2022

    Added new Features:

    + Each faction automatically gets a shadow faction with inverted colors (e.g. romans are red-gold so roman rebels are gold-red) and same unit roster. You can define name of the shadow faction as well as the icon. These are the only things you have to do, all the other tasks the tool does for you automatically
    + This enables civil wars and loyalty functions
    + Each culture can have Hording ability configured
    + Buildings can now require a coast to be built (Atlas knows which region has one and which not)
    + Scripting added - define subscripts in templates/world/maps/campaign/imperial_campaign/subscripts, they will be merged together automatically (you can have for example one script for each functionality, the tool merges them for you)
    + You do not have to declare counters in your scripts, Atlas does it for you (it recognizes which counters you use in your script)
    + Use the advantages of quik templating for your script (while, for each loops, ifs combined with your data like factions, regions, ...) for example #for @Region in @Get.AllRegions():
    + A few first Scripting functions you can use in your campaign scripts (Atlas translates them to game script language) for example: ClickOn() to click on a specific button, MessageInfo() to display a specific message
    + MessageInfo() you declare the content of your message directly in the campaign script code - no need to enter it in text\expanded_bi.txt, Atlas translates the message content to a hashkey which serves as the ID of the message and links that ID with the message title and body inside the text-files
    + Includes fully functional subscripts:
    -- + Port blockades which cost/generate money
    -- + capital changes cost money
    -- + diplomatic actions cost money
    -- + sieges cost money
    -- + sieges require a general in army
    -- + settlements can be abandoned for rebels who pay you a tribute
    + You can define special buildings which only the player can build (previous version could only define AI-only buildings)
    + The #counters subscript provides you with a lot of useful variables (counters) to work with
    - Is faction x at war with the player?
    - Does region x belong to an enemy of the player?
    - Does region x have a port?
    - ...
    + Agent costs individually configurable per culture - if a culture gets any agent type cheaper, it gets automatically recognized as a culture bonus and will be display in faction selection screen
    + improved BAT launcher - it checks automatically if you have installed your Python and pip correctly and downloads the Python packages it needs to execute (Pillow/PIP, ...)
    + Balancing Analysis mode added (activate it in Configuraiton.xlsx under Settings) which shows you which units are used the most often, which buildings cost how much and how many rounds to build and so on

    You can download Version 0.10 in the first post of this thread under attachemets.

    Example for a simple script:

    Changing capital costs money:

    Code:
    monitor_event ButtonPressed ButtonPressed make_capital
        console_command add_money @Get.Setting("CostPlayerCapitalChange")
       @Scripter.MessageInfo("A New Capital", "Our capital has been relocated. A factions capital should always be as close to the center of all your regions. The further a region is away from your capital, the more likely that region is to rebel against you. Keep in mind, that changing your capital costs you denarii every time.")
    end_monitor
    Sieges can only be executed by Generals

    Code:
    monitor_event ScrollOpened ScrollOpened seige_scroll
        if I_CompareCounter LastSelectedArmyHasGeneral = 0
            and I_CompareCounter SiegeScrollOpen = 1
            ui_flash_start siege_end_button circle
            @Scripter.ClickOn("siege_end_button")
            @Scripter.MessageInfo("Siege aborted", "You can only lay siege to a settlement with armies led by a general.")
        end_if
    end_monitor
    Naval Blockades generate/cost money

    Code:
    monitor_event FactionTurnEnd FactionType slave
        #for @BlockingFaction in @Get.AllFactions():
            #for @Region in @Get.AllRegionsWithPorts():
            if I_CharacterTypeNearTile @BlockingFaction.Id admiral, 2 @{Region.PositionPort.X},@{Region.PositionPort.Y}
            and I_CompareCounter HasPort@{Region.UID} = 1
                if I_CompareCounter IsPlayer@{Region.UID} = 1
                and I_CompareCounter IsEnemy@{BlockingFaction.UID} = 1
                    inc_counter blockadeMinus 1
                    if RandomPercent < 25
                        inc_counter blockadeMinus 1
                        console_command reseed_random
                    end_if
                    if RandomPercent < 25
                        inc_counter blockadeMinus 1
                        console_command reseed_random
                    end_if
                end_if
                if I_CompareCounter IsEnemy@{Region.UID} = 1
                and I_LocalFaction @BlockingFaction.Id
                    inc_counter blockadePlus 1
                    if RandomPercent < 33
                        inc_counter blockadePlus 1
                        console_command reseed_random
                    end_if
                    if RandomPercent < 33
                        inc_counter blockadePlus 1
                        console_command reseed_random
                    end_if
                    if RandomPercent < 33
                        inc_counter blockadePlus 1
                        console_command reseed_random
                    end_if
                end_if
            end_if
            #end
        #end
    end_monitor
    
    monitor_event FactionTurnEnd FactionType slave
        #for @i in ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "32", "33", "34", "35", "36", "37", "38", "39", "40"]:
            if I_CompareCounter blockadePlus = @{i}
                console_command add_money @{Scripter.Multiply(@{i}, 100)}
                @Scripter.MessageInfo("Denarii looted from port blockade", "Our navies blockaded enemy ports and looted @{Scripter.Multiply(@{i}, 100)} denarii in total. The amount of loot per port and round varies between 100 and 4oo denarii.", "naval_blockade")
            end_if
            if I_CompareCounter blockadeMinus = @{i}
                console_command add_money -@{Scripter.Multiply(@{i}, 100)}
                @Scripter.MessageInfo("Denarii lost from port blockade", "Our enemies blockaded our ports and we lost @{Scripter.Multiply(@{i}, 100)} denarii because of that. The amount of loot per port and round varies between 100 and 4oo denarii.", "naval_blockade")
            end_if
        #end
        set_counter blockadePlus 0
        set_counter blockadeMinus 0
    end_monitor
    This faction here was created automatically, you did not have to code anything, just provide their name and their faction logo:







    Looting by blockading port - start your own pirate empire! Aarrrrrr!

    Last edited by Ocyalos; January 29, 2022 at 10:31 AM.
    CPU: AMD Ryzen 5 5600X 4,6 Ghz AM4 | GPU: 2x NVIDIA GeForce RTX 3060Ti Gainward Ghost OC 8GB GDRR6 | RAM: Corsair Vengeance RGB PRO DDR4 3600 Mhz C18 16 GB | SSD: PNY XLR8 CS3030 4TB M.2 NVMe 3 GB/s | PSU: be quiet! Straight Power 11 Platinum 550 Watt | MB: Asus ROG Strix B550-F Gaming WiFi | Case: be quiet! Silent Base 801 Silver


    Long: New York Stock Exchange: MO, XOM, AAL, AMZN, FB, MSFT, GOOGL, AMD, CRM | Wiener Börse: POST, BG, ADKO, UBS | London Stock Exchange: BP, BATS | Hong Kong Stock Exchange: 3988, 601318 | Euronext Paris: ORA, FP | Bolsa de Madrid: ELE | Coinbase: BTC
    Short: -

  8. #8
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,505

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    hey there, i´ve installed python´s latest version and have pip + pil updated + running + added the path. i use atlas 0.10 latest fix

    i´ve refreshed the settings in PathRootMod variable inside atlas/Globals.py to a new data folder. (empty). when i use the run.bat it is do some things (can´t read it because it´s to fast, but i saw "satisfied"). if i check my mods data folder, it´s still empty. when i open the configution.xlxs it is showing me the template vanilla settings. i´ve done this with a not empty data folder too, but the configuration doesn´t seem to update the setting.

    did i miss something?

  9. #9
    Gigantus's Avatar I don't get worked up over people anymore: they get a post-it with 'ridiculous' on their forehead and that's it.
    Patrician Citizen Administrator Emeritus

    Join Date
    Aug 2006
    Location
    Goa - India
    Posts
    52,120
    Blog Entries
    35

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    Great stuff!

    One suggestion: upload the tool to the downloads section (RTW here) and then simply update it there (link to it in the OP). It saves you editing the huge opening post every time which can be tedious. Don't forget to link back to the OP.

  10. #10

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    Thanks for the feedbacks, I already implemented tons of new features and also made the installation easier (it is rough now, I am sorry). But I have to postpone it a bit, as I am currently affected by Russias Invasion of Ukraine so I have other priorities right now
    CPU: AMD Ryzen 5 5600X 4,6 Ghz AM4 | GPU: 2x NVIDIA GeForce RTX 3060Ti Gainward Ghost OC 8GB GDRR6 | RAM: Corsair Vengeance RGB PRO DDR4 3600 Mhz C18 16 GB | SSD: PNY XLR8 CS3030 4TB M.2 NVMe 3 GB/s | PSU: be quiet! Straight Power 11 Platinum 550 Watt | MB: Asus ROG Strix B550-F Gaming WiFi | Case: be quiet! Silent Base 801 Silver


    Long: New York Stock Exchange: MO, XOM, AAL, AMZN, FB, MSFT, GOOGL, AMD, CRM | Wiener Börse: POST, BG, ADKO, UBS | London Stock Exchange: BP, BATS | Hong Kong Stock Exchange: 3988, 601318 | Euronext Paris: ORA, FP | Bolsa de Madrid: ELE | Coinbase: BTC
    Short: -

  11. #11
    _Tartaros_'s Avatar "Harzschütze"
    Join Date
    Aug 2009
    Location
    kvet.lɪnˌbuʁk
    Posts
    4,505

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    no problem, take care of yourself

  12. #12

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    This may well be the push I needed to truly get into modding! I was always terrified of the file structure and messing something up so horrendously it'll just come crashing down. Seriously, this tool is looking so aazing. Take care of yourself in these trying times mate! I know I'll most certainly wait for every new release.

  13. #13

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    Quote Originally Posted by Ocyalos View Post
    Thanks for the feedbacks, I already implemented tons of new features and also made the installation easier (it is rough now, I am sorry). But I have to postpone it a bit, as I am currently affected by Russias Invasion of Ukraine so I have other priorities right now
    This is an amazingly cool tool for the community, congrats on all the hard work. I hope you and your family keep safe.

  14. #14

    Default Re: Atlas - A new way to mod Rome Remastered much faster, easier and cleaner

    I'll be keeping a close eye on this. Sorry to hear you've been affected by the situation in Ukraine. I'll be reworking Total Conquest from the ground up soon, so I'll be definitely using this!

Tags for this Thread

Posting Permissions

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