1. We have added the ability to collapse/expand forum categories and widgets on forum home.
    Dismiss Notice
  2. All Civ avatars are brought back and available for selection in the Avatar Gallery! There are 945 avatars total.
    Dismiss Notice
  3. To make the site more secure, we have installed SSL certificates and enabled HTTPS for both the main site and forums.
    Dismiss Notice
  4. Civ6 is released! Order now! (Amazon US | Amazon UK | Amazon CA | Amazon DE | Amazon FR)
    Dismiss Notice
  5. Dismiss Notice
  6. Forum account upgrades are available for ad-free browsing.
    Dismiss Notice

Better Trade Screen 3.1.2

Adds sort options, filters and generally improves the trade screen

  1. astog

    astog Chieftain

    Joined:
    May 29, 2015
    Messages:
    182
    Location:
    Minneapolis
    Better Trade Screen
    Compatible with the Australia Summer patch
    v3.1.2 Released!

    This mod tries to fix many of the glaring issues with the trade screens in Civ 6.

    CQUI Users: This mod is already included in CQUI, so you don't need a special installation.

    Track active development of this mod here.

    Main features:
    • Trade Routes can be sorted based on yields, and turns remaining. Queue multiple sorts by pressing shift.
    • Shows the correct value of turns remaining to complete trade route.
    • Trade routes can be set to repeat. Additional option that the route repeated, is the top one from the sort settings. This way you know the route repeated is always the best one.
    • You can cancel the repeated routes, from the My Routes tab within the Trade Overview screen.
    • Opening the Make Trade Route screen selects the destination of the previous trade route.
    • Overhauled Trade Overview screen
      • Shows all possible routes
      • Added filter and grouping options
      • Shows origin city, and destination city yields on the same screen
      • Clicking on a route entry goes to the trader in the origin city.
      • If no trader was found in the origin city, clicking on the route entry cycles between free traders and auto opens transfer to city screen.
      • Within the “My Routes” tab of Trade Overview screen, the routes are tracked, and show turns remaining until they finish.

    If you encounter issues on reloading (like text not showing up correctly), quit the application (to desktop) and restart. This is a Firaxis bug.



    Installation:
    • Download from this page or here if you prefer GitHub
    • Extract the mod into: Documents\My Games\Sid Meier's Civilization VI\Mods\
    • The mod should show up in Additional Content in the Main Menu.
    • Don't forget to read the guide on how to use the mod, and the FAQ!
    How to use:
    Before starting, I would suggest going through this guide I wrote: Trade Routes Guide. It goes through the basics, but also some information that is not directly intuitive like how long the trade route takes, and the formula hidden underneath it.

    Spoiler Make Trade Route – Screen :

    Clicking on the top sort bar buttons, sorts them based on their respective values. On first click it is descending, on the second click it is ascending.


    If you hold SHIFT, you can set the priority of sorts. For example, if you sort by gold and two routes have the same gold yield, you can set what next value it should be sorted by.


    If you don’t hold shift, and left click on a sort button, it deletes all other sort options (acts like a reset). You can right click on the buttons to delete that option to sort. If you delete all of them, it defaults to sorting based on players.

    Enabling the Repeat Route option, will repeat this trade route. By default, the route repeated is the last one the trader made.


    The problem with repeated route is you would always need to check if the route being repeated is best one or not. The following option solves that problem. By enabling the From Top Sort Entry, the route that gets repeated is always the top one from the sort entries you picked. For example, if you want the highest food, production route from Aachen, sort routes based on that and start a route with this option picked. When the route ends, the trade manager will check again for all routes from Aachen with sort settings you picked when you started the route (in this case, it was highest food and production). The manager, then picks the top destination from that list and begins the route again. So the route repeated is always the best one, avoiding the need to constantly check if the trader was picking the best route or not.


    Note: The sort settings that are used to repeat the routes are tied to an individual trader. So you can have one with highest food and production, and another with the highest gold, etc.

    You can cancel the repeated route from the Trade Overview screen, within the My Routes tab.



    Spoiler Trade Overview – Screen :

    Let’s start with the basics. This is a route entry.


    The sort bar works just like it did with “Make Trade Route” screen.


    There is the filter pulldown, which lets you select what you want to filter the trade routes by. This is useful to remove routes and improve performance late game.


    A new feature in v2 is the group by pulldown. It lets you group the trade routes, improving the organization of the screen


    When grouped, the groups are sorted based on their top entry.


    The entries within the group themselves can be sorted by pressing CTRL, and using the sort bar just like before. Understanding the difference between sorting within groups and sorting of groups is crucial to using this feature correctly.



    Each group only has two entries visible, but you can see all of routes within a group by pressing the expand button. You can expand all/collapse all routes in groups by pressing the expand all/collapse all button.


    If in “My Routes” tab, each route is tracked, so you know when the trade route will end.



    FAQ:
    Spoiler :

    Trade Overview panel does not open in between turns
    Spoiler :

    With v3.0 I blocked the Trade Overview panel from opening since it causes CTD. If you want to unblock this, change the following line in TradeOverview.lua
    Code:
    local blockPanelInBetweenTurns = true
    
    to
    Code:
    local blockPanelInBetweenTurns = false



    How can I cancel the automated trader?
    Spoiler :

    Go to Trade Overview screen, navigate to "My Routes" tab, there you should find all your routes. The routes that are automated, should have a red X, next to their name. Click that, and the trader should be available as soon as the route is completed.


    I still don't understand the sorting behavior of groups. Could you give a example?
    Spoiler :

    Ok, lets do a basic one. You want to find a trade route globally that gives you the most amount of money, but with the least of turns required. Start with grouping by destination (since most of the yields are based on the destination city). Within the groups (hold ctrl and shift) sort by gold-descending first, and turns remaining-ascending second. Sort the completed groups (don't hold ctrl) by gold. Voila! The top destination is the best destination to send your trader to, and the top entry within it, is shortest (in turns). Once learnt properly, this method of sorting becomes highly useful late game where there almost 10 routes to a single destination. If you still having difficulty leave a post in this discussion thread, and I could help you further.


    I can't see yields for the destination city, where are they?
    Spoiler :

    In the previous version, I had a string show that the destination city gains no benefits, but it lead to a lot of cluttering in the screen. Currently, if the destination city has no yield, you won't see any. If you preferred a string telling you that, you could re-enable it by changing the following line in TradeOverview.lua:
    Code:
    local showNoBenefitsString = false
    to
    Code:
    local showNoBenefitsString = true


    Can I disable the colors, or change the color settings?

    Spoiler :

    Go to Data/TradeOverview.lua, then open it with your favorite text editor. You will find the setting in lines 13-25 :
    Code:
    -- Color Settings for Headers
    local colorCityPlayerHeader = true
    local backdropGridColorOffset = 20
    local backdropGridColorOpacity = 140
    local backdropColorOffset = -20
    local backdropColorOpacity = 40
    local labelColorOffset = -27
    local labelColorOpacity = 255
    
    -- Color Settings for Route Entry
    local hideHeaderOpaqueBackdrop = false
    local tintTradeRouteEntry = true
    local tintColorOffset = 80
    local tintColorOpacity = 205
    local tintLabelColorOffset = 10
    local tintLabelColorOpacity = 210
    
    Remember you can hotload these changes, so you can edit these files and see how it affects the color live, without the need to restart the game.


    Can I show the sort priorities, without needing to press shift?
    Spoiler :

    You will need to edit two files, TradeOverview.lua and TradeRouteChooser.lua and change the following lines:
    Code:
    local showSortOrdersPermanently = false
    to
    Code:
    local showSortOrdersPermanently = true



    Can I change how many route entries are shown by default, when grouped?
    Spoiler :

    Change the following lines:
    Code:
    local GROUP_DESTINATION_ROUTE_SHOW_COUNT:number = 2;
    local GROUP_ORIGIN_ROUTE_SHOW_COUNT:number = 4;
    


    Changelog:
    Spoiler :

    Spoiler v1 :

    Trade Overview - Screen
    • Remembers the last opened tab.
    • Available Routes shows all possible routes, even if the trade unit is not present in the origin city.
    • Clicking on a route, in Trade Overview screen, where a free trade unit is not present in the origin city take you to a free trade unit, and opens the change city tab. This feature cycles through free trade units.
    • Trade Routes are no longer grouped by civilizations.
    • Yields are aligned based on their type.
    • You can sort trade routes by: Food, Production, Gold, Science, Culture, Faith, and Distance.
    • You can filter trade routes by: My Cities, Other Major Civilizations, City States, City States with trade quest, [EACH_CIVILIZATION_YOU_MET]
    • Tourism and Visibility bonus is now on each trade route.
    • Origin city and destination city yield are shown on the same screen.
    • City States with Trade Quest have an icon showing they have that quest.
    Make Trade Route - Screen
    • Yields are aligned based on their type.
    • You can sort trade routes by: Food, Production, Gold, Science, Culture, Faith, and Distance.
    • Added filters: Other Major Civilizations, City States with Trade Quest.
    • The yield value text is colored by their yield type.
    Change Origin City - Screen
    • Added a confirm button.
    • When the screen is opened from Trade Overview, it auto selects the new origin city.
    • Fixed bug where the teleport city lens remained active even after performing the operation.

    Spoiler v2 :

    Trade Overview - Screen
    • Sort button are colored differently based on if trade routes are sorted by that value or not.
    • Instead of distance, it shows the turns it will take to complete the route.
    • Added tooltip to show more info on how turns for the trade route was calculated.
    • Tourism bonus icon, and visibility bonus icon are hidden when the origin city is a city-state (so that when a city state sends a trade route to you, you don’t see the irrelevant icons).
    • Improved performance by reusing trade routes table, and building it only when needed.
    • Added pulldown for grouping by origin city, or destination city.
    • If grouped only the top fixed number of routes are shown for each group, hence making it perform a lot faster late game.
    • Added “Expand All”, and “Collapse All” buttons.
    • When holding shift, you can queue up sorts. So, for instance, if you sort by gold and two routes have the same gold yield, it picks the next sort function that you had selected when holding shift. If that yield is also same, it picks the next and so on.
    • When holding shift, the sort priorities are shown.
    • Right clicking on the button, deletes that option for sort.
    • When holding CTRL, you can pick sort options for the groups themselves. Shift and right click functions work here too.
    • Fixed bug where headers were colored based on the previous header.
    • Selecting a trade entry in tabs other than “Available Routes” take you to the relevant unit.
    • Routes labels are colored based on the destination's players primary color.
    • No yield label is hidden by default (unnecessarily clutters the screen).
    • Attempt at code cleanup and organization.
    Make Trade Route - Screen
    • Auto opens, when the trader is selected.
    • Sort button are colored differently based on if trade routes are sorted by that value or not.
    • Sort bar is moved to below the filter pulldown.
    • Instead of distance, it shows the turns it will take to complete the route.
    • Added tooltip to show more info on how turns for the trade route was calculated.
    • Removed filters for yields like Food, Production etc. (Felt they were unnecessary, were easy to reverse in code)
    • When holding shift, you can queue up sorts. Works just like in "Trade Overview" screen.
    • When holding shift, the sort priorities are shown.
    • Right clicking on the button, unselects that option for sort.
    • Bug fix: When the trader is selected, and another unit gets selected, the trade route lens remains open.
    • Bug fix: Removed empty new lines on yield tooltip.

    Spoiler v2.1 :

    Trade Overview - Screen
    • Adds textures to labels background to make them more readable.
    • Bug fix with turns remaining calculation being wrong for a specific case
    • Made compatible with mods that changes the GameSpeeds table. Might still cause issues, needs more testing.

    Spoiler v3.0 :

    • Fixed issue, when you had multiple trade routes being sent on the same turn, some routes would go missing in the trade overview screen.
    • Blocked the trade overview panel from opening, in between turns. Can be re-enabled from the settings, within the TradeOverview.lua.
    • Minor color tweaks to make Kongo's header more readable.
    • Added option to repeat a trade route.
    • Added option to that the route repeated is top one from the sort settings.
    • Added tooltips.
    • Moved almost all the hardcoded text to a Localized Text.xml file, making it a lot easier to add new languages. Side effect, introduces the Firaxis bug of not loading the localized text.
    • Added option to cancel the repeated route from the My Routes tab, in the Trade Overview panel.
    • Added international filter, removed Other Major Civs filter.
    • Made filters between Trade Overview panel, and Make Trade Route panel consistent with each other.
    • Make trade route screen, when opened, has the last destination automatically picked.
    • Tracking info about my running trade routes, is tracked across sessions. You should not be seeing "<30 Turn Remaining" anymore.
    • Once all sort settings are used, and two routes are still equal, it compares their net yield.

    Spoiler v3.1 :

    Performance
    1. Implemented caching to greatly improve performance. Details here. Note: If playing on a huge map, late game you will have a noticeable delay, but significantly better than v3.0.
    2. Routes will not sort/group/filter unless absolutely needed. Collapsing and expanding routes should be really fast.
    3. Increased animation speed of opening trade panels.
    4. Automation checks improvements.
    5. In Trade Overview screen, sort settings and tab setting is reset. This is to prevent the time delay when first opening the Trade Overview Panel.
    Other Changes
    1. When grouped by destination or origin, the sort settings for groups are cloned (with ascending turns) to sort settings within each group. Example: if you sort by gold, the groups themselves are sorted by gold, and routes within each group is sorted by gold and then ascending turns.
    2. Added collapse all button
    3. Expanded the Make Trade Route screen to show both the origin city and destination city yields.
    4. Fixed alignment of sort bar in Make Trade Route.
    5. When a group is collapsed, the tooltip shows the top route.
    6. Trade routes automated info is tracked across saves. You no longer have to renew trade routes when you load a save.
    7. In Trade Overview screen, routes don't sort until shift is released.
    8. When selecting a destination in Make Trade Route screen, the route path only to that city is shown.
    9. Fixed some tooltip ambiguity.
    10. Fixed issue with Make Trade Route screen opening when not needed when clicking on a route in Trade Overview screen.

     
    Last edited: Feb 26, 2017
  2. 12monkeys

    12monkeys Chieftain

    Joined:
    Nov 24, 2003
    Messages:
    440
    Location:
    Germany, Europe
    Looking very promising. WIll give it a try!

    Question: is it posible to add an info about the previous selected route, once has ended? Similar to what was in Cinv V?
     
  3. notque

    notque Artificially Intelligent

    Joined:
    Nov 13, 2005
    Messages:
    1,533
    Awesome dude! Will be testing it out!
     
  4. boudinithecivilized

    boudinithecivilized Chieftain

    Joined:
    Oct 22, 2016
    Messages:
    14
    Am I blind? I don't see the download.
     
  5. astog

    astog Chieftain

    Joined:
    May 29, 2015
    Messages:
    182
    Location:
    Minneapolis
    It should be on the top right of the page.
     
  6. astog

    astog Chieftain

    Joined:
    May 29, 2015
    Messages:
    182
    Location:
    Minneapolis
    Great suggestion, I would need to look in the game code that could let me find that info.
     
  7. notque

    notque Artificially Intelligent

    Joined:
    Nov 13, 2005
    Messages:
    1,533
    A little odd to get used to at first, but far superior. Amazing work astog!
     
  8. boudinithecivilized

    boudinithecivilized Chieftain

    Joined:
    Oct 22, 2016
    Messages:
    14
    thanks, i'm kinda used to it being in the topic
    even with your advice took me twenty seconds to find it
     
  9. JedBonnaducci

    JedBonnaducci Chieftain

    Joined:
    Oct 24, 2016
    Messages:
    12
    Gender:
    Male
    Can this be used in a current save game?
     
  10. jlc22

    jlc22 Chieftain

    Joined:
    Oct 27, 2014
    Messages:
    58
    This is great, thanks astog.

    Some suggestions beside the previous route info would be a resume previous route button and maybe an auto-resume checkbox that you tick off if you don't want to be bugged by it again. Though I haven't been as irritated by trade route spam like I was in BE so maybe the second one is unnecessary.
     
  11. astog

    astog Chieftain

    Joined:
    May 29, 2015
    Messages:
    182
    Location:
    Minneapolis
    The auto resume check box is a great idea. As for the others I'm currently looking into how to implement them, and have added them into future features to work on.
     
  12. YuenHsiaoTieng

    YuenHsiaoTieng Chieftain

    Joined:
    Aug 2, 2014
    Messages:
    12
    Auto resume is a must. I've been looking for it.
     
  13. gelodgreat

    gelodgreat Chieftain

    Joined:
    Oct 23, 2015
    Messages:
    295
    Gender:
    Male
    Location:
    Manila, Philippines
    wish you can add the city status where the trader begins so it can see if it needs food
     
  14. Tanon

    Tanon Chieftain

    Joined:
    Nov 15, 2011
    Messages:
    3
    Well done :thumbsup:

    But any idea how to make it savegame compatible? It only works for me on new games.
     
  15. astog

    astog Chieftain

    Joined:
    May 29, 2015
    Messages:
    182
    Location:
    Minneapolis
    I haven't found one yet. You could replace the base game files with the mod ones, but don't forget to back up the base game files up.
     
  16. chaorace

    chaorace Chieftain

    Joined:
    Oct 28, 2016
    Messages:
    121
    Hi! I'm working on a UI mod that's less super specific like this and more just general tweaks. I've been getting some requests to include features from your mod, so I thought I'd ask if you were open to me included your mod with mine. Obviously you'd be credited in all of the relevant places and I'd be very grateful.
     
    Hitesh12 likes this.
  17. astog

    astog Chieftain

    Joined:
    May 29, 2015
    Messages:
    182
    Location:
    Minneapolis
    You are welcome to use my mod.
     
    Hitesh12 and chaorace like this.
  18. chaorace

    chaorace Chieftain

    Joined:
    Oct 28, 2016
    Messages:
    121
    Excellent, thank you! How would you like to be credited? Is astog and a link to your profile/this thread alright or do you have any preferences?
     
  19. astog

    astog Chieftain

    Joined:
    May 29, 2015
    Messages:
    182
    Location:
    Minneapolis
    A link to this thread would be fine. If someone had a bug related to my mod, they could post it on this thread and I could fix it.
     
    Last edited: Oct 31, 2016
  20. Demonel

    Demonel Chieftain

    Joined:
    Jan 4, 2013
    Messages:
    8
    Thanks! Great mod.

    Would be also nice to see time when route will be finished. (e.g. turns left)
     

Share This Page