Skip to content

BTS v3.1-beta

Pre-release
Pre-release
Compare
Choose a tag to compare
@astog astog released this 27 Dec 03:10
· 71 commits to master since this release

Thank You

With over 16,000+ downloads total, this has been the most popular mod I have ever made! Thank you to all who downloaded, reported bugs, and gave feature requests. This mod would not have been what it is without all of you.

Issues till now

This version of the mod is meant to address the main issue I, and all of you, have with this mod - the performance. Sometimes this has been so bad that Trade Overview panel is unusable. This version is hopefully going to fix all of that. To see what has changed we first need to see how bad the previous version was.

Performance Measurements

Prerequisites

Before we begin, some disclaimers needs to made.

  • I made all these measurements in my own computer running Intel i5-6500 + GTX 1060 + 16GB RAM. So exact numbers might vary depending upon your PC.
  • More importantly, the minimum time step in LUA is one second. Hence all measurements are rounded down to a whole number. This means 0.9 seconds gets rounded down to 0, which is obviously not representative. That is why next to each time that has 0 secs, I will give what I felt the time was (instant vs small delay vs noticable delay)
  • The performance is measured in Trade Overview panel, since that will have higher number of trade routes and we need a bigger delay to measure the performance because of the reasons mentioned above. The optimization improvements are also in Make Trade Route screen.
  • Continuing the reasons of above, I am testing this in Standard Islands Map. Save file linked below (in downloads).
  • Tests for v3.0 were done with this commit (with a minor bug fix)

Now with that out of the way lets see the results

Performance

Test, done in order, total routes = 268 v3.0 (secs) v3.1-beta (secs)
Opening Trade Overview panel, with tab Available Routes 9 1
Sorting by Production 7 0 (small delay)
Sorting by Gold + Science + Culture + Faith 14 1
With the above sort settings, expand all groups 15 1
With the above sort settings, collapse all groups 15 0 (instant)
With the above sort settings, expand a single group (first one) 11 0 (instant)
Change group setting to None (shows all 268 routes) 16 0 (small delay)

HOW??

One word - caching. I got this idea when I was playing Hearthstone of all things (yes, it was when I saw the Hidden Cache card). That night I implemented cache for trade route yields and the result was remarkable. After that, I spent the next few days caching other info (like icons, route turns, etc), optimizing loops, simplifying sort functions, reusing tables, and finally not re-sorting and re-filtering unless absolutely needed.

Why not just release it?

Because of the amount of code changed, and the number of people using this mod I don't want to release something without proper testing. I am quite excited about this version, and that is why I am releasing it as a beta.

Other changes in v3.1-beta

  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. Increased animation speed of opening trade panels.

Leaving notes

  • The beta attached here does not have button hookups for route instance. This will be added back in final release.
  • If you notice a bug, please report it. Include how you can reproduce the bug, attach the save file and the LUA log file.
  • Finally, keep hitting that next turn button!