VSTrade: 0.3.0.0 (3 july 2008)

A forum for the discussion and development of programs to assist working on or playing with the Vegastrike engine and data sets.
Post Reply
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

VSTrade: 0.3.0.0 (3 july 2008)

Post by GoldenGnu »

VSTrade
A Merchants Guide to Intergalactic Trading!

VSTrade is a small java program that help you trade in Vega Strike.

Features
-Trade: Find profitable cargo to trade between bases
-Prices: Price list for bases
-Cargo: Details about cargo types
-Vegamap: Starmap with path finding (original code by weaselflink)

License:
VSTrade is released under the GNU General Public License (the source code is included in the downloads)

Contributors:
-Niklas K. Rasmussen AKA GoldenGnu* (Main programmer)
-weaselflink* (Vegamap)
-prestidigitator* (Linux path fix)
-Joze Nemanic (Linux run instructions)
-peter* (Reported the parser bug and made the in-game planet names code concept)
-drinkypoo* (New tooltips)
-huginn* (Best Cargo Search and more... )
-Glazed Lists (Table sorting)
-Java CSV (CSV parsing)

* forum names

Feedback:
Please post your feature requests, bug reports, and other feedback in this thread. All feedback is greatly appreciated!

Requirements:
-Java Runtime Environment 6 update 2 or later (Get it at: http://www.java.com).
-Vega Strike 0.4.3 or later

Stable
Download: VSTrade: 0.3.0.0 ~920 KB
(3 July 2008, Release notes)

Beta
No beta available at the moment

Alpha
No alpha available at the moment

Source Code
The source code is included in the downloads

Required Libraries:
-Glazed Listed 1.7.0
-Java CSV


This post is subject to regularly editing. Please use quote if you'll like to reply to this post.
Last edited by GoldenGnu on Fri Jul 04, 2008 12:09 pm, edited 68 times in total.
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
hellcatv
Developer
Developer
Posts: 3980
Joined: Fri Jan 03, 2003 4:53 am
Location: Stanford, CA
Contact:

Post by hellcatv »

This is awesome!!
Vega Strike Lead Developer
http://vegastrike.sourceforge.net/
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

hellcatv wrote:This is awesome!!

Thank you! :) ...and right back at you, so are Vega Strike! :D

I'm thinking about adding support for getting data from different systems. So you can select your current system, and it will find the best trade routes in that system.
It's just an idea, don't know if it can be done yet, or anything. I'll need to do a lot more "research" to find out were the date is located. :)

I would also like to add the ability to find the best cargo loadout.
Sometimes it's best to get goods with the highest profit per cargo space (if you have low cargo space, and enough money).
And sometimes it's best to get goods with the highest percent profit (if you have enough cargo space and not so many money). And maybe even something in between...
drvoke
Merchant
Merchant
Posts: 57
Joined: Wed Jan 25, 2006 9:22 pm
Location: Albuquerque
Contact:

Post by drvoke »

Great program. Thanks!
My poems crush bones into powder,
You mumble like a coward,
I'm Mos Def, you need to speak louder!
(Speed Law)
private_lock
Explorer
Explorer
Posts: 13
Joined: Sat Mar 25, 2006 4:31 pm
Location: Germany
Contact:

Post by private_lock »

Great work!

Actually this was what I had in mind, when I started to program this myself. You were just a little faster! So I better stop reinventing the wheel and help you out :-)

Just some comments: (very few :-) )

According to http://vegastrike.sourceforge.net/forums/viewtopic.php?t=6529 The master_part_list.xml is outdated. So you should base the calculations on master_part_list.csv

Perhaps you could split the selection of bases with another ComboBox, according to categories like: aera, rlaan, pirates, planets, ... and making Standard the standard. (Would be nice to have them all start with upper case letters ...)

I miss the merchant ships, that I can dock to, though they are not really that profitable to trade with.

So far the sell-base-column in the bases tab is superfluous, since it always reflects the very same sellbase. You should replace it with a column for the category to help in locating the Cargo in the game.

Why did you lock down the column width? I don't want VSTrade to obscure the whole screen. Instead I like to see VS in the background showing through. (see attached picture)

When parsing the *.cvs, do you do any error checking? This could proove to be quite valuable to anybody trying to tweak the trade. Perhaps we can separate the front and backend, since my half baked program does already some checks. I offer you to provide the data sources and low level parsing. We just need to agree on an interfaces for your GUI to access my data.

How about color coding the cell background depending on the value: red risky/possible loss, green safe/guaranteed gain

What happens, when I edit the values in the table? Perhaps this could evolve into a full-blown editor for the unitfiles. Even in OpenOffice Calc the Cargo_Import column is always very crunched and hard to read.

Did you consider showing the associated image icon along with the description for the selected item?

Did you find out, how the prices of upgrades are calculated? It would be nice to have the same for hunting down upgrades one lacks.

In a perfect world we should also learn to read the universe, to offer real-game locations of those base types and perhaps even a map with instructions, how to get there :-)

As far as I know, it's possible to call native code from within a Java-Application, but can VegaStrike call Java, to interact with VSTrade, so that it becomes an ingame feature? Perhaps it would be a severe burdon to always require the Java-VM runnig. Did you ever natively compile Java? I know, it's possible, but I haven't done it so far...

You see, I'm eager to make this a decent tool for public usage...

So far
private_lock

PS: I will cease programming a little and start playing more thanks to now having your tool :-)
You do not have the required permissions to view the files attached to this post.
prolog
Hunter
Hunter
Posts: 93
Joined: Fri Sep 16, 2005 8:43 pm
Location: Winnipeg, MB
Contact:

Post by prolog »

It'd be interesting if this concept could be applied in-game (perhaps as a ship addon? "merchant unit"?), so that it gets those sorts of values, but only by visiting places.

As an example: say you've visited five Oceanic planets. When you lock on to your next oceanic planet, your "merchant unit" could, with the press of a button, display the min, max, and average prices for various commodities, based on what you've visited so far. (maybe incorporate this under the "M" command?)

This is something I'd be quite willing to work on in a few weeks, when my life gets a lot less busy. I'd just have to find a C++ compiler for Windows that'll easily compile VS. I haven't done any C++ in a few years, but I have done some before. :)
Current rig: Refurbished Robin
private_lock
Explorer
Explorer
Posts: 13
Joined: Sat Mar 25, 2006 4:31 pm
Location: Germany
Contact:

Post by private_lock »

@Prolog

This was the way I used to do it in those ancient WC privateer days ... I still have my 'invalueable' hand written lists of cargo items ... with their min and max for those few base-types.

The idea is quite charming, because its more like an in game tool than an 'outer' tweak. It will gradually learn along with your own experience and not present you with those hard coded facts.

For handling I could imagine a special button, in the cargo computer, that you must explicitly press, to record the currently presented pricelist. Too much automation will spoil the effect of 'exploring' the market.

The ingame cargo computer interface is heavily in need of some improvement. If you're familiar with C++ I strongly encourage you to do something about it :-) I'll help out with testing, but C++ isn't my first choice so I won't do it myself.

Nevertheless, it is intrinsically a different approach. I'd rather say even better than this tweaking, because it doesn't 'break' from outside into the VS-data, but rather collects and refurbishes information the user is legally supposed to know.

You could even have a 'basic' version, that will only collect min and max per cargo item and an 'advanced', that will separate the lists according to base-types.

Until your upgrade is available at the local ship dealer on the next moon, we still work on this tweak ...

Nice sunday
private_lock
hoops
Insys Pilot
Insys Pilot
Posts: 2
Joined: Mon Apr 17, 2006 4:13 pm

Post by hoops »

I may be, and probably am, just blind, but I can't find a link anywhere to get VSTrade. How can I get it?

Thanks,
Hoops
hoops
Insys Pilot
Insys Pilot
Posts: 2
Joined: Mon Apr 17, 2006 4:13 pm

Post by hoops »

nevermind

now that I am logged in I see the DL link. :oops:
Oblivion
Artisan Extraordinaire
Artisan Extraordinaire
Posts: 1269
Joined: Tue Mar 21, 2006 10:55 am
Location: Philippines

Post by Oblivion »

:D As I was saying.. there should be a thread where all the useful downloads that have not yet been integrated into 0.4.3 be available for download.

Not everyone knows how to use SVN. :)

..please.. :wink:
A Step Into Oblivion

Dreams of things that will never be,
Songs of thoughts only I can hear,
Leave me be to sleep forever,
To dream my dreams,
And sing my hymns,
Of things that will never be...
Sunfire
Bounty Hunter
Bounty Hunter
Posts: 143
Joined: Sat Apr 08, 2006 11:41 pm
Location: Livin the Dream... kinda

Post by Sunfire »

ok, i give up... i cannot get the file to work... i have the correct java version, and windows XP and i re-dld the file... the only way i can get it to even give me an error message is if i use the java web start launcher. then it says this:

an error occurred while launching/running the application

Category: Launch File Error

The following required field is missing from the launch file: <jnlp>

i tried to just use java.exe but the dos window flashes up for a millisecond and is then gone...

the only other application i could even get it to start was software for my phone.... (and um... that doesnt work either... :roll: )

any help would be awesome...
Sunfire
Bounty Hunter
Bounty Hunter
Posts: 143
Joined: Sat Apr 08, 2006 11:41 pm
Location: Livin the Dream... kinda

Post by Sunfire »

ok... erm... huh...

i re-installed java... (didnt work) uninstalled phone sw... (it worked! :) )turns out the file i needed to open it with was javaw... dont ask me why it didnt work the first or second time...

so um... nevermind! :oops: i might just be retrreded after all...
prestidigitator
Mercenary
Mercenary
Posts: 123
Joined: Sat Apr 22, 2006 8:54 pm
Location: California, USA

Post by prestidigitator »

As far as I can tell this should work in Linux with the resolution of one small issue. When specifying file paths, the code uses the following expressions:

data/Settings.java, line 31: System.getProperty("user.dir")+"\\units.csv"
data/Settings.java, line 32: System.getProperty("user.dir")+"\\master_part_list.xml"
io/DataLoader.java, line 33: System.getProperty("user.dir")+"\\settings.xml"

The '\' character in file paths is specific to Windows systems. Instead, the character constant java.io.File.pathSeparatorChar or String constant java.io.File.pathSeparator should be used, or better yet the two-argument constructors for the File class.

Also, (on all systems) it would probably be considerate to name the settings file something like 'vstrade_settings.xml' instead of the ambiguous 'settings.xml' so there is little chance it will conflict with any other program.

I'm going to try recompiling and running with these changes.
ebw
Star Pilot
Star Pilot
Posts: 6
Joined: Fri May 19, 2006 4:12 pm

Issues with Linux?

Post by ebw »

I tried VSTrade in linux for 10 minutes or so.

I set the paths correctly with the settings tab, but I didn't load any
station, only some planet types. (the .xml file wasn't in my vegastrike
distribution (Ubuntu Dapper Drake, VS 0.4.3), so I used the one shipped
with VSTrade.

Also the Find button isn't visible, then I maximise the window or
if the window is to big. (This is strange.)

If it would load the stations it would be a real help :(

mfg

Eric

EDIT: If I load both units.csv and .xml which are shipped with VSTrade I have more stations and planets. Which one shall I use?
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

private_lock wrote:Great work!

Actually this was what I had in mind, when I started to program this myself. You were just a little faster! So I better stop reinventing the wheel and help you out :-)

Just some comments: (very few :-) )


Thank you, I had a long brake, where I was doing other stuff... Now I'll start program on this little tool again..

private_lock wrote:According to http://vegastrike.sourceforge.net/forums/viewtopic.php?t=6529 The master_part_list.xml is outdated. So you should base the calculations on master_part_list.csv


okay, well I guess I must do something about it then...

private_lock wrote:Perhaps you could split the selection of bases with another ComboBox, according to categories like: aera, rlaan, pirates, planets, ... and making Standard the standard. (Would be nice to have them all start with upper case letters ...)


Good idea...

private_lock wrote:I miss the merchant ships, that I can dock to, though they are not really that profitable to trade with.


I don't know where they are stored... I have to look into it

private_lock wrote:So far the sell-base-column in the bases tab is superfluous, since it always reflects the very same sellbase. You should replace it with a column for the category to help in locating the Cargo in the game.


This is only true, if you sell to a single base. If you sell to all, you'll need to know the sell base. The idea is that you can right click and select cargo info or simply double click on the row, to get more info on that cargo

private_lock wrote:Why did you lock down the column width? I don't want VSTrade to obscure the whole screen. Instead I like to see VS in the background showing through. (see attached picture)


yes that is bad... the column problem is solved in my current version.. still got the problem with the combo-box, input-box ect. So that will be the first thing I try to fix. I'll try to release something soon!

private_lock wrote:When parsing the *.cvs, do you do any error checking? This could proove to be quite valuable to anybody trying to tweak the trade. Perhaps we can separate the front and backend, since my half baked program does already some checks. I offer you to provide the data sources and low level parsing. We just need to agree on an interfaces for your GUI to access my data.


Well I guess you already looked at my source? anyway it's included in the package (to follow the GNU GPL), The parsing is already separated from the GUI... If you got some better code I would very much like to see it...

private_lock wrote:How about color coding the cell background depending on the value: red risky/possible loss, green safe/guaranteed gain


Sound like a good idea, I don't know how to do it, yet. But I'll look into it...

private_lock wrote:What happens, when I edit the values in the table? Perhaps this could evolve into a full-blown editor for the unitfiles. Even in OpenOffice Calc the Cargo_Import column is always very crunched and hard to read.


You can't edit the values in the table (at least in my current version). I think it's a little over my scoop, I'm not a very good programmer. But then again, you never know where this will end up...

private_lock wrote:Did you consider showing the associated image icon along with the description for the selected item?


yes I did, but I need to customize the whole list then and make a special class for the cell. It can be done, but I can do it easily...
It think I'll wait to the more drastic problems, like bad GUI, is solved...

private_lock wrote:Did you find out, how the prices of upgrades are calculated? It would be nice to have the same for hunting down upgrades one lacks.


It's a long time since I last looked at the source, I don't remember... I think upgrades are equal to cargo... so there is a max and min of quantity.. Still it's not really in the scoop... But maybe later...

private_lock wrote:In a perfect world we should also learn to read the universe, to offer real-game locations of those base types and perhaps even a map with instructions, how to get there :-)


Yerh, I could be cool... There is a Java program to navigate the universe, so It should be possible to integrate it, at some point :)

private_lock wrote:As far as I know, it's possible to call native code from within a Java-Application, but can VegaStrike call Java, to interact with VSTrade, so that it becomes an ingame feature? Perhaps it would be a severe burdon to always require the Java-VM runnig. Did you ever natively compile Java? I know, it's possible, but I haven't done it so far...


I have never looked at VS source, as I can't program c, so I simply don't know... To compile java natively you'll need another compiler... which cost money, as far as I know...

private_lock wrote:You see, I'm eager to make this a decent tool for public usage...


I'm so sorry, that there was a 2+ month delay before I answered :oops:

private_lock wrote:So far
private_lock

PS: I will cease programming a little and start playing more thanks to now having your tool :-)

If you have come up with something better, then this program, please let me know, so I/we don't waste effort :)

And thank you for your comments, It's really nice with some good feedback! Now I know what to work on for then next year ;)

-GoldenGnu
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Re: Issues with Linux?

Post by GoldenGnu »

ebw wrote:I tried VSTrade in linux for 10 minutes or so.

I set the paths correctly with the settings tab, but I didn't load any
station, only some planet types. (the .xml file wasn't in my vegastrike
distribution (Ubuntu Dapper Drake, VS 0.4.3), so I used the one shipped
with VSTrade.


well, I don't know why that is... I have ubuntu on my machine, but I'm no good at linux, but I have to try it my self to find out.

ebw wrote:Also the Find button isn't visible, then I maximise the window or
if the window is to big. (This is strange.)


There is some problems with the current GUI (Graphic User Interface), I'll try to fix it as fast as possible, and release a new version.

ebw wrote:If it would load the stations it would be a real help :(

mfg

Eric


I'm sorry that it's so hard to make it work. It's properly a bug, that course the path to be wrong (as someone wrote before).


ebw wrote:EDIT: If I load both units.csv and .xml which are shipped with VSTrade I have more stations and planets. Which one shall I use?


If you use the latest release of VS, you could use the files that come with this program (as stated in the readme file). If you use the svn version, you'll have to wait for a later version, as the support for the master_part_list.csv isn't done yet.
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

@prestidigitator

could you please post the changed files?
As you probably can see on the code, I'm not that experienced...

And btw, Sorry for all those post... I find it more simple to reply one at the time
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

version 0.1.0.0 released
-Basic intigration of Vegamap
-Loadout redesigned
-Internationalized strings
-Cargo: more robust interface
-Column selection for tabels and some new columns
-Update button in Settings
-Statusbar redesigned
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
rkutai
Trader
Trader
Posts: 21
Joined: Sat Aug 05, 2006 3:30 pm
Location: Malaysia

Post by rkutai »

Greetings from space...

Excellent work GoldenGnu

If possible, at all, can this be integrated in the VS cockpit computer
"Activate defense grid, launch all starfuries, and if they move, shoot them.
If they don't move, shoot twice. They're probably hiding something."
-- Lt. Corwin in Babylon 5:"The River of Souls"
Melonhead
Bounty Hunter
Bounty Hunter
Posts: 131
Joined: Fri Sep 08, 2006 1:33 am
Location: Hampton, VA USA

Post by Melonhead »

This looks way cool, but I've tried several times to download without success--I keep getting a corrupt archive. Is it just me?
z30
Expert Mercenary
Expert Mercenary
Posts: 808
Joined: Wed Nov 02, 2005 4:42 am

Post by z30 »

rkutai wrote:Greetings from space...

Excellent work GoldenGnu

If possible, at all, can this be integrated in the VS cockpit computer


Also very interested in this, if this excellent program can be integrated into the VS cockpit computer then maybe it can be adapted for Privateer mod merchant ships as well.

This could be the start of very unique faction ships, merchants would have this facility while the bounty hunter version would have the equivalent of the most wanted list for each system.
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

@rkutai

Thank you :)

There is no way, that I know of, that this could be used inside VegaStrike. VSTrade is written in java, and VegaStrike is written in C, so I don't think it can be done, except if someone recoded it in C.

@Melonhead

It's zipped with 7-zip, which is a free (and open source) zip program. Try downloading it, and unzip with it.

I just tried to download and unzipping "vstrade_0-1-0-0.zip", and it works fine with 7-zip.

hope you get it to work :)

@z30

The concept can be use, but not the code...
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
Oblivion
Artisan Extraordinaire
Artisan Extraordinaire
Posts: 1269
Joined: Tue Mar 21, 2006 10:55 am
Location: Philippines

Post by Oblivion »

@Developers

Are there any plans for including useful user utilities like this into the SVN version itself. That way, players can avail of it immediately and it won't get lost. Just an idea, anyway. :wink: Probably in a folder /utilities plus a short readme on each of the tools.

@GoldenGnu

:D Thanks.
A Step Into Oblivion

Dreams of things that will never be,
Songs of thoughts only I can hear,
Leave me be to sleep forever,
To dream my dreams,
And sing my hymns,
Of things that will never be...
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

@All

I wanted to ask all user of VSTrade, what features you would like to see in future versions?

If none reply, I'll try to do:.
-Enable Vegamap to get bases and planets in visited systems and using them in Bases/Prices Tabs.
-Including merchant ships in the Bases and Prices Searches.
-More levels of Risk Taker, to make it even more risky. ;)
-Upgrades and Ships. Where to buy them and where to get them cheapest.

All this won't be in the next release, of course. But sooner or later...

@Oblivion

np mate, I like coding it. And I like It even more when somebody actual find it useful :)
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
peter
Bounty Hunter
Bounty Hunter
Posts: 165
Joined: Sun Feb 11, 2007 3:40 am
Location: Halifax, NS, Canada

not all cargo works?

Post by peter »

I just downloaded vstrade 0.1.0.0 on my x86 Debian system. (I'm using Sun's JVM, v1.5.0_08-b03) It looks good, but there seems to be a bug:

It seems that it has problems parsing the master_parts_list.csv it's shipped with. Browsing through cargo, it lists no average price or description for the second or later cargo in a sub-subcategory. When searching in the prices tab with that cargo, the program gets a null pointer exception (and doesn't show any results):
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at core.PriceList.compareItems(PriceList.java:57)
at core.PriceList.compareIt(PriceList.java:48)
at core.PriceList.compare(PriceList.java:39)
at core.Core.comparePriceList(Core.java:44)
at program.Program.doPriceList(Program.java:345)

e.g.
electronics\quantum computers is fine
electronics\consoles is fine
electronics\microprocessors is fine
a bogus menu item "electronics\Robotics" appears.
electronics\robotics\protocol droids is fine
another electronics\robotics item appears
electronics\Robotic laborers is broken
electronics\bionics\enhanced limbs is fine
electronics\bionics\enhanced organs is broken
... all the rest of bionics is broken.


Also, does anyone know what program will show what system to find e.g. a commerce center? vstrade has vegamap built in, but maybe the real vegamap can do more... I'll try that next if nobody replies.

If vstrade knew where to find things, it could find good trade routes (even complex ones, like buy this here, sell somewhere else and buy something else, sell somewhere else and buy something else...) and show them on the map!

BTW, I have an old laptop next to my desktop, and I run vstrade on it while I play on the desktop. If I had this desktop set up as a multiseat system (two keyboards + two monitors) I could just use the second desktop to run vstrade... I have another system set up that way, but vstrade segfaults on it. (probably the fault of the DRI drivers for the Intel g965 graphics, since they're pretty new.)
Post Reply