In-Development TradeDangerous: power-user trade optimizer

@maddavo

I've just pushed my Beta 3 changes to the main branch so we can start supporting Beta 3 properly. I tried your System.csv but there were some systems missing (e.g. 14 Herculis), which left stations stranded.

Tks - I'll get it now.
 
Regarding System.csv :

I think we need to have a discussion about merging System lists. The list that is included with TDv5 is based on <=Beta2 . There are a whole lot of systems that don't exist anymore in that list. Also, the list is referenced from Sol as 0,0,0 . There are 585 systems in the list.

It seems in Beta 3, some systems remained, some systems disappeared, some systems were renamed, some systems have MOVED.

There is a new System list for Beta 3 I have (the one that I'm sharing), that is based on the MB Beta 3 list of market systems. It doesn't have non-market systems (which we need for navigation). It is referenced from the galactic centre (although some people have been saying it's not the centre) with the offset being 49985, 40985, 24105.

There are some discussions going on in another thread about the differences in Beta 3 and listing systems. Should we disregard preBeta3 data and just add to the new?
 
Where can I find directions on how to use these files and insert them into TD

Just replace the existing one. They are all in the "data" subdirectory of TD.

@maddavo: It's not galaxy center. If it were then Sagittarius A* would need to be at (0,0,0) which it isn't.
 
Last edited:
I have created a new System.csv merging our old data with the new Beta3 market system data . There may be old systems that we need to remove or update their coords.

Also, I noticed that there are 4 notable systems that have MOVED:

Code:
'Aulin'	-50004.6875	-40952.3125	-24100.25	'Premium Beta2'	'2014-10-21 17:16:31'
'Aulin'	-49965.3125	-41017.6875	-24109.75	'Beta3'	'2014-10-30 23:05:00'
'LHS 3006'	-50006.96875	-40955.90625	-24106.71875	'Premium Beta2'	'2014-10-21 17:16:31'
'LHS 3006'	-49963.03125	-41014.09375	-24103.28125	'Beta3'	'2014-10-30 23:05:00'
'LHS 369'	-49975.28125	-40958.65625	-24082.84375	'Not Present'	'2014-10-21 17:16:31'
'LHS 369'	-49994.71875	-41011.34375	-24127.15625	'Beta3'	'2014-10-30 23:05:00'
'Styx'	-50009.3125	-40947.25	-24098.96875	'Premium Beta2'	'2014-10-21 17:16:31'
'Styx'	-49960.6875	-41022.75	-24111.03125	'Beta3'	'2014-10-30 23:05:00'
 
Aulin hasn't moved. You converted it the wrong way. You have to add the offset (49985, 40985, 24105) to the sol-centric coordinates, and all new coordinates are positive not negative.

Also be aware that there are now systems with the same name but different coordinates (eg Chara), which will currently not work with TD.
 
Last edited:
Aulin hasn't moved. You converted it the wrong way. You have to add the offset (49985, 40985, 24105) to the sol-centric coordinates, and all new coordinates are positive not negative.

Also be aware that there are now systems with the same name but different coordinates (eg Chara), which will currently not work with TD.

AH THANX - working...

OK - now I have combined the System.csv with correctly converted (I hope) old systems and new market systems - 1124 systems in total so far. Pls check and let me know if there are problems.

Cheers!
 
Last edited:
Looks like TD is again not looking at the stock and/or time stamp when sending me off on a trade run.

I'm getting this:
Code:
D:\Games\TD>trade.py -v run --credits 537700 --ship cobra --capacity 29 --ly-per 13.27 --insurance 14000 --from "Derrickson"
With 537.700cr / From Derrickson's Escape / To Anywhere
29 cap, 2 hops, max 2 jumps/hop and max 13.27 ly/jump

KERIES/Derrickson's Escape -> AULIN/Aulin Enterprise:
 >-> At KERIES/Derrickson's Escape, Buy: 29 x Bertrandite (@2514cr),
  |   KERIES -> AULIN -> DAHAN
  +  At DAHAN/Dahan Gateway, Buy: 29 x Uranium (@1695cr),
  |   DAHAN -> AULIN
 <-< AULIN/Aulin Enterprise gaining 54.955cr => 578.655cr total

From this data for the Derrickson's Escape station:
Code:
# TradeDangerous prices for Derrickson's Escape

# REMOVE ITEMS THAT DON'T APPEAR IN THE UI
# ORDER IS REMEMBERED: Move items around within categories to match the game UI

# File syntax:
# <item name> <sell> <buy> [ <demand units><level> <stock units><level> [<timestamp>] ]
#   '?' or 'unk' indicates unknown values (don't care),
#   '-' or 'n/a' indicates 'not available' item,
#   Level can be '?', 'L', 'M' or 'H'
# If you omit the timestamp, the current time will be used when the file is loaded.

#     Item Name               Sell Cr  Buy Cr    Demand    Stock

@ KERIES/Derrickson's Escape
   + Chemicals
      Explosives                  353       0      458M        -
      Hydrogen Fuel               147     149         ?     200M
   + Consumer Items
      Clothing                    361       0       27L        -
      Consumer Tech              7363       0        1H        -
      Dom. Appliances             611       0       24M        -
   + Foods
      Animal Meat                1563       0        4H        -
      Coffee                     1485       0       16M        -
      Fish                        798       0       21M        -
      Food Cartridges             228       0      265H        -
      Fruit and Vegetables        417       0       72M        -
      Grain                       272       0       91M        -
      Synthetic Meat              314       0       30M        -
      Tea                        1758       0        6H        -
   + Legal Drugs
      Beer                        241       0      126M        -
      Liquor                      801       0       45H        -
      Narcotics                   210       0       56L        -
      Tobacco                    5348       0       46H        -
      Wine                        329       0       10M        -
   + Machinery
      Mineral Extractors          815       0      946H        -
      Power Generators            594       0        7L        -
      Water Purifiers             346       0       12L        -
   + Medicines
      Basic Medicines             435       0       90H        -
      Combat Stabilisers         2976       0        1L        -
      Performance Enhancers      6954       0        6L        -
      Progenitor Cells           7363       0        1H        -
   + Metals
      Cobalt                      668     685         ?       9L
      Gold                       9761    9762         ?       1L
      Palladium                 13793   13793         ?       1L
      Silver                     4920    4974         ?      10L
   + Minerals
      Bauxite                      91     107         ?     236L
      Bertrandite                2485    2514         ?       1L
      Coltan                     1359    1392         ?       3L
      Gallite                    1901    1924         ?       4L
      Indite                     2172    2197         ?       1L
      Lepidolite                  540     563         ?       9L
      Rutile                      281     295         ?      14L
      Uraninite                   853     875         ?       8L
   + Technology
      Bioreducing Lichen         1241       0      613H        -
      H.E. Suits                  286       0      126L        -
   + Waste
      Biowaste                     18      24         ?      13M
   + Weapons
      Non-Lethal Wpns            1939       0       11M        -
      Personal Weapons           4706       0       19H        -
      Reactive Armor             2361       0       16H        -

It also appears that the demand for items that are in stock is always reset to ? from - on every update that I make.
 
Last edited:
OK - now I have combined the System.csv with correctly converted (I hope) old systems and new market systems - 1124 systems in total so far. Pls check and let me know if there are problems.

I'm to lazy to check all the coords right now.

One thing: You didn't escape the singe quote char ' in the names which results in worng system names. Escaping is done by doubling the quote.
'Ya'Nomisiyaces' -> 'Ya''Nomisiyaces'
 
One thing: You didn't escape the singe quote char ' in the names which results in worng system names. Escaping is done by doubling the quote.
'Ya'Nomisiyaces' -> 'Ya''Nomisiyaces'

Done.

Also, I'm noticing there are some systems that are marked as 'Beta2-not3' that no longer exist but some do exist. I am gradually going through and removing the ones that don't exist anymore and retagging the ones that do exist as 'Beta2'.

Another issue is the names of the Wredguia* systems. I entered "WREDGUIA EZ-M B48-0" into the GM and it took me to "CEPHEI SECTOR NN-T B3-0" so these have probably all been renamed.
 
Using v5.0.0 when I run "python trade.py run -h" (or any other command line) on ubuntu linux machine, I get this error:
Code:
  File "trade.py", line 471
    print(*summaries, sep=' / ')
          ^
SyntaxError: invalid syntax

Any ideas what might be wrong?
 
Getting this when trying to route between aulin and eranin (basic test to see if it works) while using maddavo's data:

Code:
C:\Users\Artip\tradedangerous>trade.py nav aulin eranin

Traceback (most recent call last):
  File "C:\Users\Artip\tradedangerous\trade.py", line 1090, in <module>
    main()
  File "C:\Users\Artip\tradedangerous\trade.py", line 1078, in main
    tdb = TradeDB(debug=args.debug, dbFilename=args.db, buildLinks=False, includeTrades=False)
  File "C:\Users\Artip\tradedangerous\tradedb.py", line 355, in __init__
    self.reloadCache()
  File "C:\Users\Artip\tradedangerous\tradedb.py", line 425, in reloadCache
    buildcache.buildCache(dbPath=self.dbPath, sqlPath=self.sqlPath, pricesPath=self.pricesPath, importTables=self.import
Tables, debug=self.debug)
  File "C:\Users\Artip\tradedangerous\buildcache.py", line 627, in buildCache
    processImportFile(tempDB, Path(importName), importTable, debug=debug)
  File "C:\Users\Artip\tradedangerous\buildcache.py", line 587, in processImportFile
    db.execute(sql_stmt, linein)
sqlite3.IntegrityError: NOT NULL constraint failed: Station.system_id

Everything is up to date, and I didn't find any obvious mistakes in the .csv files this time. Anybody know what's up?
 
Using v5.0.0 when I run "python trade.py run -h" (or any other command line) on ubuntu linux machine, I get this error:
Code:
  File "trade.py", line 471
    print(*summaries, sep=' / ')
          ^
SyntaxError: invalid syntax

Any ideas what might be wrong?

Snake Man you ol' dog you, go back to ARMA ;)
Try grabbing the latest version, else check the last line of the error msg and look in the problem file for the culprit (delete as required).
 
Everything is up to date, and I didn't find any obvious mistakes in the .csv files this time. Anybody know what's up?

This looks like TD tried to rebuild the database and wanted to insert an station with a link to a system which does not exist.

You can try "trade.py -ww nav aulin eranin" do see more debug output. You should see lots of "Values:" lines. The last one would be the one which results in the error.

- - - - - Additional Content Posted / Auto Merge - - - - -

Using v5.0.0 when I run "python trade.py run -h" (or any other command line) on ubuntu linux machine, I get this error:
Code:
  File "trade.py", line 471
    print(*summaries, sep=' / ')
          ^
SyntaxError: invalid syntax

Any ideas what might be wrong?

Maybe an older python version? I'm using 3.4.1 (on windows 7) and don't get this error.
 
This looks like TD tried to rebuild the database and wanted to insert an station with a link to a system which does not exist.

You can try "trade.py -ww nav aulin eranin" do see more debug output. You should see lots of "Values:" lines. The last one would be the one which results in the error.

Found the problem inside of maddavo's Stations.cvs, whichever version was available roughly 6 hours ago. Values triggering it were

Code:
'Luyten[B][U][COLOR="#FF0000"]'[/COLOR][/U][/B]s Star','Still Outpost',0
[...]
'Ye[B][U][COLOR="#FF0000"]'[/COLOR][/U][/B]Kuapemas','Hawke''s Progress',0

Solved by fixing the broken syntax highlighted. All's working well now, thanks!
 
Found the problem inside of maddavo's Stations.cvs, whichever version was available roughly 6 hours ago. Values triggering it were

Code:
'Luyten[B][U][COLOR="#FF0000"]'[/COLOR][/U][/B]s Star','Still Outpost',0
[...]
'Ye[B][U][COLOR="#FF0000"]'[/COLOR][/U][/B]Kuapemas','Hawke''s Progress',0

Solved by fixing the broken syntax highlighted. All's working well now, thanks!

Ah! Thanx for finding that. The Station.csv is rebuilt whenever a new station is added and I see now the code was handling station names OK but not system names. Fixed now.
 
Snake Man you ol' dog you, go back to ARMA ;)
Try grabbing the latest version, else check the last line of the error msg and look in the problem file for the culprit (delete as required).
Oh my, I saw your nick earlier and was thinking if this is the old school OFP friend of mine but thought nah it cant be. Wow am I happy to see you here :)

Just checked my ubuntu's python version and its oddly: Python 2.7.6 - so I guess I'm off to downloading latest version somehow.
 
Back
Top Bottom