Page 6 of 9

Posted: Thu Nov 22, 2007 3:41 pm
by loki1950
Depends on how fast you need those lookups the code scans an array in memory not the file itself so there is only one load and read of the file and the need for the EOF markers.

Enjoy the Choice :)

Posted: Thu Nov 22, 2007 3:48 pm
by drinkypoo
loki1950 wrote:Depends on how fast you need those lookups the code scans an array in memory not the file itself so there is only one load and read of the file and the need for the EOF markers.

Enjoy the Choice :)
In that case, doesn't it make more sense to just add the markers onto the end of the data in memory instead of having them in the file?

I never imagined that the data would be read from the file every time, even if the file stayed perpetually cached the overhead would be enormous.

But I am getting DUMMYSENTINELS cargo so obviously the marker-in-the-CSV-file strategy is not all that good... Or at lest not well-implemented.

Posted: Thu Nov 22, 2007 5:04 pm
by loki1950
But I am getting DUMMYSENTINELS cargo so obviously the marker-in-the-CSV-file strategy is not all that good... Or at lest not well-implemented.
then that's a bug and more than likely data side in one of the python functions

Enjoy the Choice :)

Posted: Thu Nov 22, 2007 7:03 pm
by drinkypoo
loki1950 wrote:
But I am getting DUMMYSENTINELS cargo so obviously the marker-in-the-CSV-file strategy is not all that good... Or at lest not well-implemented.
then that's a bug and more than likely data side in one of the python functions

Enjoy the Choice :)
nice, maybe I have some hope of finding it then. Do you think it is likely as simple as that the relevant records are not filtered when they are selected? :)

Posted: Thu Nov 29, 2007 12:53 pm
by GoldenGnu
Here is the next alpha, that fix some bugs and include merchant ships (ship were cargo can't be bought is still not included)

Download: VSTrade: 0.2.0.5 ~900KB (jar and source)

Here is the change log, since 0.2.0.4b:

New Features:
-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

Known Issues:
-Splash screen can't be translated (Won't fix)
-Danish translation is incomplete
-Vegamap: System combobox key presses activates vegamap key controls

ToDo:
-Control keys editor
-Cargo: max price, min price, best buy base, best sell base
-Mods Compatibility

Posted: Mon Jun 09, 2008 9:59 pm
by negative0017
Hi... I Seem to be missing something... when i choose the path to vegastrike in the settings i get it in there. then i quit the application and load it back up.. it gets to the end of the loading bar with external modules(i think) and then it just closes. the main window frame doesnt even come up... is there a fix for this or what? i have the latest Java, Windows XP and VS 0.5.0

Posted: Tue Jun 10, 2008 6:53 am
by ace123
Any chance you could find the "Java Console" program that should have come with your java installation, and post the error logs?

Also, if it worked the first time around, you might be able to delete the home folder the program created so it can start up clean.

The source code looks for configuration files in System.getProperty("user.dir")+java.io.File.separator+"vstrade_settings.xml";
I'm not exactly what java thinks the "user.dir" is, but it's one of Java's things that isn't clearly defined.
"On some systems you can read a system property called 'user.dir' to get the path that the application was started in. This property is system dependent as to what it means or whether it exists at all."
I don't think it could have been hard for java to make that a standardized function that calls "getcwd", or at least document what it is.

Anyway, enough Java bashing--the vstrade_settings.xml should be inside of the folder you ran the application from, or inside the data folder, or inside of C:\Documents and Settings\username

Posted: Fri Jun 13, 2008 10:49 pm
by Mets
The app looks really cool, but I can't seem to get it to load my game data.

I downloaded the latest from SVN to C:\Games\VegaStrike. In that folder I have the win32 directory and this application. In win32 I have a data directory and a bin directory. Vegastrike.exe lives in the bin directory.

I've tried every combination of the above paths, and it doesn't load a thing. What am I doing wrong?

Also, sometimes it starts to load and then just stops and closes. Not sure if that has something to do with it.

Posted: Sat Jun 14, 2008 2:06 am
by drinkypoo
Here's the command line I used to use to start the program:

java -jar /opt/vegamap-0.1.1/vegamap.jar -f /usr/share/games/vegastrike/universe/milky_way.xml

I assume I had the data installed/symlinked to there.

I just downloaded 0.2.0.5 and ran it and was able to specify my data dir as the vstrade dir though.

Try setting the path to "C:\Games\VegaStrike\Win32\data", or whatever your data dir is called. If you can't launch the program, your Java is most likely FUBAR. Personally, I'm having problems with the jump lines being drawn on the vegamap. I'm getting this output in the console:

:: java.awt.AlphaComposite@b0800003

Everything else seems to work great in 0.2.0.5, except for cargo pictures (as if I cared.) Honestly, vegamap is SUPER SLOW in the java compared to the original version... I was testing for GoldenGnu before but as you can see I disappeared (real life reared its ugly head.) I'm playing the game again now, though.

Posted: Sat Jun 14, 2008 2:21 am
by Mets
Ok, the program launches fine unless you specified the wrong path in settings. In that case, it has some array index out of bound exception that gets thrown, so it fails.

When I specify the milky way file, it says the following:

Code: Select all

(Info) Starting VSTrade 0.2.0.0
(Info) Using default settings (vstrade_settings.xml - NOT FOUND)
(Info) Readme loaded (readme.txt)
(Info) Moduls loaded (GUI)
(Warning) No cargo loaded (master_part_list.csv - NOT FOUND)
(Warning) No bases loaded (units.csv - NOT FOUND)
(Warning) No galaxy loaded (milky_way.xml - NOT FOUND)
Exception in thread "Thread-3" java.lang.IllegalArgumentException: setSelectedIn
dex: 0 out of bounds
        at javax.swing.JComboBox.setSelectedIndex(Unknown Source)
        at vstrade.moduls.map.MapView.enabled(MapView.java:233)
        at vstrade.moduls.map.MapView.setData(MapView.java:213)
        at vstrade.Program.settingsUpdated(Program.java:170)
        at vstrade.io.DataCreater.run(DataCreater.java:57)

Posted: Sat Jun 14, 2008 6:45 am
by drinkypoo
Could you try version 0.2.0.5? It works for me. I haven't tried 0.2.0.0 with svn (and am unlikely to... I'm on a modem) :(

Posted: Sun Jun 15, 2008 10:46 pm
by huginn
Had a similar problem on the linux console, here the program output:

Code: Select all

(Info) Starting VSTrade 0.2.0.5
(Warning) No mods loaded (mods.xml - NOT FOUND)
(Info) Using default settings (vstrade_settings.xml - NOT FOUND)
(Info) Readme loaded (readme.txt)
(Info) Moduls loaded (GUI)
(Warning) Empty rows - no problem (master_part_list.csv)
(Info) Cargo loaded (master_part_list.csv)
(Warning) Empty rows - no problem (units.csv)
(Info) Bases loaded (units.csv)
(Info) Galaxy loaded (milky_way.xml)
Exception in thread "Thread-1" java.lang.IllegalArgumentException: setSelectedIndex: 0 out of bounds
        at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:603)
        at vstrade.moduls.map.MapView.enabled(MapView.java:291)
        at vstrade.moduls.map.MapView.setData(MapView.java:277)
        at vstrade.Program.settingsUpdated(Program.java:163)
        at vstrade.io.DataCreater.run(DataCreater.java:57)
After compiling the current source myself in Eclipse and running it there without problem, I suspected a race condition. It is. Loading the data model and the GUI are two threads, and sometimes on my old computer the GUI is displayed earlier with a still empty combo box in the map view.

Changing line 157 in vstrade/Program.java from

Code: Select all

dataCreater.start();
to

Code: Select all

dataCreater.run();
solved the problem for me, at least as a temporary workaround. The data model loader is not started as an individual thread anymore

Posted: Sun Jun 15, 2008 11:00 pm
by loki1950
Welcome huginn(Andreas) hope the registration process worked properly This little patch should make for a few happy traders :D

Enjoy the Choice :)

Posted: Mon Jun 16, 2008 8:36 pm
by huginn
I went through the tool and realized that it does not draw jump lines as the internal data structure does not hold the jump connections.

There is already code in vstrade.data.galaxy.GalaxySystem commented (get/has/addJump(s)). I'm not sure whether this is old deprecated code or new to be. The jumps could be in an own data structure (List<GalaxySystem> jumps, as almost present in the commented code), or they just could be (kind of virtual) Node-children of the current System. The latter would fit into the path syntax.

I'd add it the one way or the other but do not know whether there is a preferred way.

Posted: Tue Jun 17, 2008 7:55 am
by drinkypoo
you might look at older versions, I believe it used to draw the lines? I could be wrong though.

Posted: Wed Jun 18, 2008 1:23 pm
by GoldenGnu
Just a short message...

I'm still alive, and I'll look at all the problems soon (I just got back from a small trip). Please, bear with me...

I'll add a reply here, as soon as I have read and found/fixed the new bugs...

I truly thought there was no interest in VSTrade anymore... But, I'll be happy to take up the coding again...

Posted: Wed Jun 18, 2008 3:49 pm
by drinkypoo
Welcome back! And not just because we want bugs fixed :D

Posted: Fri Jun 20, 2008 12:08 pm
by GoldenGnu
A little update:

Lines/jumps are not drawn on the map bug:
Found and fixed.

Race condition bug:
I could not reproduce the bug, I'll try to find a slow machine to test it...
Logical, It should work AFAIK, please correct me if I'm wrong.
It's however possible to make a workaround, that still lets the loading happen in its own thread.

Wrong paths bug:
I have started coding a new way for VSTrade to find the files in the Vega Strike directory.
Hopefully it will fix the bugs with bad paths etc.
It'll externalize the paths, so people will be able to edit the searched paths, if Vega Strike change Its file structure...

The cargo images are not shown bug:
It's a known issue, it's because the images are now in DDS format, I did work on a DDS library before I stopped coding on VSTrade... I might take it up again...


That's all for now, I'll try to release something soon, so people can use the program again.


@drinkypoo

Thanks mate! :)

Posted: Fri Jun 20, 2008 1:03 pm
by GoldenGnu
a little update...

Race condition bug:
I would be happy if anyone who gets this bug, care to try this workaround:
(Should be used on the 0.2.0.5 source)

replacing:

Code: Select all

jSystemList.setSelectedIndex(0);
with:

Code: Select all

if (jSystemList.getItemCount() > 0) jSystemList.setSelectedIndex(0);
in: vstrade\moduls\map\MapView.java @ line: 291

That said, it's only a workaround. And I still haven't found the course of the bug... What I really need is steps to continual reproducing the bug...


Yet another update
Compatibility with Vega Strike 0.4.3 is broken in VSTrade 0.2.0.5, This is now fixed...

Posted: Sat Jun 21, 2008 10:21 pm
by huginn
Thank you.

I tried your proposed workaround. It works.

The first ComboBox on the MapView-Module (Vegamap-Tab) sometimes shows nothing (empty field) and sometimes "Aanpzezyqqh", depending on which thread (GUI or Loader) finishes first on startup. The drop-down list contains all systems.

Which line do I have to modify so that GalaxySystem contains the jumps as child nodes again?

Posted: Sat Jun 21, 2008 11:05 pm
by huginn
huginn wrote:Which line do I have to modify so that GalaxySystem contains the jumps as child nodes again?
Found it. In vstrade/data/galaxy/GalaxySystem.java had to add in add(Node)

Code: Select all

values.add(n);
at its end (below line 54).

Posted: Sun Jun 22, 2008 1:54 pm
by GoldenGnu
I think I fixed the bugs for now...

However I'm almost sure that the Bases & Galaxy classes are not released properly when the Vega Strike path is changed and saved. So, that's one major memory leak... I never fixed any memory leaks, before, but I'll try my best to fix it ASAP. However, It'll not be in the next release...

I also want to thanks all the bug reporters. I'm happy to see that there is still interest in VSTrade, and that people care to take the time to report bugs. Thank you! :)

@huginn

You sure seems to know your way around Java. 8)

Could you please tell me how it's a race condition. The Program.load() function is not call before all the GUI is done loading. (Which you can also see from the log output)

I did fix the race condition when saving, thou...
It was possible that Program.load() got called, before DataSaver.start() finished.

I'll release my fixes very soon...

Posted: Sun Jun 22, 2008 2:35 pm
by GoldenGnu
This is a alpha release by name and quality, however, it might be the only working version... :oops:

Download: VSTrade: 0.2.0.6 ~900KB (jar and source)

Here is the change log, since 0.2.0.5:

New Features:
-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)

Known Issues:
-Splash screen can't be translated (Won't fix)
-Danish translation is incomplete
-Vegamap: System combobox key presses activates vegamap key controls
-Cargo images are not shown

ToDo:
-More mods compatibility
-Try to fix memory leaks
-test "race condition" fix

Posted: Sun Jun 22, 2008 3:31 pm
by GoldenGnu
@huginn

The workaround, I wrote before, is not in the latest version.

However if you still get the "race condition" bug, with the latest version.
Could you please try to change:

Code: Select all

load();
...on line 143 of Program.java

to

Code: Select all

DataCreater dataCreater = new DataCreater(this);
dataCreater.run();
If that fix the problem, it is indeed a race condition AFAIK.
Then I'll add it permanent in the program and release a new version, pronto...

The reason it load in a thread is that, otherwise it would lock the GUI when saving the settings. It's not important when it loads first time...

Posted: Sun Jun 22, 2008 5:52 pm
by huginn
GoldenGnu wrote:Could you please tell me how it's a race condition. The Program.load() function is not call before all the GUI is done loading. (Which you can also see from the log output)
I have no thorough explanation, as I do not have experience with Swing. You are right, the DataModel is loaded last. But, my guess is, that loading the GUI is not a sequential task and that Swing spawns GUI creation/preparation threads on its own, which run in parallel to the main thread. So, the main thread starts loading the DataModel while GUI prepartion is not finished.

Somehow, the window is only created, when the main thread finishes ... as I said, I don't know what's happening under the hood, but I heard that Swing relies on threads.
GoldenGnu wrote:However if you still get the "race condition" bug, with the latest version.
Could you please try to change:
I run the program in a vanilla data directory ($PWD in the following outputs) with only master_part_list.csv, units/units.csv, and universe/milky_way.xml from svn. No vstrade settings. I got the following error first:

Code: Select all

(Info) Starting VSTrade 0.2.0.6
(Warning) No paths loaded (NOT FOUND: "$PWD/files.xml")
(Info) Using default settings (NOT FOUND: "$PWD/vstrade_settings.xml")
(Info) Readme loaded
(Info) GUI loaded
Exception in thread "DataCreater" java.lang.NullPointerException
        at vstrade.data.files.Paths.getPath(Paths.java:82)
        at vstrade.data.settings.Settings.getMasterPartListPath(Settings.java:172)
        at vstrade.data.bases.Bases.<init>(Bases.java:68)
        at vstrade.io.DataCreater.run(DataCreater.java:44)
sKey is "masterpartlist", sVegaStrikePath is "", this.keys does not contain any elements.

After replacing line 82 with (I wanted to see what happens after)

Code: Select all

for (int i = 0; paths != null && i < paths.size() && !file.exists(); i++){
I encountered the race condition bug again. After trying your suggested change (rf. first quote of this post), the bug disappeared, but vstrade does not find the files and cannot initialize:

Code: Select all

(Info) Starting VSTrade 0.2.0.6
(Warning) No paths loaded (NOT FOUND: "$PWD/files.xml")
(Info) Using default settings (NOT FOUND: "$PWD/vstrade_settings.xml")
(Info) Readme loaded
(Info) GUI loaded
(Warning) No cargo loaded (NOT FOUND: "")
(Warning) No bases loaded (NOT FOUND: "")
(Warning) No galaxy loaded (NOT FOUND: "")
(Info) VSTrade closing
Hope that helps. I could not go further, as I did not explore the loading procedures so far.

Regards.