Freelancer Path Generator
-
edit the final version, no longer beta, is at the bottom of this post - as is the source code.
First up - HUGE thanks to all that have given feedback, highlighted bugs and more. It’s much appreciated, I failed to catch the bugs mentioned so those contributions were vital! slaps self for poor testing
Secondly, apologies for the time taken to make the update and correct the bugs. Been busy, luckily grabbed a spare hour on Saturday night to sort it out.
fixes
Used a set collection in the program, which gave different paths each time. Changed to a List, now you get same paths every time.Parses locked gates correctly now, so will not generate paths for locked gate objects.
Description
This program will generate the shortest path files for your modTo use this you will require the Java Runtime Environment - if you haven’t already got it installed, it’s 100% free and available from here JRE 6 update 6
This application requires your mod directory (or your freelancer directory, activate the mod first) and it will then read your universe.ini and initialworld.ini file (if it exists!), for the systems and locked gates respectively. It will also read your solararch.ini file to find legal and illegal jump object types for when it’s parsing your system files, to work out what the jump types are.
It will then read all those systems it finds in universe.ini file, using the given links, and finally - it will back up the existing path files before constructing new ones.
It uses a breadth first search algorithm, which is very simple. Once you’ve run it once, it won’t overwrite the files again (if you’ve run it when the mod is activated, best off copying those files after they’re made!).
Limitations:
If any files except the universe and solararch are missing - it will continue to generate the paths. Obviously these paths won’t be correct, you will receive a warning at the end of the scan. Advisable to address the issue by supplying the files if possible (usually best to run on the your Freelancer directory after installing the SDK - and then activate your mod).
If any files are encrypted, it will give a warning (unless it’s the universe/solararch, at which point it exits) - since it cannot read encrypted files, it will again generate bad paths (advise as above to solve).
Please give any feedback you find, including what improvements can be made, as well as how good/bad you’ve found it. It’s advisable NOT to use this and include it’s files within a mod release, as it hasn’t been fully tested (even on normal freelancer) at this point.
If you find ANY bugs at all, please let me know what you were scanning (mod) and what the bug was, so that I can try to track it down and fix it.
Any feedback is welcome, although if anyone downloads it within a month I’ll be amazed
Freelancer Path Generator.zip (download, extract, and then double click to run).
Source code (Java)
Freelancer Path Generator Source Code (Contains the packages, which are directories, with the classes inside. You may create a java project in your IDE of choice and just drop the contents of SRC into the location where your IDE puts source code and it should work. You may need JDK 5 for the source format if you see errors, or try 6 instead!). -
Terrific Chips, very many thanks.
I will run it as soon as I get an hour and will let you know the results.
Much appreciated.
-
Well done, Chips!
I ran it on exactly the same files that I got the No Best Path before on the second run (with my St03b system decrypted) and was able to get good paths with no glitches, no hangs, no freezes. I tested it there and back between the same systems that I had the first good run (when St03b was encrypted) and all is well.
I get No Best Path between systems where there are no jumpgate connections (i.e. only jumpholes) and this is of course normal as the original game does this too.
I will post if I have any problems but I don’t foresee any.
So - Bloody Well Done, Pal!!
Very many thanks for all your work, it’s VERY much appreciated.
-
I hate to say it but you aren’t going to get much feedback when it works right
-
@Lancer:
I hate to say it but you aren’t going to get much feedback when it works right
Bargin, means less to do
The main reason to do this was simply boredom, and a bit of a programming challenge (although not that challenging - made challenging due to being slack at times with forethought).
The fact that it may prove useful to folks is an added bonus - hence why it gets releasd
-
Between moving house I got the chance to try this last night. Seems to work fine although I will need to get it into the beta test cycle to be sure. I noticed that it changed two things right away. The shortest_illegal_path went from 599kb to 4kb. No error checker turned up a problem. It fixed setting a distant galaxy far, far away ( :P) and having it lead me to the center of the current system, I had that problem in one system before.
So, nice work! You need to get bored and do this stuff more often! ;D
-
Chips,
If you feel up to it, may I request an .ini file editor like Tiny Fish’s 1.4 for your next 24-hour project?
For me it is the best ini editor available.
It has a tabbed “cellular” view like an excel spreadsheet that I love, I can copy & paste values vertically, and it is superb for comparing / checking / duplicating values for the same parameter for all sections. And it can switch to normal text editor view too.
It has many excellent features that should be kept.
But it also has some bugs which make it 90% instead of 100% :-
1. Opening a file smaller than the current one causes an error because the line pointer is not set to 1, it is kept at the current line number of the previous file - this causes the new file’s name not to be updated in the editor, and if the user then saves the new file it overwrites the previous file!
2. deleting the last line of the file gives an error because the line pointer is not updated.
3. editing data in the tabbed view and then switching to text does not reflect the changes there, so it messes the file up. (There is a menu option to update the changed data the other way, so changing from text to cellular view is OK but only when the user remembers to use the option. Making it automatic both ways would be best).
4. deleting one or more lines between other lines in the text view shifts the next line to the end of the previous one, instead of keeping in the line-feed/carriage return
5. when it can’t overwrite the old file it doesn’t tell you so but pretends it has done - so changes are lost.
6. when inadvertently adding data past the last line in tabbed view produces an error message that is not understandable
There may be more.
Wishful thinking that you might take this one on!
But it would be superb.
-
@ ST, try note tab light, it’s what I use instead of notepad.
-
Nothing else has Tinyfish’s cellular view. Try it and you will see what I mean, it saves tons of time.
-
Sorry to disappoint you, but locked holes are still not parsed correctly.
The path I mentioned in my last bug report is still bugged:
vanilla (SDK 1.5) path
Path = Br04, Rh05, Br04, Br01, Br03, Bw02, Bw04, Rh05path from this tool
Path = br04, rh05, br04, br03, bw02, bw04, rh05All in shortest illegal paths, br04_to_br03_hole is locked by FL default.
-
ive tested it yesterday the first time
correct me if im wrong but when i choose a different system on the nav map and create path to that system it really should create that patch from my current system to the next gate to the next system… … …
ive tried to let it calculate paths between systems with the only result that 1 single waypoint is on the map but no path to this waypoint
that happens even if the destination is just 1 system away -
Sorry to disappoint you, but locked holes are still not parsed correctly.
The path I mentioned in my last bug report is still bugged:
vanilla (SDK 1.5) path
Path = Br04, Rh05, Br04, Br01, Br03, Bw02, Bw04, Rh05path from this tool
Path = br04, rh05, br04, br03, bw02, bw04, rh05All in shortest illegal paths, br04_to_br03_hole is locked by FL default.
Cheers, will revisit - I checked that (I thought) ::)
Will sneak a peek when i get back in a few hours time.Correct me if im wrong but when i choose a different system on the nav map and create path to that system it really should create that patch from my current system to the next gate to the next system… … …
ive tried to let it calculate paths between systems with the only result that 1 single waypoint is on the map but no path to this waypoint
that happens even if the destination is just 1 system awayNot quite sure I follow you there Op. Do you mean you’re manually going to the next system via nav map, plonking down an “add waypoint” and it’s basically not plotting it? or is it doing it wrong somehow? Or does it put down the waypoint but no other waypoints? Or it plots multiple waypoints but no connection / continuation with them?
-
I can only assume I somehow compiled a wrong version
Path = br04, rh05, br04, br01, br03, bw02, bw04, rh05
That’s the shortest illegal path generated. The bug causing it was one I’ve already solved, that being that the numbers were truncated and therefore using them as a key when read in caused problems.
No idea how that occurred, it was one of the issues last time and was sure I fixed it :-[
-
Not quite sure I follow you there Op. Do you mean you’re manually going to the next system via nav map, plonking down an “add waypoint” and it’s basically not plotting it? or is it doing it wrong somehow? Or does it put down the waypoint but no other waypoints? Or it plots multiple waypoints but no connection / continuation with them?
just a single waypoint (in the other system)
but no path leading to that waypoint -
Okay thanks - will try that out when i’ve got a few mins tomorrow night as tonight is pretty much done at the moment (home late + work at home too).
Til then, the latest quick fix is here:
Freelancer Path Generator.zip
which finally should address the locked gates issue. Having said that, haven’t had time to check all the locked gates are done right at this precise second, will check that tomorrow.(ver 0.99a)
-
Not quite sure I follow you there Op. Do you mean you’re manually going to the next system via nav map, plonking down an “add waypoint” and it’s basically not plotting it? or is it doing it wrong somehow? Or does it put down the waypoint but no other waypoints? Or it plots multiple waypoints but no connection / continuation with them?
just a single waypoint (in the other system)
but no path leading to that waypointAny chance you could say which system this was between please?
Plotting paths just fine and dandy between systems for me (1 hop included) so I’m unable to re-create this issue.
To solve it I need to re-create it to work out what is wrong. Right now there’s no details which are helping me,so anything related to it (starting/ending systems, mod etc) would be beneficial at this point.Cheers.
-
As I said earlier my trial worked fine, plotted paths to next system & back and also from a previously unvisited system far away back to where I was prior (moved my character using Ioncross Server Op & plotted my way back to charted systems) without problems.
So it’s unlikely that it would work in this simple one-system hop for one person and not another.
Could it be you have the first version Op?