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
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:I merged it all... and it compiles fine :)
Great. Does that mean further contributions can come in this diff-file-format, too?
GoldenGnu wrote:Looks like you already did something in the MultiSelectionList (and not NodeListModel), so, I won't look into it anyway... :P
Only overrode the clearSelection() method. The other change in Node proved unnecessary for my purposes afterwards. But as it should be there anyway, I kept it there.
GoldenGnu wrote:I have some minor issues, about the way the GUI look now.
Feel free, I don't mind where my additions are actually placed. :) Below are only my thoughts about why this and that.
GoldenGnu wrote:I think, the select/deselect buttons should be on the top, with the other buttons, if you don't agree, please say so... I'm going to change it, now... but, we can always change it back. I'll add a + (plus) to select, and a - (minus) to deselect. If you have better option for symbols, please share them :)
If I can think of one I'll tell you. :) I put them below in order to not get confused with the other three buttons that actually modify the list. I use select/deselect quite often and did not want to accidentally push one of the other three.
GoldenGnu wrote:I also think that checking and unchecking the checkboxes, when one of them is click, are a bad option (will confuse the user, as it's none-standard behavior). so, I think we should change them to radiobuttons, with a "normal search" option.
I completely agree. I looked through the Swing tutorial, but was not able to provide a respective GUIFactory method so far. What I did is just a workaround, so the function can be tested.
GoldenGnu wrote:Also, just to be sure, the best cargo search, will find the best trade routes for each cargo type, right? (Just need to be sure ;) )
Yes. Both for best average % category and best average $ category. If multiple trade routes are best in each category, they are all displayed. I used bestTrade() as a starting point and template.

Actually, thinking of it, this could replace the previous best trade completely? The information is still there ... you only have to sort the respective table column.
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

huginn wrote:
GoldenGnu wrote:I merged it all... and it compiles fine :)
Great. Does that mean further contributions can come in this diff-file-format, too?
I think that'll be okay... or a SVN Patch...
I did add the diff by hand, thou... but I sure I can learn to do it the way you explained...
huginn wrote:
GoldenGnu wrote:Looks like you already did something in the MultiSelectionList (and not NodeListModel), so, I won't look into it anyway... :P
Only overrode the clearSelection() method. The other change in Node proved unnecessary for my purposes afterwards. But as it should be there anyway, I kept it there.
I think the changes to Node, should be changed somewhat. It only include that name, as hash. And there will be multiple sub classes instances of Node, with the same name. I don't know anything about hashes, but I think it should use the Node.getPath() string as well, for it to be unique.
huginn wrote:
GoldenGnu wrote:I have some minor issues, about the way the GUI look now.
Feel free, I don't mind where my additions are actually placed. :) Below are only my thoughts about why this and that.
Okay, I'll change it and release the source, so you can work with that, when you add your new column :) It not very stable ATM. so releasing a new version, might not be the best idea...
huginn wrote:
GoldenGnu wrote:I think, the select/deselect buttons should be on the top, with the other buttons, if you don't agree, please say so... I'm going to change it, now... but, we can always change it back. I'll add a + (plus) to select, and a - (minus) to deselect. If you have better option for symbols, please share them :)
If I can think of one I'll tell you. :) I put them below in order to not get confused with the other three buttons that actually modify the list. I use select/deselect quite often and did not want to accidentally push one of the other three.
True, I'll change it anyway, thou :P If it becomes a problem, we can change it back...
huginn wrote:
GoldenGnu wrote:I also think that checking and unchecking the checkboxes, when one of them is click, are a bad option (will confuse the user, as it's none-standard behavior). so, I think we should change them to radiobuttons, with a "normal search" option.
I completely agree. I looked through the Swing tutorial, but was not able to provide a respective GUIFactory method so far. What I did is just a workaround, so the function can be tested.
Yerh, I haven't used RadioButtons, yet... that's why they are not in GUIFactory, yet... hehe... I'll add them, now... so we can get a proper GUI. :)
huginn wrote:
GoldenGnu wrote:Also, just to be sure, the best cargo search, will find the best trade routes for each cargo type, right? (Just need to be sure ;) )
Yes. Both for best average % category and best average $ category. If multiple trade routes are best in each category, they are all displayed. I used bestTrade() as a starting point and template.

Actually, thinking of it, this could replace the previous best trade completely? The information is still there ... you only have to sort the respective table column.
BestTrade has its force, when search with multiple bases/planets. It's easy to find the best route, in a system by just adding all the bases, and then using BestTrade, it won't give as many results, as BestCargo, So, you'll have to look at less data... but that's just my opinion. I like the best cargo search, thou... It also have its force...

I think that upgrades and maybe other cargo categories are filter out by BestTrade. I'm not sure, thou... I'm also quite sure, that there is no money in moving upgrades, as they'll be sold for less, when they have been used??? I'm not sure, thou... We/I should properly look into it, at some point...
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:I think the changes to Node, should be changed somewhat. It only include that name, as hash. And there will be multiple sub classes instances of Node, with the same name. I don't know anything about hashes, but I think it should use the Node.getPath() string as well, for it to be unique.
Hashes need not and cannot be unique. The idea is: 2 hashes not identical -> the objects are not equal (Not the other way!). They should be diverse if possible. I traded speed for accuracy, though. As long as equal Nodes have identical hashes, every implementation should be OK here.
GoldenGnu wrote:I think that upgrades and maybe other cargo categories are filter out by BestTrade. I'm not sure, thou ...
Not to my knowledge. I understand that BestTrade just takes the best two rows regardless the cargo.
GoldenGnu wrote:I'm also quite sure, that there is no money in moving upgrades, as they'll be sold for less, when they have been used??? I'm not sure, thou... We/I should properly look into it, at some point...
That's true. I wanted to understand the pricing and looked into the VS-source. (In more detail, I wanted to understand, what the pricedeviation does exactly, as I have a slightly different understanding of deviation. In VS it does describe the price-range, as does vstrade.)

Upgrades are always sold at half. So, there is only a profit, if the current profit exceeds 100%. :)
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

huginn wrote:
GoldenGnu wrote:I think the changes to Node, should be changed somewhat. It only include that name, as hash. And there will be multiple sub classes instances of Node, with the same name. I don't know anything about hashes, but I think it should use the Node.getPath() string as well, for it to be unique.
Hashes need not and cannot be unique. The idea is: 2 hashes not identical -> the objects are not equal (Not the other way!). They should be diverse if possible. I traded speed for accuracy, though. As long as equal Nodes have identical hashes, every implementation should be OK here.
Still without knowing a thing about it... the problem is not the cargo itself, as it has a unique name (thou the same in each base) but the categories.. They can have the same name, in each base, an therefore be tricky... It's a problem in 0.2.0.9, as using the arrow keys on the cargo ComboBox, will not go trough the list, but will go back to the last category of the same name. I fixed that however, by using the getPath, in Node.equals()
huginn wrote:
GoldenGnu wrote:I think that upgrades and maybe other cargo categories are filter out by BestTrade. I'm not sure, thou ...
Not to my knowledge. I understand that BestTrade just takes the best two rows regardless the cargo.
You're properly, right. It's ages since I look at it last. And you look at it not so long ago :)
huginn wrote:
GoldenGnu wrote:I'm also quite sure, that there is no money in moving upgrades, as they'll be sold for less, when they have been used??? I'm not sure, thou... We/I should properly look into it, at some point...
That's true. I wanted to understand the pricing and looked into the VS-source. (In more detail, I wanted to understand, what the pricedeviation does exactly, as I have a slightly different understanding of deviation. In VS it does describe the price-range, as does vstrade.)
So, the implementation, is correct in VSTrade? that would be nice... If it need changing, I would really love to have your help... As you read C, and I don't. And you're cleaver and I'm not (I hope I'm J/K about the last part, hehe ;) )
huginn wrote:Upgrades are always sold at half. So, there is only a profit, if the current profit exceeds 100%. :)
So, they should be filtered out of the trade search, then? what do you think? I don't know if any of them, have 100% profit... or we could just divide by two on the sellBase, when checking if they give profit...

Anyway, something should be done... :) Thanks for the info, it's very helpful... It's nice that you care t help me code VSTrade, it sure makes it a lot more fun...
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:Still without knowing a thing about it... the problem is not the cargo itself, as it has a unique name (thou the same in each base) but the categories.. They can have the same name, in each base, an therefore be tricky... It's a problem in 0.2.0.9, as using the arrow keys on the cargo ComboBox, will not go trough the list, but will go back to the last category of the same name. I fixed that however, by using the getPath, in Node.equals()
I completely understand you. (I saw this yesterday when I still got duplicate results for BestCargoTrades.) Just using the name for the hash was a quick fix only, which works, but naturally it's not perfect. Anyway, I would return to the topic only, if performance problems occur, which I doubt. Currently it works.
GoldenGnu wrote:So, the implementation, is correct in VSTrade? that would be nice... If it need changing, I would really love to have your help... As you read C, and I don't.
Yes it is, as far I checked. And, by the way, C/C++ is not really hard to read, if you know Java. The constructs are almost the same. My guess is, you'd do just fine. It's programming in it that can get more difficult than Java.
GoldenGnu wrote:(I hope I'm J/K about the last part, hehe ;) )
;) Sure you are. Cannot be otherwise, as I'm in the stage of constantly losing more and more neurons. ;)
GoldenGnu wrote:
huginn wrote:Upgrades are always sold at half. So, there is only a profit, if the current profit exceeds 100%. :)
So, they should be filtered out of the trade search, then? what do you think? I don't know if any of them, have 100% profit... or we could just divide by two on the sellBase, when checking if they give profit...
I'd keep the upgrades just for the fun of it with the adjusted sell price (min/2) and see what happens. :) In the end, it's a valid trade.

Btw, are ships in the cargo list as well? I never encountered them so far and cannot test right now.
GoldenGnu wrote:Anyway, something should be done... :) Thanks for the info, it's very helpful... It's nice that you care t help me code VSTrade, it sure makes it a lot more fun...
Glad I can be of help. :)
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

huginn wrote:
GoldenGnu wrote:Still without knowing a thing about it... the problem is not the cargo itself, as it has a unique name (thou the same in each base) but the categories.. They can have the same name, in each base, an therefore be tricky... It's a problem in 0.2.0.9, as using the arrow keys on the cargo ComboBox, will not go trough the list, but will go back to the last category of the same name. I fixed that however, by using the getPath, in Node.equals()
I completely understand you. (I saw this yesterday when I still got duplicate results for BestCargoTrades.) Just using the name for the hash was a quick fix only, which works, but naturally it's not perfect. Anyway, I would return to the topic only, if performance problems occur, which I doubt. Currently it works.
Now I'm not sure if the changes I made to Node.equals should stay or did adding the hash code also fix the cargo list?
huginn wrote:
GoldenGnu wrote:So, the implementation, is correct in VSTrade? that would be nice... If it need changing, I would really love to have your help... As you read C, and I don't.
Yes it is, as far I checked. And, by the way, C/C++ is not really hard to read, if you know Java. The constructs are almost the same. My guess is, you'd do just fine. It's programming in it that can get more difficult than Java.
Well, it's good that it works correct...
I can understand c, most of the time... but, I can never read it... hehe...
huginn wrote:
GoldenGnu wrote:(I hope I'm J/K about the last part, hehe ;) )
;) Sure you are. Cannot be otherwise, as I'm in the stage of constantly losing more and more neurons. ;)
hehe... aren't we all... :lol:
huginn wrote:
GoldenGnu wrote:
huginn wrote:Upgrades are always sold at half. So, there is only a profit, if the current profit exceeds 100%. :)
So, they should be filtered out of the trade search, then? what do you think? I don't know if any of them, have 100% profit... or we could just divide by two on the sellBase, when checking if they give profit...
I'd keep the upgrades just for the fun of it with the adjusted sell price (min/2) and see what happens. :) In the end, it's a valid trade.
Sure, I'll try to hack it in, before next release...
huginn wrote:Btw, are ships in the cargo list as well? I never encountered them so far and cannot test right now.
Yes. I don't know if there is profit in moving them, thou. But, you can find where to buy them on the price tab. Do you know if there are special rules for selling them as well?
huginn wrote:
GoldenGnu wrote:Anyway, something should be done... :) Thanks for the info, it's very helpful... It's nice that you care t help me code VSTrade, it sure makes it a lot more fun...
Glad I can be of help. :)
Well, you sure are a great help... I really appreciate it....
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

Here are the merged source: VSTrade - Source 0.2.0.9a

I'm going to do:
-AutoConfig (Search some predefined paths to find the VS directory on startup)
-Fix the upgrade prices (and ships if needed)
Then I'm going to wait for your extra column and drinkypoo's icons
Then I'll release a new stable version (We might have a beta first, but I don't know if there is a point in it, as there are no beta-testers, hehe)
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:Now I'msh not sure if the changes I made to Node.equals should stay or did adding the hash code also fix the cargo list?
The Node.equals is just fine and should stay. The hash code is not so often used. Mainly in the hashed Collections Hashtable, HashMap, and HashSet. However, as a rule: If you override equals you should override hashCode as well, unless you exactly know what you are doing.
GoldenGnu wrote:Yes. I don't know if there is profit in moving them, thou. But, you can find where to buy them on the price tab. Do you know if there are special rules for selling them as well?
Well for the sake of experiment, I stuffed a Plowshare into my Plowshare and transported it somewhere else. Sold it for the exact same price. So, trading ships makes no profit. Only hijacking/disabling and selling them. :)
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

huginn wrote:The Node.equals is just fine and should stay. The hash code is not so often used. Mainly in the hashed Collections Hashtable, HashMap, and HashSet. However, as a rule: If you override equals you should override hashCode as well, unless you exactly know what you are doing.
Okay.... I didn't know that you should overwrite hashCode, as you said...
Thank for sharing the information. I did notice that NetBeans, complained about, it was missing, thou...
huginn wrote:Well for the sake of experiment, I stuffed a Plowshare into my Plowshare and transported it somewhere else. Sold it for the exact same price. So, trading ships makes no profit. Only hijacking/disabling and selling them. :)
Thanks... It's kinda fun and stupid that a Plowshare can fit in a Plowshare, but I guess it's all sci-fi, something with compressing the space used by objects in the cargo bay... and what not... hehe.

Anyway, I completed the Auto Config Feature...
I'll need some paths to search... don't know to do about that ATM. I might make a post, somewhere on the forum and ask people where they install vega strike.

Now it's on with the upgrades...

Here is a brief overview, of what I'm going to work on after we release the stable version:
Cargo Type ComboBoxes: Like the Base types ComboBoxes, just with the cargo root Categories (Like ships, upgrades, cargo)
Auto Complete: for the rest of the ComboBoxes (Like used in the System ComboBox, in the MapView)
Cargo Prices: More information on the cargo tab (like best buy base and best sell base)

EDIT:
It looks like, the hardest part with fixing the upgrades price, is to find out if the cargo is an upgrade or not... If I use getPath, It'll cripple the search, and take ages... hmm... The Data Structurer could really need an overhaul... ^_^

EDIT2:
It works now... I think, anyway.... Apparently the only upgrades there are profitable to trade with are all the Ammo Types...
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

Here are the latest source: VSTrade - Source 0.2.0.9b

I completed Auto Config and fixing the upgrade prices...
Found a bug with the new Node.equals code, so I modified the Node.getPath a little... now cargo of the same type is always equal, no matter what base they belong to...
Fixed some other minor bugs and made some minor modifications...
And started on some modifications of the map...
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

huginn wrote:What I'm thinking of is similar to the external cam. I can zoom in and out, and rotate around 2 axes. Should be possible ... but I don't know how easy or difficult.
loki1950 wrote:@huginn have a look at http://vegastrike.sourceforge.net/forum ... php?t=6774 it's C++ with Qt4 but it is full 3D
I had a brief look at the homepage and the source, and I really like, what it's doing. I cannot say, though, whether introducing OpenGL into vstrade is a good idea there. I could settle with a simpler method, as I use vstrade mainly for trading.

I had a brief look at http://en.wikipedia.org/wiki/3D_projection and realized that a orthographic projection would already be nice. I think I could come up with something at some time. Assuming a fixed camera really far far away from the galaxy with excellent zoom, the four steps necessary are:
  1. Turning the galaxy to view it from the right side.
  2. Projection along the z-axis.
  3. Zooming into.
  4. Translation and clipping to select the right area.
Should be doable. Or did I miss something?
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:Here are the latest source: VSTrade - Source 0.2.0.9b
Great, unfortunately, I don't have much time right now. So I probably will continue working on whatever version is current within next week.
GoldenGnu wrote:Found a bug with the new Node.equals code, so I modified the Node.getPath a little... now cargo of the same type is always equal, no matter what base they belong to...
Depends on what cargo actually is. If it only belongs to a category, has a basic mass, and required volume, then yes. If it also has a price or a number of units tagged to it, then no. But, in my opinion, the former approach is indeed the right one.
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

huginn wrote:Great, unfortunately, I don't have much time right now. So I probably will continue working on whatever version is current within next week.
OK, just tell me when you begin coding, so I can release the current source code. :)
huginn wrote:Depends on what cargo actually is. If it only belongs to a category, has a basic mass, and required volume, then yes. If it also has a price or a number of units tagged to it, then no. But, in my opinion, the former approach is indeed the right one.
Well I guess, they aren't really equal (in the sens that they are the same), but, it just work better for the program, to ignore what base the cargo (or category) is attached to, and the rest of its values...
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

In a post around last year or so
GoldenGnu wrote:It use two major tree structures.
Bases > Base > Category > Cargo
Galaxy > Sectors > Systems
Is this data structure still current? Or are there some new/different stuctures there?

These kind of info help me understanding the code even better.
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:OK, just tell me when you begin coding, so I can release the current source code. :)
I don't mind if you do right now. I'm flexible in merging my additions in future versions. I just don't have the time this week anymore.
GoldenGnu wrote:Well I guess, they aren't really equal (in the sens that they are the same), but, it just work better for the program, to ignore what base the cargo (or category) is attached to, and the rest of its values...
Equal is as programmer wants it to be. :)
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

huginn wrote:In a post around last year or so
GoldenGnu wrote:It use two major tree structures.
Bases > Base > Category > Cargo
Galaxy > Sectors > Systems
Is this data structure still current? Or are there some new/different stuctures there?

These kind of info help me understanding the code even better.
Yes, that is still the structure...

Galaxy > Sectors > Systems > Jumps (also GalaxySystem)

There can be more then one Category item, thou
ex.: Bases > Base > Category > Category > etc. > Cargo

There is a Category for each Sub category, bellow the base.

Bases, also hold the templateBase (plus some lists used by the ComboBoxes). The templateBase is read from the MasterParlList.csv (MasterPartListParser.java) and is used as a template for each base.
When the base are created from units.csv (UnitsParser.java), it use templateBase.deepClone() to create a new base. (Note: Node.deepClone() is overwritten in most classes) . If I remember right, Only the categories are modified when the bases are created, it sets the price deviation and price modification, for the categories.

All these data classes extends Node

Hope this helps a little... More questions are more then welcome! :)

A redesign of the Data structure, could IMHO, be a good idea, to simplify it... it's hard to get into and over complicated... I don't know what structure should be used instead, thou... I have been think about it for some time, without coming up with a good solution.
huginn wrote:I don't mind if you do right now. I'm flexible in merging my additions in future versions. I just don't have the time this week anymore.
Well, just complete your projects, when you have time. and we'll see about merging it... It wasn't really a problem last time... your code is simple and easy to merge...

huginn wrote:Equal is as programmer wants it to be. :)
OK, I thought, there might be more to it, as with the hashCode, thing :)
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

so, a new stable version arises, from the ashes... ;)

Download: VSTrade: 0.3.0.0 ~920KB (jar and source)

Change Log (since 0.2.0.0)
0.3.0.0
-Considerable better mods compatibility
-Map: Show path/connected systems in a sidebar
-Trade: Upgrade prices fixed (now sell for half)
-Now try to find the Vega Strike directory, when it's not set...
-Trade: Best Cargo search (by huginn)
-Better memory management
-Vegamap: now center on the middle of the map, on load. (Also for mods)
-Fixed many bugs and known issues

0.2.0.9
-The images on the cargo tab, are now resized to fit the image box
-The cargo ComboBoxes now work correct when using the arrow keys to navigate
-Price search now include all the possible results, by default
-Trade Table can be sorted, again

0.2.0.8
-Now show upgrade images as well (was ignored before in all version of VS)
-Now show the cargo images for VS 0.5.0 (loads DDS files)

0.2.0.7
-Better error handling for missing files
-Fix for "race" bug (Hopefully)

0.2.0.6
-Add To Sell Base Button was not disabled, when list was synced, fixed.
-Posible fix for "race condition" bug. (Please test this)
-Missing jumplines on map bug fixed.
-0.4.3 Compatibility restored
-Externalized the file paths (now have better mods compatibility)

0.2.0.5
-Merchant Ships are now included (Please test and comment)
-Moved to the javacsv library (Fixing a bug and decreasing load time)
-Added translation "Keys", shows the translation keys in the GUI
-Bug: Volume was always set to 1

0.2.0.4b
-Include vegamap key shortcuts in the readme file

0.2.0.4
-vegamap: Path names now got a black semi-transparent box behind them
-vegamap: Optimized

0.2.0.3
-Tooltips updated throughout the program (Thanks to drinkypoo)
-Vegamap: Zooming with the mouse now updates the zoom combobox value
-Vegamap: Moving and zooming improved (moving diagonally is now also possible)
-Vegamap: Zoom comboboxs input is now validated

0.2.0.2
-Vegamap: Highlight the selected systems jumps (when no path is set)
-Key control of vegamap (Keys hardcoded ATM)
-lager buttons on the vegamap toolbar
-Changes to price user interface (to follow the changes to trade)

0.2.0.1
-Changes to trade user interface
-New layout for vegamap

Known Issues:
-Danish translation is incomplete

ToDo:
-Map: Waypoints (Add and remove systems from the path)
-Cargo Types (Like the base types ComboBox)
-ComboBoxes Auto Complete
Last edited by GoldenGnu on Sat Jul 05, 2008 12:15 pm, edited 1 time in total.
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:The files to look at to add another column to the trade table, is:
...
Hope this helps....
Yes it did. Could easily integrate it. I'm not sure whether profit per cargo volume is a useful metric ... but if you have ships with limited cargo space only you want to make the best out of this space.

Sorry, that it came immediately after the 0.3.0.0 release. I think, merging can wait until you want to release another version on your own.

Three, no four things come to my mind right now. I'll have a look what I can do about them.
  • Make map view scrollable with mouse and with arrow keys.
  • Allow Galaxy to turn in the map view via orthogonal projection.
  • Show profitable trades only per category and not per cargo. (Profit is then difference of the averages, and not between min buy and max sell.) I do not know how this should be visualized, though. I think I saw this as a feature request already on this forum.
  • Let vstrade calculate the most profitable cargo mix given limited cargo space and limited amount of money.
The last one is ambitious and not obvious, so I just keep it on the list.

Regards.
You do not have the required permissions to view the files attached to this post.
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

huginn wrote:
GoldenGnu wrote:The files to look at to add another column to the trade table, is:
...
Hope this helps....
Yes it did. Could easily integrate it. I'm not sure whether profit per cargo volume is a useful metric ... but if you have ships with limited cargo space only you want to make the best out of this space.
I'm sure someone will find it useful...
huginn wrote:Sorry, that it came immediately after the 0.3.0.0 release. I think, merging can wait until you want to release another version on your own.
That's okay. I didn't make any modifications since 0.3.0.0, so the merge will be very easy... I'll start merging it now...
huginn wrote:Three, no four things come to my mind right now. I'll have a look what I can do about them.
  • Make map view scrollable with mouse and with arrow keys.
It's scrollable with the wasd keys (as noted in the readme file), you can't use the arrow keys, as they are used to move the focus between buttons, etc. (And I won't give up keyboard navigation, as it make the program somewhat more accessible)

A mouse edge scroll solution, is not really usable in a windowed program. But, a right mouse button down scroll solution, could be very nice :)

huginn wrote:[*]Allow Galaxy to turn in the map view via orthogonal projection.
I'm not sure what this is? if you care to take the time to explain, I would really appreciate it.

huginn wrote:[*]Show profitable trades only per category and not per cargo. (Profit is then difference of the averages, and not between min buy and max sell.) I do not know how this should be visualized, though. I think I saw this as a feature request already on this forum.
Yes, that has already been requested. The reason that it's not already implemented is that I couldn't do the user interface, that I would like.
I wanted it to show all the categories, and then have them expandable by click/double click, to show the cargo. Otherwise, It would just be the categories...

huginn wrote:[*]Let vstrade calculate the most profitable cargo mix given limited cargo space and limited amount of money.[/list]
The last one is ambitious and not obvious, so I just keep it on the list.
Actually, it was in the pre 0.2.0.0 versions (I redesigned the whole program, somewhere between 0.1.0.0 and 0.2.0.0). All you really need to know is, if you need to buy by profit per cargo or by percent per cargo... I'll do it again, if you like...
huginn wrote:Regards.
You want to take all that on your shoulders? I could properly do some of them, preferable the last two... I think, it'll best not to mess to much in each others aria of work, as we don't have any SVN, and it could get messy to merge, what do you think?

Once again, thank you for your contributions and your time. It's really the feedback and interest, that make keep coding... And you have provided plenty of both, thank you! :)

EDIT:
I was going to work a map feature: Waypoints, that would let you add and remove waypoints from the path... But, if you're going to do a lot of work on the map, you might take it on as well? Anyway, I'm properly just going the merge your changes in today, and then go enjoy the sun...
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:It's scrollable with the wasd keys (as noted in the readme file)
Oops, I must admit, I never read it.
GoldenGnu wrote:A mouse edge scroll solution, is not really usable in a windowed program. But, a right mouse button down scroll solution, could be very nice :)
I don't know what a mouse edge scroll solution is. I had the latter in mind, only with the left mouse button, as this is more intuitive. (Acrobat Reader uses it too for moving a zoomed page.)
GoldenGnu wrote:
huginn wrote:[*]Allow Galaxy to turn in the map view via orthogonal projection.
I'm not sure what this is? if you care to take the time to explain, I would really appreciate it.
In short, make galaxy turnable and allow it to view it from all sides (even while zoomed in). Is related to one of my last posts. But not in a perspective projection but a simpler orthographic projection.
GoldenGnu wrote:Otherwise, It would just be the categories...
As an intermediate step that would already be enough.
GoldenGnu wrote:
huginn wrote:[*]Let vstrade calculate the most profitable cargo mix given limited cargo space and limited amount of money.[/list]
The last one is ambitious and not obvious, so I just keep it on the list.
Actually, it was in the pre 0.2.0.0 versions (I redesigned the whole program, somewhere between 0.1.0.0 and 0.2.0.0). All you really need to know is, if you need to buy by profit per cargo or by percent per cargo... I'll do it again, if you like...
Does percent per cargo really make sense? You use profit per cargo with unlimited money but limited cargo space. You use profit in percent (called yield I think) with unlimited cargo space and limited money.

I can get both by just sorting the table along the respective columns. So for these two purposes I don't think it is necessary to include again.

If both are limited, well my intuition right now is, that it is not so easy to find the best cargo mix. How did you solve it?
GoldenGnu wrote:You want to take all that on your shoulders? I could properly do some of them, preferable the last two... I think, it'll best not to mess to much in each others aria of work, as we don't have any SVN, and it could get messy to merge, what do you think?
I'm finishing the category view. The best cargo mix I won't touch right now. Then I'd thought about the map. Regarding the map, I don't see much interference right now. I'd mainly fiddle with getMapPoint and getViewPoint + some additional attributes + additional key bindings for turning left right up down and reset.
GoldenGnu wrote:I was going to work a map feature: Waypoints, that would let you add and remove waypoints from the path... But, if you're going to do a lot of work on the map, you might take it on as well?
As already mentioned, it won't be a lot of the map, and it probably won't interfere with each other. I can merge my map work into yours for a change.
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

OK, I got parts of the Category Table implemented. But now I'm stuck in my struggle with Swing and its model-view-controller architecture.

Up to now I followed the course of least resistance, in order to get a proof of concept. I added a new Category column. This can be displayed in the normal table view as well. Depending on the view I wanted to set the displayed columns to the one given in the settings or to a currently statically hardcoded vector (BuyBase, SellBase, Category, AvgProfit). I saw that in the TradeSettings you can set the columns.

However, somehow Swing does not take setting the table columns to a new list lightly, even if it is a clone of the old one. Furthermore I still do not understand, how the TablePanel actually gets notified that a change happened in the underlying column model.

I thought looking at the SettingsView.save code helps. There I can change the displayed columns and save applies the changes. But save only sets the TradeSettings as I do. The notification to the Swing table is not there either. Does this occur in Program.save? Or where does it occur?

I'd appreciate any help right now ... :)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

A good night sleep really helps. Figured out, I thought too complicated. I just reuse the current table. Useless columns are filled with 0 and "".

So, here is my current version with a switch between cargo and category view. The functionality is all there. The UI ... well it's not yet eye appealing ... I wanted to have the radio buttons next to the Switches panel, i.e. reducing the Switching panel length by half. Didn't manage, though ... therefore this other position. I don't mind, where you locate the button eventually, but I leave this to you. ;)

Perhaps needs some more testing, I just simulated the Cephid 17 run.

Attached the diff to my previous version (the "Profit per Cargo" version) and the zip of the source for better copy/paste. You sure, you want to do it by hand? Perhaps patch works for you, too. :)

Further changes:
  • Added some get...Name methods
  • Introduced getSellPrice... methods to Cargo and Category (let the cargo decide on its own, whether it is an upgrade or not!)
  • Removed all your bUpgrade additions, as after a while they drove me crazy ... :) I hope, you agree and also that I didn't introduce some regression
Have a nice day, I'm finished for now. :)
You do not have the required permissions to view the files attached to this post.
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

huginn wrote:
GoldenGnu wrote:It's scrollable with the wasd keys (as noted in the readme file)
Oops, I must admit, I never read it.
I guess most don't... hehe....
huginn wrote:
GoldenGnu wrote:A mouse edge scroll solution, is not really usable in a windowed program. But, a right mouse button down scroll solution, could be very nice :)
I don't know what a mouse edge scroll solution is.
It scrolls the map, when the courser is near the edge of the map...

huginn wrote:I had the latter in mind, only with the left mouse button, as this is more intuitive. (Acrobat Reader uses it too for moving a zoomed page.)
The right mouse button is used to select systems, but I guess mouse drag can be used to move the map with....
huginn wrote:In short, make galaxy turnable and allow it to view it from all sides (even while zoomed in). Is related to one of my last posts. But not in a perspective projection but a simpler orthographic projection.
I guess, I understand now, It endable you to turn the galaxy, that's smart...
huginn wrote:
GoldenGnu wrote:Otherwise, It would just be the categories...
As an intermediate step that would already be enough.
I read your other post, look like we are already there... :)
huginn wrote:Does percent per cargo really make sense? You use profit per cargo with unlimited money but limited cargo space. You use profit in percent (called yield I think) with unlimited cargo space and limited money.
Well as you say, it's when you have less money and enough cargo, then buying by percent make sense...
huginn wrote:I can get both by just sorting the table along the respective columns. So for these two purposes I don't think it is necessary to include again.
yes but, you wouldn't know what one to buy from, if you don't calculate it yourself... I would just make it so that, it would tell you to buy by profit or by percent... then you could sort the columns and just buy the best first and so on...
huginn wrote:If both are limited, well my intuition right now is, that it is not so easy to find the best cargo mix. How did you solve it?
I just counted the profit by both... and printed the largest one...
huginn wrote:I'm finishing the category view. The best cargo mix I won't touch right now. Then I'd thought about the map. Regarding the map, I don't see much interference right now. I'd mainly fiddle with getMapPoint and getViewPoint + some additional attributes + additional key bindings for turning left right up down and reset.
okay, I'll keep coding my part, then :)
huginn wrote:
GoldenGnu wrote:I was going to work a map feature: Waypoints, that would let you add and remove waypoints from the path... But, if you're going to do a lot of work on the map, you might take it on as well?
As already mentioned, it won't be a lot of the map, and it probably won't interfere with each other. I can merge my map work into yours for a change.
yerh, that's great... :)

POST2:
huginn wrote:OK, I got parts of the Category Table implemented. But now I'm stuck in my struggle with Swing and its model-view-controller architecture.
Yerh, swing is fun, but most of the table work is done with glazed list...
huginn wrote:Up to now I followed the course of least resistance, in order to get a proof of concept. I added a new Category column. This can be displayed in the normal table view as well. Depending on the view I wanted to set the displayed columns to the one given in the settings or to a currently statically hardcoded vector (BuyBase, SellBase, Category, AvgProfit). I saw that in the TradeSettings you can set the columns.
Yes you can, but more is need...
huginn wrote:However, somehow Swing does not take setting the table columns to a new list lightly, even if it is a clone of the old one. Furthermore I still do not understand, how the TablePanel actually gets notified that a change happened in the underlying column model.
When the tables are change, you should do:
tradeTableModel.fireTableStructureChanged();
huginn wrote:I thought looking at the SettingsView.save code helps. There I can change the displayed columns and save applies the changes. But save only sets the TradeSettings as I do. The notification to the Swing table is not there either. Does this occur in Program.save? Or where does it occur?
The code above is call from TradeView.updateLanguage() (last line)
huginn wrote:I'd appreciate any help right now ... :)
Sorry that I wasn't around, when I was needed...

POST3:
huginn wrote:A good night sleep really helps. Figured out, I thought too complicated. I just reuse the current table. Useless columns are filled with 0 and "".
Yes, sleep and even brakes, really helps when you're stuck....
huginn wrote:So, here is my current version with a switch between cargo and category view. The functionality is all there. The UI ... well it's not yet eye appealing ... I wanted to have the radio buttons next to the Switches panel, i.e. reducing the Switching panel length by half. Didn't manage, though ... therefore this other position. I don't mind, where you locate the button eventually, but I leave this to you. ;)
Sure, I'll fix up the UI, as last time... I like that you do all the hard stuff yourself, and let me do the easy part :D
huginn wrote:Perhaps needs some more testing, I just simulated the Cephid 17 run.
Well if it's broke, some should report it, hehe...
huginn wrote:Attached the diff to my previous version (the "Profit per Cargo" version) and the zip of the source for better copy/paste. You sure, you want to do it by hand? Perhaps patch works for you, too. :)
I'll check it out, but, I kinda like doing it by hand now... It lets me look and somewhat understand the code, while I add it... I think it's good and I'll know where the changes are made etc.
huginn wrote: Further changes:
  • Added some get...Name methods
  • Introduced getSellPrice... methods to Cargo and Category (let the cargo decide on its own, whether it is an upgrade or not!)
  • Removed all your bUpgrade additions, as after a while they drove me crazy ... :) I hope, you agree and also that I didn't introduce some regression
That's cool, It was the best solution, I could come up with, It's good that you found a better one... I really like your improvements so far (havn't looked at the latest code, yet), and I'm sure it's all good, as it have been so far... :)

huginn wrote:Have a nice day, I'm finished for now. :)
I'll start merging the code, and doing the UI changes, if needed... :)
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
GoldenGnu
Bounty Hunter
Bounty Hunter
Posts: 155
Joined: Fri Jan 27, 2006 6:58 pm
Location: Denmark

Post by GoldenGnu »

OK so, I merged it and it works! :D

Thank you for this patch, it's really cool :) I especially love the changes you made to the isUpgrade() :)

The UI, is a little ruff, as you said, but I'll fix that... :)

I'll make the Trade Category Search Columns, editable on the settings tab, as with the Trade Cargo Search Columns.

And try to make a somewhat better UI.

What do you think about making the UI 3 columns, instead of 2? Would give some extra space to work with. But, at the cost, that you can't really make the window narrower...

I properly won't have time to work on VSTrade today and tomorrow, but, then I'll start working on it again...
Image
VSTrade - A Merchants Guide to Intergalactic Trading!
0.3.0.0 Stable (3 july 2008)
huginn
Merchant
Merchant
Posts: 58
Joined: Sun Jun 15, 2008 9:58 pm
Location: Germany

Post by huginn »

GoldenGnu wrote:OK so, I merged it and it works! :D
Great!
GoldenGnu wrote:What do you think about making the UI 3 columns, instead of 2? Would give some extra space to work with. But, at the cost, that you can't really make the window narrower...
Hmm, I'm not a UI expert. It would be nice having more rows for the table. 3 columns would be one option to achieve this. The other the one I mentioned (halving Switches and take the other half for Views). I use vstrade fullscreen anyway. So I cannot say. But if you really want my vote, I'd keep the 2 columns.

Other users should state their opinion, too.
Post Reply