View Full Version : [MODCOMP] JTradeRoutes: An Improved Interface
Jeckel Oct 23, 2008, 02:41 AM !! RELEASED !! - October 23, 2008
The main problem with the Trade Route system in Colonization 2 is its interface. This not to say that the system itself is ideal, but for now I'm concentrating on a complete revamp of the interface to the system. After that is done, I will then focus on adding and enhancing the system itself.
My first step, which is practically done, is to provide more straight forward access to the information of your Trade Routes. To that end, I have narrowed it down to 4 important elements.
1) The Trade Routes themselves.
2) The Transports to move along the Trade Routes.
3) The Commodities to put in your Transports.
4) The Data over Time of the various parts of your Trade System.
This information can now be easyly accessed through a new Screen I have created. It has 5 different Pages.
The first and second Pages, "Domestic Routes" and "Foreign Routes", address the first point and show the Trade Routes in your Colonies and the Trade Routes with Europe, respectively. This Page has Buttons that allow you to Create, Edit, and Delete Trade Routes. This Page also has a Button, Assign Units To Trade Route, that will all you tell Units to use the selected Trade Route. Also note that the Create Trade Route Button is on all Pages of the Screen.
The third Page, "Transports", addresses the second important point. This Page has two Tables, the top one showing Land Cargo Transports and the bottom showing Sea Cargo Transports. I just made this Page tonight and it is basicly done. What isn't done is the popup that will allow you to assign Trade Routes to the Transport Units.
The forth Page, "Commodities", addresses the third important point and gives a comprehensive overview of the Yields Stored in all your Cities. The Table at the top of this Page shows your totals for each Yield and the Table on the right shows the total for each City. I'm not sure what else I'm going to do with this Page, but it isn't quite done yet.
The fifth and final Page, "Graphs", begins to address the forth important point, but is not near done. Currently it works similarly to the Info Screen, except better because I coded the screen correctly.. something it seems was not done with alot of the default screens... anyway.. It currently has two Graphs, one shows the History of Yields Stored in Cities and the other shows the History of Production Rates of each Yield.
Most of the work so far has been done with Python to make the Screen, but I did add a few new helper functions to CvTradeRoute objects to make it easyer to determine if a Trade Route goes to Europe and if it is a Land or Sea Trade Route. I also added a little code to CvPlayer objects so that I could keep track of the data that is displayed in the new Graphs.
Requires: Colonization v1.00
Changes: Python, SDK
Version: 1.002 - October 25, 2008
Download: JTradeRoutes Mod (http://forums.civfanatics.com/downloads.php?do=file&id=11000)
Sources: http://forums.civfanatics.com/downloads.php?do=file&id=10999
Jeckel Oct 23, 2008, 02:41 AM 1: The new Button on the Main Interface that will bring up the Trade Routes Advisor Screen.
Note the Button in the top left corner of the Trade Routes Advisor Screen. This button will close the Trade Routes Advisor Screen and open the Domestic Advisor Screen.
2: The Domestic Routes Page with an example of Flying Help Text that shows the Transport Units assigned to the Trade Route the Cursor is hovering over.
3: The Foreign Routes Page with an example of the Flying Help Text with no Transport Units assigned to a Trade Route.
4: The Transports Page with an example of the Flying Help Text showing the Trade Routes assigned to the Transport Unit the Cursor is hovering over.
5: The Commodities Page showing various information about the Yields stored in your Settlements. Notice the Flying Help Text that is displayed, all three Tables have Flying Help Text implemented.
6: The Graph Page showing the Stored Yields Graph.
7: The Graph Page showing the Yield Rates Graph.
8: The Create Trade Route Popup. This Button appears on all the Trade Routes Advisor's Pages.
9: The Edit Trade Route Popup. This Button only appears on the Domestic and Foreign Routes Pages of the Trade Routes Advisor Screen.
10: The Delete Trade Route Popup. This Button only appears on the Domestic and Foreign Routes Pages of the Trade Routes Advisor Screen.
Jeckel Oct 23, 2008, 02:42 AM 11: This Screen Shot is an example of the Popup Screen that allows you to Assign Transport Units to a Trade Route. Note that it has both a Back and an Exit Button. One will return you to the Trade Routes Advisor Page you were just at and the other will drop you to the Main Interface. This Popup Screen can be accessed from the Domestic or Foreign Routes Page.
12: This is another Screen Shot of the Assign Transports to Trade Route Popup. Note that the Wagon Train is now Unassigned from the Trade Route. Also note the Flying Help Test displaying the Wagon Train's basic info.
13: This is an example of the Popup Screen that allows you to Assign Trade Routes to a Land Transport Unit. Note that it has both a Back and an Exit Button. One will return you to the Trade Routes Advisor Page you were just at and the other will drop you to the Main Interface. This Popup Screen can be accessed from the Transports Page.
14: This is an example of the Popup Screen that allows you to Assign Trade Routes to a Sea Transport Unit. Note that it has both a Back and an Exit Button. One will return you to the Trade Routes Advisor Page you were just at and the other will drop you to the Main Interface. This Popup Screen can be accessed from the Transports Page.
Jeckel Oct 23, 2008, 02:49 AM Known Glitches:
Trade Routes don't assign/unassign right after a Table is sorted.
-FIXED in Unreleased v1.003
-Tables can not be sorted. Not ideal, but it removes the glitch until I can fix it.
Only the first 12ish Land and Sea Routes can be assigned/unassigned in the Assign Routes Screens.
-As near as I can tell, this error is in the Vanilla SDK code and is not caused by my mod. I am working on a fix for this.
Known Quirks:
The Graph Page gets real laggy after you've played a game for several hundred turns. I am looking into this and will try to bring the lag down some.
The Lines on the Graph Page will go off the top of the Graph when they reach values higher then the top. I'm trying to decide how to fix this and make the whole Graph Zoomable.
Planned Future Changes:
None
Dale Oct 23, 2008, 03:10 AM [Woodelf spot]
Well done. :)
DL'ing now to check it out.
Pilotis Oct 23, 2008, 03:35 AM Jeckel and Dale ! The White Knights !
The DomA was really driving me NUTS ! Thing just broke down completely once I got over about 12-18 routes.
Jeckel. Do I install this as a mod ? Can it be integrated with Dale's AOD/patchmod mod ?
Thank you. Thanks. Yes. Thanks ! :D
Jeckel Oct 23, 2008, 03:41 AM Its a mod, its going to be up to Dale to combine it with PatchMod or AoDII.
I'm curious to get some feed back on how my screens work with large amounts of Trade Routes. I my self rarely get more then 7 or 8 of them.
Hope it helps people and let me know any feedback ya'll have. :)
coreybowman Oct 23, 2008, 07:08 AM what do we do with SDK file?
Pilotis Oct 23, 2008, 08:11 AM Just put the folder 'JTradeRoutes' into your Colonization mod folder.
Copy or move the JTradeRoutes shortcut to your desktop or whereever (nice touch Jeckel!) to launch the mod. Or load it as normal from the Colonization advanced option on the main page.
coreybowman Oct 23, 2008, 09:40 AM so what do you do with sdk file.nothing?
Dale Oct 23, 2008, 01:54 PM The SDK file is only for people like me (modders) who wish to integrate this with their mods. For players it serves no purpose. :)
Dale Oct 23, 2008, 02:45 PM First thoughts:
1. Looked through the files, and a couple of texts aren't setup for foreign lang usage. Small thing, but will annoy our non-Engrish speakers. :)
2. Second thing I found is if you have "cheatcode = chipotle" in the ini file, SHIFT-T brings up the cheat menu not the trade menu. :D
3. My initial guns and tools counted on the graph, should they count or should only moved goods be counted on the graph?
4. On the route screens (tab 1 & 2) could have have a mark indicating that the route is already assigned? Say a small wagon or ship (depending on the type of route it is)?
5. On the unit tab (tab 3) could we get a new column called "Routes" with the routes assigned marked? EG: My wagon has route 2 & 5 off tab 1.
6. I think you should re-route (pun intended :p) the "trade route" button off the domestic advisor to your new screens. They sh1t all over Firaxis's screen. :)
Thanks for making this. :)
Jeckel Oct 23, 2008, 03:06 PM Thanx for the feedback Dale. :goodjob:
1: Thanx, I will definetly fix that. I always try to move python coded text to the xml so that at some point I, or someone else, can put the proper translated text in.
2: Oops, it shouldn't have been released with any ini file. I ment to remove it from the archive before I uploaded it.
3: Not sure what you mean with this one. Could you elaborate or restate it, just not understaning what your saying.
4: If you hold the Cursor over a Trade Route, then the Flying Help Text should list all the Units assigned to that Trade Route.
5: Like wise, if you hold the Cursor over a Transport Unit, then all the Trade Routes it is assigned to should be listed in the Flying Help Text. It is not really practical to show this in a column on the table, Trade Route names are just to long and there is no Button Image unique to each Route.
6: Well, I like the idea of hooking to button in the Domestic Advisor to bring up my new screen, but I want a direct button on the main interface. I've picked up on your dislike of new buttons on the main interface, and I can debate placement, but there are going to be too many new screens coming out and we are going to have to come up with some good way to add new buttons on the main interface screen.
As for 1 and 2, I will get them fixed right now and upload a new version. :)
Dale Oct 23, 2008, 03:15 PM For 2, in my general ini file I have the cheatcode put in. There is no ini file in your mod as you stated. It's just that SHIFT-T is assigned to 2 screens (the cheat dialog and your screens) that is the problem. :)
Didn't note the tooltips, thanks. :D
Yeah, we are going to need a nice place to put advisor buttons. There's going to be a few: trade, technology, etc etc.
Jeckel Oct 23, 2008, 03:40 PM Hehe, yea, I kinda relized what you ment with number 2 after I posted. I already changed it to Alt + T. ;)
Jeckel Oct 23, 2008, 04:36 PM Uploaded a new version, v1.001, it fixes the TXT_KEY errors and I changed the Trade Routes Advisor Screen's Key Binding from Shift + T to Alt + T.
If you don't need non English text and don't have the cheat code enabled, then you don't need the new version. :)
Dale Oct 23, 2008, 04:50 PM Awesome work! Now to implement it into AoD. :)
Dom Pedro II Oct 23, 2008, 05:02 PM Agreed. This will be going into Triangle Trade ASAP :)
Jeckel Oct 25, 2008, 02:31 PM New Version Uploaded, v1.002.
Added Advisor Menu Mod by Dale so the Trade Routes Advisor Button on the Main Interface will be shown in a second row on the top right of the monitor.
Added a Button to the top left of the Trade Routes Advisor Screen. This button will close the Trade Routes Advisor and open the Domestic Advisor.
In the Domestic Advisor, the Trade Routes Button will bring up the new Trade Routes Advisor instead of the default Domestic Advisor Trade Routes Page.
The new version was acually uploaded last night, but I got side tracked by modding my new project that I forgot to post. :p
Dale Oct 25, 2008, 03:16 PM Haha good job! :D
realistic Oct 25, 2008, 08:53 PM I have been having trouble with the mod.
When trying to assign trade routes to transports it never works. Some things I noticed, when trying to sort the trade route window by commodity or any other way makes the whole selection and assigning void. For example, I could sort by commodity, select all the tools, go to assign, pick a transport, and it will only pick one trade route for the unit. Also, if I sorted the list, and picked say, "Rum", and then went to assign, it would have that transport assigned to "tools" because I believe that is the top commodity in my UNSORTED list. Trying to pick more than one commodity fails, it only assigns one commodity no matter how many you pick.
I do find this mod useful, but I was hoping to use this mod so I could easily group my commodities and assign trade routes, it doesn't work.
Also, if I try to go to the transport menu and assign routes that way it doesn't work. Like maybe the top 15 commodities where I + or - work, but after that I click the button and nothing happens.
Pilotis Oct 26, 2008, 01:44 AM Hi Jeckel.
This is a great app but there is a problem with 'Assign Land Routes' (haven't tried sea routes EDIT see below) in the 'Transports' tab, but I think it's a prob with the vanilla Colonization engine - I saw it there as well. Anyway.
Save game attached.
192536
If you have more than 12 trade routes, when you go into the transports tab, select a wagon, then select 'assign land route', if you scroll past 12 trade routes from the top the assign/ un-assign button doesn't work.
However !! With your app I can get round the problem using the Domestic and Foreign Routes tabs.
EDIT. Ah. Only up to a point. Trade network now bigger. If I go into Domestic Trade Routes and select a route with both sea and land routes, then select 'Assign Unit' (23 possible transport units to choose from) the assign/ un-assign button only works down to about 15th unit on the list. Below that the button is dead - doesn't matter if its a sea or land transport unit..
But - thanks again !! So far I can work round the probs with big trade networks by using the assign options from the different screens.
(Just noticed Realistic's post; looks like some of those probs are related)
Pilotis Oct 26, 2008, 02:49 AM If you re-order - say using 'Source' in the Domestic Routes screen - the app 'remembers' what WAS in a particular row rather than the new item that appears there as a result of the re-order. Try the Domestic Routes tab in the savegame I posted.
Row 1: tobacco from Jamestown to Plymouth is assigned to Wagon 7.
Row 7: ore from Boston to Jamestown has Wagons 1,2,3,4 assigned
Re-order by selecting source. Row 1 is now 'ore from Boston to Jamestown' (and the mouse-over has the correct info but) if you select 'Assign Units to Trade Route' it brings up 'tobacco from Jamestown to Plymouth' i.e. the route that WAS there before the re-order.
Hum hum. :confused:
Pilotis Oct 26, 2008, 06:33 AM Hey Jeckel !
Just wanted to say that even with those foibles, this is a GREAT mod that really helps me manage and enjoy (!!!) trade management. Please keep up the great work !!! Seriously ! Can't wait to see it combined with Dale's AOD/ Patchmod !
:goodjob: :) and :thanx:
realistic Oct 26, 2008, 10:18 AM I do find the mod useful for one thing though. I thoroughly appreciate being able to see all my transports in a screen and to be able to see what each transport's trade route is. Hopefully we can get these other problems fixed, I have a great colony going and it would be nice to get the trade route PERFECT.
edit: Or, what I've done is just make about 40 trade waggons and set them all on automatic. I suppose that is just what you have to do for this game.
Jeckel Oct 26, 2008, 01:52 PM Ok, I am looking into these problems and will get them tracked down and fixed.
I have also noticed that if a Transport is Full you can not assign new Trade Routes to it. I am also looking into fixing this.
Will post again when I figure somthing out.
Impaler[WrG] Oct 27, 2008, 01:01 AM Very nice word Jeckel, the use of tabs to organize and separate different data table looks to be the way to go, in hindsight the default trade route advisor is too crampt.
Some additional points
Added a Button to the top left of the Trade Routes Advisor Screen. This button will close the Trade Routes Advisor and open the Domestic Advisor.
Consider doing this for most/all of the other screens with the buttons formated in a consistent way (perhapses matching the main screen layout?) fewer clicks to switch between screens is always nice.
Also on the commodities graphing tab do you have the ability to toggle the individual commodities on and off? If not I'd recommend you include it, the standard colonization Info screen was upgraded with this ability activated by clicking the name of the player in the legend area, the line bar to the left of the name will then toggle with the data line. Its a some what ugly hack if I remember correctly but it could be incorporated in your graph and prove very useful when working with a graph of commodities as their are so many the clutter/obscuring potential is high.
Jeckel Oct 27, 2008, 03:26 AM Thanx Impaler, I'm glad you like it.
I don't think I will add all the Advisor Buttons onto my Screen. I add the Domestic Advisor Button because that Screen can bring you to my Screen and I wanted an easy way to get back to it. I wouldn't include the other Buttons for the same reason that all the Advisor Screens don't have all the Advisor Buttons.
As for the Graph Page, yes, you can click the name of individual Yields to hide or show their corresponding Line on the Graph. I myself rarely look at more then 1 or 2 Lines on the Graph at a time.
I've looked into a the mentioned glitches.
The Sorting of Tables Issue
I didn't intend for most Tables to be sortable. It will be a little extra work to accually make it work when you sort the list each different way, but I am looking into it further and will see what I can do. For the moment, the next version will have the sort ability removed from the Tables, not ideal, but it will remove the glitch.
The rest of the problems are not caused by my Screen or the code I have written. At the moment, I have just created a better interface to the Trade Route System, but, in the end, I am still using that system to do every thing.
For example, the Assign/Unassign buttons not working once you get alot of Transports/Routes, that shows up on my Screen, just like it does on the Domestic Advisor, because I use the same Button Widgets that they used.
My next step is to delve into the SDK and fix these underlying issues. This shouldn't be to hard, relatively speaking, but I need a small break from this before I start the next phase.
It won't be to long, but I'm going to take a week and release another component I've been working on. Its Discussion Thread will be up in a few days, and I don't won't to get to detailed, but a bear just ate one of my Colonists.. :mischief:
Dale Oct 27, 2008, 04:58 AM but a bear just ate one of my Colonists.. :mischief:
Well I hope he put him in a brown paper bag and deposited it in the bin! :p
Pilotis Nov 01, 2008, 04:54 AM Hey Realistic don't be so negative.
Managing traderoutes is WAY WAY better with this mod. It's not just a viewing tool. By switching betwen the assign trade route screen and the assign transport screen you can get over the problem in my post 22. You just have to be a little patient. And the sorting function is 'great-to-have' but not vital.
It's great progress Jeckel. made my gameplay way more enjoyable.
Thanks.
Jeckel Nov 01, 2008, 03:53 PM Thanx Pilotis, I'm happy you find the mod usefull. :)
Well yall, I'm just about done with my side project, then I'm going to see about addressing some of the underlying SDK problems with the Trade Route System.
Pilotis Nov 01, 2008, 04:59 PM Outstanding !
Daneel Nov 03, 2008, 03:24 PM This is one of those mods that makes you wonder why Firaxis didn't do it this way to begin with. I can't wait to see it with the little quirks worked out of it.
Good job Jeckel!
Zuul Nov 03, 2008, 09:17 PM In the Graphs: the one with most (tools/production) is outside the window.
Jeckel Nov 04, 2008, 04:21 PM Ahh, yea, that isn't so much a glitch as I haven't coded the graph to Zoom in and out. This will be adressed at some point, but I have a few ideas of how to do it and can't decide on one.
I'm a little side tracked at the moment (Red Alert 3 is an awesome game!! :band:), but as soon as I finish taking over the world as the Allies then take it over as the Empire of the Rising Sun, I'm back to Col2. :cool:
Zuul Nov 05, 2008, 12:20 PM I have finaly tested out this mod (included in AoE).
I like it but here comes a few issues:
*Should be able to group trade routes (or up to 4 extra resourses to send).
*In addition to the minimum resourse in a city, having a threshold before the resourse will be moved.
Like min 100, threshold 200. It will then wait until the city has 200, then it will collect all over 100.
*An option to only collect full berth of resourses.
Jamis Nov 19, 2008, 11:13 AM I have finaly tested out this mod (included in AoE).
I like it but here comes a few issues:
*Should be able to group trade routes (or up to 4 extra resourses to send).
*In addition to the minimum resourse in a city, having a threshold before the resourse will be moved.
Like min 100, threshold 200. It will then wait until the city has 200, then it will collect all over 100.
*An option to only collect full berth of resourses.
Yes, great ideas.
I have a suggestion of my own...
I normally have an army of wagon trains doing my bidding, but I don't know which train is doing what just by looking at them...they all look the same.
Perhaps, when I mouse over a train or ship assigned a route, I could get a little flag or window telling me what trade routes it has been assigned.
Or, if there was a way to differentiate between the same types of wagon trains or ships? E.G. Allow me to rename them or just put a number after each one as it's created/bought. Wagon Train1, Wagon Train2, etc...
Great work, btw, Jeckel. This mod has amazing potential.
-Jamis
jenks Nov 21, 2008, 12:09 PM yeah as above, props for creating this. Auto wagon trains / trade routes are currently the most difficult micromanagement part of the game. The screen is so painfully disorganised and at present impossible to use
very looking forward to using this as it downloads :)
CrimsonRider Dec 22, 2008, 08:43 AM Hi, I don't know if this happend to anyone else, but I've got a case now where the mod incorrectly indentifies a land/sea route as land route only.
I can forward the savegame if that would help, if there is still development done on this that is.
Zuul Dec 22, 2008, 09:13 AM Well same for me.
Jeckel begun some other project (other than civ/col that is). He might be back next year.
Zuul Dec 29, 2008, 11:04 AM Only 2 days left until next year and Jeckel may be back :p. This mod sure needs an update,
Gothic_Empire Dec 30, 2008, 08:26 PM Yes, great ideas.
I have a suggestion of my own...
I normally have an army of wagon trains doing my bidding, but I don't know which train is doing what just by looking at them...they all look the same.
Perhaps, when I mouse over a train or ship assigned a route, I could get a little flag or window telling me what trade routes it has been assigned.
Or, if there was a way to differentiate between the same types of wagon trains or ships? E.G. Allow me to rename them or just put a number after each one as it's created/bought. Wagon Train1, Wagon Train2, etc...
Great work, btw, Jeckel. This mod has amazing potential.
-Jamis
Being able to rename a unit is built into the system; just click on its name on the game screen and it'll let you type whatever you want there. I've been re-naming my ships since forever, just to keep them straight.
Jeckel Jan 13, 2009, 12:55 PM Ok, I have some good news for the fans of this mod.
I have managed to get over the learning curve with the new Graphics Engine I'm working with in my RL project. Now I can settle into a normal routine of coding for the needs of the project and don't have to spend all my time experimenting and googling how to do things.
This leaves me with several free hours each week and, seeing as all my skills on EVE are taking 7 hours to 10 days, I've finnally getting back to this mod.
Main Issues Addressed in Next Version:
1: Some Routes not correctly identified as Land and/or Sea.
I think I know why this is happening and how to fix it.
2: The Graph Screen gets slower and slower the more turns you play.
This is my main goal at the moment. The problem is that I have to go through the arrays to draw the lines each time the screen is shown or change, and more turns means more time to loop through the lists.
I could draw the new lines at the end of each turn and just hide/show the correct lines when they need to be displayed, but I hate having hidden widgets taken up memory all the time when they are only used for a few minutes every now and then, bad mojo.
However, I think I have a very elegant solution. Recently I learned how to extend python with my own modules written in C. I'm thinking if I port the work of my looping code into a compiled pyd module then I should be able to get rid of alot of the lag on the Graph screen.
3: The lines on the Graph Screen go off the top when their values get large.
I will be adding two buttons that will allow you to zoom the Graph in and out, so if the lines go off the top you can zoom out and see all the lines again.
4: Trade Routes don't assign/unassign right after a Table is sorted.
I might be able to make it work with the sorting enabled, but if nothing else I will disable sorting of the various tables to remove the glitchy behavior.
If there are any other glitches or bugs that I haven't mentioned, please let me know, I'm not adding any new features this version though, save those for the version after this next one.
I don't have much free time, so no eta on the next version yet, but just wanted yall to know that I'm back on the case. :cool:
Zuul Jan 14, 2009, 11:31 AM Nice to see you back :).
m_mattimeo Jan 15, 2009, 10:22 AM Seconded. This mod makes the game playable for me late game, simple as that. So much more fun when you can tweak/micro like this. Maybe I'm just obsessive :lol:
Jeckel Jan 15, 2009, 09:14 PM Hi, I don't know if this happend to anyone else, but I've got a case now where the mod incorrectly indentifies a land/sea route as land route only.
I can forward the savegame if that would help, if there is still development done on this that is.
Well same for me.
Jeckel begun some other project (other than civ/col that is). He might be back next year.
Ok guys, I thought I knew why this was happening, but I can't seem to recreate this bug. Could someone elaborate on when this shows up. Are the cities next to the Ocean or a Lake is my main question?
Zuul Jan 16, 2009, 12:36 AM Jeckel, what version do you playtest? Dale has probably not changed anything of your code but good to be sure.
Only play AoD2, but have not tried traderoutes in a long time now. Because of the very long time to set up a good trade, it's easier to trade manually. Wich you would add the features to group traderoutes.
Jeckel Jan 17, 2009, 12:48 PM Jeckel, what version do you playtest?
Hmm, that got me thinking and maybe I already fixed that problem and I was just reading to far back in the thread looking for things to fix.
Anyway, I'm going to take that one off the list for now and if it shows itself I'll put it back on the list then.
I'm going to spend today working on the Graph page.
Jeckel Jan 17, 2009, 01:31 PM Hi Jeckel.
This is a great app but there is a problem with 'Assign Land Routes' (haven't tried sea routes EDIT see below) in the 'Transports' tab, but I think it's a prob with the vanilla Colonization engine - I saw it there as well. Anyway.
If you have more than 12 trade routes, when you go into the transports tab, select a wagon, then select 'assign land route', if you scroll past 12 trade routes from the top the assign/ un-assign button doesn't work.
This has been added to the know Glitches and I'm working on a fix. Thanx Pilotis.
Nightinggale Feb 02, 2009, 09:21 AM I really like this mod. The poor traderoute management was a really turnoff for me.
However I noticed as I increase in number of colonies so does the number of possible traderoutes and the list ends up being really long, making it hard to keep track of all traderoutes and wagon trains. It's not nice to set up a new wagon train when you have say 10 colonies.
I started to read the code to see if I could come up with something that would help and I came up with something interesting.
Concept:
I came up with a new concept which I call "traderoute groups" (or groups for short). Basically they should work the same as traderoutes did in the first colonization. The traderoute screen contains a group selector and you select one group. You then add traderoutes to that group. Once you are done you can add wagon trains or ships to the group. Adding a unit will automatically delete the traderoutes it's following and add all the routes from the group. Adding or deleting a route in a group will automatically apply this to all units using that group.
Implementation:
The first issue regarding implementation is to store the needed data. Basically all that's needed is to store a GroupID in each traderoute so all we need is an additional int in the traderoute class.
Group 0 would be the default group. If the user decides not to add more groups then nothing will change.
In the traderoute overview window there should be some sort of group selector. It can select all the groups that are in use and something called <new group>. The list of traderoutes will be filtered by the group selected meaning if group 1 is selected only the routes used in group 1 will show up in the list. Adding a traderoute will assign this traderoute to the selected group.
Units can be assigned to the traderoute.
When adding or removing a traderoute from a group: loop all units and check if the first traderoute is in the route in question. If it is, then add the new one or delete the one being deleted.
Limitations:
-I don't think you will be able to name groups. They will just have numbers (maybe somebody else knows how to save strings for this somewhere)
-Adding data to the traderoute class will most likely break savegame compability.
-If all routes are deleted in a group then the group is dead. If a player deletes all routes and adds new ones then all the units using that group will have returned to the default group.
So what do you say? Do you think this will work?
abj9562 Mar 17, 2009, 02:15 AM Is this mod still being developed? It works finr in the AODII 1.08 compiliation. But constantly crashes C4C 1.01f. I like using it with AODII and would like to use it with vanilla C4C too.
Chibiabos Mar 18, 2009, 04:08 PM I reeeeally hope the sort and select bug gets fixed.
Jeckel Mar 20, 2009, 07:00 PM I put a hold on working on this mod until the patch came out, but now that it is out I am working on this again.
I am going to begin this project from scratch. My first goal is to completly remove the current trade route system from the game. Once that is done, I am going to work from the ground up and implement the Trade Route System the way it should have been done.
The main concept is to center Trade Routes around the Wagons and Ships that do the Trade Routes.
I will post tomorrow with more details on what I'm planning. :cool:
abj9562 Mar 20, 2009, 09:52 PM I have plenty of time on my hands and can read and edit XML to an extent. So if you need a Beta tester let me know. I'll do my best to break it!
westamastaflash Mar 22, 2009, 10:23 AM This interface is great. One thing I'd like to see is the ability to automatically trade with the natives. It's a pain to keep going back to Montezumas cities and buying his silver manually...
abj9562 Mar 23, 2009, 10:05 AM Is there any quick fix to make it usable with the current 1.01f patch? Currently it is a consistent CTD under 1.01f.
Zuul Mar 28, 2009, 08:04 AM I look forward to the details on the new system.
Jeckel Apr 09, 2009, 01:12 AM Ok, sorry for the extended silence, but chalk it up to me being to busy modding to post. :mischief:
Its kinda late and I'm heading to bed, but here is a quick update on what I'm doing and what I have planned to do.
1: My main modding focus is on my personal play mod, JMod. I love playing Col2 and tweaking it a bit so I have more fun playing is my top modding priority. Good news is I can test out a lot of the theroies I have in this mod and then use what I learn in JTradeRoutes Mod.
2: I have one other Mod Project in planning stages. It is super secret, but I am fairly sure that it is going to be VERY impressive when it is done. JTradeRoutes may take a back seat to this project, but everyone will be better off in the long run for it.
3: I haven't forgotten this mod, despite what the first two items may sound like. I have a few planes layed out now.
3a: I am going to add a new GlobalDefine that will let you set how closely the different European Markets correlate. In other words, if you set this GlobalDefine to 100, then the prices would be exactly the same for all players, regardless of their Civilization, ie, if the price of Silver falls from 19 to 18 for the English, then it will also fall from 19 to 18 for the Netherlands, the French, and the Spanish.
3b: Each Player will start with 1 or more Tiles of Europe Zone around their Start Position. The Europe Zone around a given Player's Start Postion will lead to that Player's European Port. The goal being, to allow any Player to sail to any other Player's Europe Port.
3c: Each Europe Port will be a specific "number of Tiles" from each edge of the Map. That number will then be calculated against a Unit's Movment to determine the number of Turns it takes to get to the Europe Port.
3d: Map generation will be changed to allow the Europe Zone to be placed on Land Tiles, that way Land Units will be able to make the trip to Europe.
There are a few of the ideas I'm throwing around. Night all. :cool:
koma13 Apr 09, 2009, 06:07 PM Sounds great!
3a) Will the ai check for best prices?
3b) I'm curious how you plan to implement this into interface. I thought about that, there are people already confused by just one Europe screen, not to speak of 4 screens to keep track of. Maybe some tabs or an additional Europe advisor?
3d) I tried that too but ai only sends wagon trains to Europe, then doing nothing. :(
On weekend I will make xienwolf's dll guide for stupid people and try again, now that i have a competitor. :D
Roller123 Jun 18, 2009, 04:24 AM :(
10chars
Rhodes Jul 02, 2009, 07:30 PM HI
This MOD is amazing, but im having some problems when using it.
When i create a route, and assign a transport to do it, it comes to the city but doesn't go to its destination. stays resting showing if it be assigned into a route.
A doubt: there is a way to put the MOD definitely in the main game?
THX
Famyen Aug 19, 2009, 01:16 PM Hi,
I used this fantastic mod when I played COL, right after I bought it last winter.
I decided to give COL another chance, after the the new patch came out. BUT I cannot get JTrade to work.
When I load JTrade I get a error saying something like this:
There are more siblings than memory allocated for them in
CvXMLLoadUtility::SetVariableListTagPair
Current XML file is: xml\Civilizations/CIV4LeaderHeadInfos.xml
Anyone know what that means?
And what can I do to fix it?
Any help is appreciated. :)
TC01 Aug 19, 2009, 02:41 PM Hi,
I used this fantastic mod when I played COL, right after I bought it last winter.
I decided to give COL another chance, after the the new patch came out. BUT I cannot get JTrade to work.
When I load JTrade I get a error saying something like this:
Anyone know what that means?
And what can I do to fix it?
Any help is appreciated. :)
Modeltrainman got this error when loading a mod that used the 1.01f patch without that patch installed.
I don't know if JTradeRoutes is 1.01f compatible, but if it is then you need to download the patch, not from the in-game updater, but from the CFC Download Database.
If it is not, then you would have to reinstall Col and not apply the patch (assuming you already applied it). If you did already apply it, I have no idea.
Famyen Aug 20, 2009, 06:51 AM Thanks for the reply.
I think I have 1.01F installed.
I did run the file that I downloaded from the CFC download database. But in the game it still says that it is version 1.01. So I am not sure if it worked.
I guess I have to live with the ingame TradeRoutes :(
/Famy
TC01 Aug 20, 2009, 08:02 AM Thanks for the reply.
I think I have 1.01F installed.
I did run the file that I downloaded from the CFC download database. But in the game it still says that it is version 1.01. So I am not sure if it worked.
I guess I have to live with the ingame TradeRoutes :(
/Famy
v1.01 = v1.01f.
I guess that means, then, that JTradeRoutes is broken by the 1.01f/1.01 patch. So you'd have to uninstall Col, reinstall Col, and then install JTradeRoutes without installing the patch... or possibly wait for Jeckel to update it.
Karstedt Sep 10, 2009, 05:10 AM I'm getting the same XML error, "more siblings than memory allocated....". Using 1.01f patch downloaded from here. I despise the DA's trade routes and really hope this mod gets a 1.01 update.
wj_webhog Jan 24, 2010, 09:28 AM Hello,
Been playing long hours on my third attempt at colonization but now have reached a stage where trade is starting to be really problematic.
I have probably 12 colonies which all need to perform a big deal of domestic trade.
Unfortunately I am scattered on 3 different parts of the continent, which means I have to define various "groups" of colonies which should trade together with wagons.
Then each group is set to trade with the other with vessels.
The issue I have now is that to add a wagon it takes 5 minutes to configure it, not to mention it takes 3 minutes to open the trade window...
So I am very interested in this mod and was wondering if there is any chance I can force my current saves to run with it?
I have tried to add the files properly in each subfolder of the custom asset folder. Now I can start a new game with all the JTradeRoute features without having to load it as a mod.
However I can no longer load an existing savegame which is a pitty since that's exactly what I wanted to do.
Is there a way to force my savegames to work? Maybe forcing them through the mod?
Anyway I wish I knew from the beginning that the trade feature is problematic in this game, I would have loaded the mod right from the start!!!
Regards,
bivision May 02, 2010, 11:28 AM I merged Jeckel's MOD with Col 1.01f (using alpaca's split cpp files) and created new dll file (attached). You just need to replace only this file. Python and XML files remain same.
(Thanks to Jeckel for the mod, and to Refar, Fagan for the compilation steps and alpaca for the colonization makefile)
I could not use the debuggable DLL though, it gives this error -
info type COLOR_FONT_CREAM not found, Current XML files is xml\GameInfo/CIV4GraphicOptionInfos.xml
If anybody needs the changed codes, and/or like to use it in debug mode; I will share the files and details.
EDIT: Looks like Python/XML files also needed merging as discussing following threads. Merging yet to be done.
UPDATE: The original DLL I posted here has a Europe Interface screen problem (I guess my edits were not correct). I compiled the DLL again, this time I just merged JTradeRoute changed SDK files to 1.01 source files, without using the split source files (supposed to be used for debuggable DLL, so this source may not be debug friendly).
The attachment also contains the merged Python and SDK files.
Kailric May 04, 2010, 04:42 PM I merged Jeckel's MOD with Col 1.01f (using alpaca's split cpp files) and created new dll file (attached). You just need to replace only this file. Python and XML files remain same.
(Thanks to Jeckel for the mod, and to Refar, Fagan for the compilation steps and alpaca for the colonization makefile)
I could not use the debuggable DLL though, it gives this error -
If anybody needs the changed codes, and/or like to use it in debug mode; I will share the files and details.
I'd like the changed codes :)
Aymerick May 05, 2010, 07:31 AM I could not use the debuggable DLL though, it gives this error -
info type COLOR_FONT_CREAM not found, Current XML files is xml\GameInfo/CIV4GraphicOptionInfos.xml
If anybody needs the changed codes, and/or like to use it in debug mode; I will share the files and details.
To fix the COLOR_FONT_CREAM error, edit the "def getText" function in both "CvAssignTradeRoutesToUnitPopup.py" and "CvAssignUnitsToTradeRoutePopup.py" from this:
def getText(self, sText, tArgs = (), iColor = gc.getInfoTypeForString("COLOR_FONT_CREAM")):
#sText = u"%s" %(sText)
try:
sText = oLocalText.getText(sText, tArgs)
except:
pass
sText = oLocalText.changeTextColor(sText, iColor)
return sText
to this :
def getText(self, sText, tArgs = (), iColor = -2):
if (type(sText) != str) and (type(sText) != unicode):
sText = str(sText)
try:
sText = oLocalText.getText(sText, tArgs)
except:
pass
if (iColor == -2):
iColor = gc.getInfoTypeForString("COLOR_FONT_CREAM")
sText = oLocalText.changeTextColor(sText, iColor)
return sText
Aymerick
bivision May 05, 2010, 09:59 AM Thanks Aymerick for the fix. I applied it with Final_Release DLL; it works fine; I did not notice any difference. I am yet to try this with debug DLL.
Attaching edited DLL source code here (I did not separate out only changed files though).
UPDATE: I have posted new working DLL in post #68 along with the changed source files. Hence removing the source codes from here which did not work propery (Europe screen canSailEurope function seems to have corrupted)
Karstedt May 07, 2010, 09:45 PM Any chance of a compiled dll?
bivision May 11, 2010, 02:50 AM @Karstedt, Use the playable DLL I posted in #68 and apply python fixes from Aymerick (post #70)
Though I am facing problem with Domestic Advisor window (It went blank) in Vista. I think the DLL worked in XP without this issue, but I will check again.
I am no expert on modding, I blindly followed instructions to compile it. Experts advice are welcome to fix it.
Kailric May 11, 2010, 09:11 AM @Karstedt, Use the playable DLL I posted in #68 and apply python fixes from Aymerick (post #70)
Though I am facing problem with Domestic Advisor window (It went blank) in Vista. I think the DLL worked in XP without this issue, but I will check again.
I am no expert on modding, I blindly followed instructions to compile it. Experts advice are welcome to fix it.
You ever figure out the "blank" domestic advisor, mine is blank as well and I have Vista too? I'll look into it when I get a chance.
Karstedt May 12, 2010, 03:14 AM @Karstedt, Use the playable DLL I posted in #68 and apply python fixes from Aymerick (post #70)
Though I am facing problem with Domestic Advisor window (It went blank) in Vista. I think the DLL worked in XP without this issue, but I will check again.
I am no expert on modding, I blindly followed instructions to compile it. Experts advice are welcome to fix it.
Well, it runs at least. I'm using XP and the DA is blank for me too. So it's not limited to Vista. Is that dll theoretically the same as the one with only the source posted?
bivision May 12, 2010, 10:11 AM Yes Karstedt, the same code that I posted is compiled to create the DLL. Sorry for the buggy DLL; but am clueless how to fix it :(. Even sometimes Europe is going blank, re-starting the game fixing it though.
Kailric May 12, 2010, 11:16 AM Yes Karstedt, the same code that I posted is compiled to create the DLL. Sorry for the buggy DLL; but am clueless how to fix it :(. Even sometimes Europe is going blank, re-starting the game fixing it though.
It may actually be a "buggy" python file or both. As a buggy DLL often times causes a crash. Where as when there is an error in Python the code just stops drawing the screen. So, if the screen is blank as I noticed in the DA then there is somekind of error early on. When I get the chance I'll run debug diagnostics on this if someone doesn't beat me to it.
w2w2w May 13, 2010, 06:57 PM wow nice thx I like it
Karstedt May 14, 2010, 01:55 AM It may actually be a "buggy" python file or both. As a buggy DLL often times causes a crash. Where as when there is an error in Python the code just stops drawing the screen. So, if the screen is blank as I noticed in the DA then there is somekind of error early on. When I get the chance I'll run debug diagnostics on this if someone doesn't beat me to it.
Knowing nothing about python, there does appear to be a syntax error at line 413 where:
if (SelectionGroup.canAssignTradeRoute(-1)):
Should have a boolean like:
if (SelectionGroup.canAssignTradeRoute(-1, false)):
I used false because it's false in the unmodified version and the DA screen shows as the trade route grid as normal. I've done no further testing though.
UPDATE: The Europe screen gets messed up when a ship is in port too. The ship will be displayed, but all the stuff like trade goods and colonists disappear until the ship leaves port. I have no idea if that is a result of the change I made above but I doubt it. The python error points to the europe screen but since there is no europe screen in the mod I have no clues. It also says something about the unit not having sail_to_europe set.. but again, that is outside the scope of the mod as far as I can tell.
bivision May 14, 2010, 05:47 AM Code:
if (SelectionGroup.canAssignTradeRoute(-1)):Should have a boolean like:
Code:
if (SelectionGroup.canAssignTradeRoute(-1, false)):
Thanks Karstedt, this fixes the DA screen. And you are right, the Europe screen goes blank when it is needed most - when the ship is in port. This problem is not related to your fix. I get it without that.
Now I realize that, like the DLL source code, we need to merge the Mod with 1.01 version for the python / xml codes too. Which I didnt think of doing. There may be more such small bugs lurking there. Need to sit and spend good time to do a proper merger of python/xml. I am out of it for next two weeks, hoping someone will do it by then. Otherwise I will give it a shot (w/o knowing python, so it will be blind merge)
Karstedt May 14, 2010, 09:53 PM The two python errors I get at the Europe screen are:
CvScreensInterface 539
CvEuropeScreen 403
CvEuropeScreen 219
CyUnit no attribute canSailEurope
AND
CvScreensInterface 109
CvEuropeScreen 142
CvEuropeScreen 219
CyUnit no attribute canSailEurope
The lines pointed to don't seem to have anything wrong with them. So I think the canSailEurope function may be screwed in the DLL. I haven't a clue on what to do about that though.
UPDATE: The problem does go away if I use the standard 1.01 DLL in place of the mod one though. However, that probably breaks the mod at some point. I think if someone merged the changed source (available in post #1) with the 1.01 source and compiled it, it might work. I don't know how to compile though, and the tutorial thread wasn't very helpful as it doesn't seem to work for many people. And the source available for the mod appears to be ver 1.000 and not 1.002.
bivision May 25, 2010, 11:58 AM I have created the DLL again. This time I just merged the mod source code to 1.01 code, and not taking the split codes (supposed to be needed for debuggable DLL).
I played with it for a little while and it looks fine so far. Europe screen is fine now.
Please get the DLL from post #68 along with the changed source code and python files.
Do let me know if it has any issues.
Karstedt May 28, 2010, 02:14 PM I've played about 100 turns with the new DLL so far and no problems yet. I'm not using the included python files though I am using the fix for no F1 advisor. I don't know if you actually changed anything in those included .py's or not.
bivision May 29, 2010, 02:27 AM There are 3 fixes in the included .py files.
I am using these .py files and not seen any issue so far.
1. COLOR_FONT_CREAM fix as mentioned in post#70. (Though not sure if it will break anything without it, as it gave error with debuggable DLL which is N/A in the new cpp files.) (courtesey: Aymerick)
2. Domestic Advisor fix as in post#79. (courtesey: Karstedt)
3. While 'diff'ing the .py files of the MOD with 1.01F code, I came across this change and applied it as well. (Don't know how it will affect the game) -
In files CvMainInterface.py and CvMainInterfaceX.py -
MOD / 1.00 code:
screen.setButtonGFC("ImportButton", self.setFontSize(localText.getText("TXT_KEY_DEMO_SCREEN_IMPORTS_TEXT", ()), 1), "", CITIZEN_BAR_WIDTH + (MAP_EDGE_MARGIN_WIDTH * 2), CITY_TITLE_BAR_HEIGHT + CITY_VIEW_BOX_HEIGHT_AND_WIDTH, BUILD_AREA_WIDTH - MEDIUM_BUTTON_SIZE, 3 * STACK_BAR_HEIGHT / 2, WidgetTypes.WIDGET_YIELD_IMPORT_EXPORT, false, -1, ButtonStyles.BUTTON_STYLE_STANDARD)
1.01F code:
screen.setButtonGFC("ImportButton", self.setFontSize(localText.getText("TXT_KEY_DEMO_SCREEN_IMPORTS_TEXT", ()), 1), "", CITIZEN_BAR_WIDTH + (MAP_EDGE_MARGIN_WIDTH * 2), CITY_TITLE_BAR_HEIGHT + CITY_VIEW_BOX_HEIGHT_AND_WIDTH, BUILD_AREA_WIDTH - MEDIUM_BUTTON_SIZE, 3 * STACK_BAR_HEIGHT / 2, WidgetTypes.WIDGET_YIELD_IMPORT_EXPORT, true, -1, ButtonStyles.BUTTON_STYLE_STANDARD)
Karstedt Jun 01, 2010, 09:07 PM There's another bug. There is no way to pick which direction to sail from (east west). It looks like the est button never sows up, and the east button is always used no matter what. And if both sides are available, the east button seem to pick somewhat randomly.
TC01 Jun 02, 2010, 06:20 AM I'm guessing your DLL was built using alpaca's makefile (linked in the Colonization Modding Tutorials forum)?
Unfortunately, alpaca forgot a line of code in CyUnitInterface1.cpp/CyUnitInterface2.cpp that exposes the "canSailEurope(iEurope)" function to Python. You need to add it manually to one of those files. The code is this:
.def("canSailEurope", &CyUnit::canSailEurope, "bool (int iEurope)")
I had this problem when building a DLL for my Betray your Colony modcomp. I first got around it by removing the option to choose where to sail (which it sounds like is what was done here), but then I readded the function and got everything to work as normal.
bivision Jun 03, 2010, 02:58 AM I used alpaca's source code initially, but due to the canSailEurope error, I re-built the DLL using game folder source codes and JTradeRoutes mod source codes only.
Thanks for pointing the fix needed; we can make use of it, if I ever need to build a debuggable DLL.
@Karstedt, please check if you modified Europe screen py file to bypass canSailEurope function while using my buggy DLL; and still using it. You should remove it now.
I am not seeing any issue in sailing East-West.
Karstedt Jun 03, 2010, 02:38 PM It appears to be a problem with the Australia map by -sr. I just tried on the standard map and no problems. My europe screen py is unmodified. There are many different sail to europe zones on the Australia map.
I just tried the Australia map with no mods and get the same problem. So it's not the mod.
ElementalKnight Jul 14, 2010, 02:05 AM Hi all,
I'm glad there are others who find it valuable to have an improved trade interface, and who have worked towards making it happen. I'm trying to get the most recent changes to work, but I'm having no luck. I don't fully understand what's been going on the last two pages, so bear with me.
I took all of the files from post #68 and replaced their old counterparts in the game folders. I'm pretty sure everything is in the right place. But when I run a custom game on an "a_new_world" map, the trade routes screen doesn't work. The trade routes button appears in the top right of the main world map screen, but clicking on it does nothing at all. Similarly, when I bring up the Domestic Advisor, clicking on the trade routes button there does nothing.
Any help is appreciated. Getting an improved trade route interface would make this game 10x better for me. Thanks!
Karstedt Aug 28, 2010, 10:09 PM Hi all,
I'm glad there are others who find it valuable to have an improved trade interface, and who have worked towards making it happen. I'm trying to get the most recent changes to work, but I'm having no luck. I don't fully understand what's been going on the last two pages, so bear with me.
I took all of the files from post #68 and replaced their old counterparts in the game folders. I'm pretty sure everything is in the right place. But when I run a custom game on an "a_new_world" map, the trade routes screen doesn't work. The trade routes button appears in the top right of the main world map screen, but clicking on it does nothing at all. Similarly, when I bring up the Domestic Advisor, clicking on the trade routes button there does nothing.
Any help is appreciated. Getting an improved trade route interface would make this game 10x better for me. Thanks!
In post #79 I posted about a syntax error in the python file. You can open it in a text editor and goto the line I posted to fix it.
Magdovus Sep 16, 2010, 05:00 AM Hi
I just tried to run this mod. When Col restarted, it stopped and displayed the following message:
There are more siblings than memory allocated for them in
CvXMLLoadUtility::SetVariableListTagPair
Current XML file is xml\Civilisations/CIV4LeaderHeadInfos.xml
The game had to be closed manually using the Processes screen in Task Manager- it wouldn't close from the Applications screen.
I tried this a couple of times and the same thing happened both times.
I thought you may need to know.
cheers
Magdovus
|
|