Freelancer Path Generator
-
its written in java i guess - i have learned it somewhen in the past so at least i can read it^^
have you ever thought to add some debug output strings to your version - would make it better for people to tell you what happens…
And even you could have a look to what functions are working how with other files as well as other environments.
So if you dont mind to open your source code i would gladly have a look into it. Either i can use and understand it or its just to understand the workflow^^ -
@Chips: You know, I’ve always thought… “Better to make a program that works than a strict program that doesn’t.” Doesn’t really matter whichever way you do it, it doesn’t need to be in realtime and it does what it’s been programmed for. What else would you ask?
-
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 :-[
Sorry, just read your reply. Did you reupload your version which generated this path?
-
Yep - fixed it, re-uploaded the fixed version finally (he says… praying)
However, it was checked with that path - time is a lil short at the minute so I didn’t go overboard with checking them all which is poor form, but logically speaking the bug causing the issue is fixed so they should all work fine (typical famous last words there)
@Chips: You know, I’ve always thought… “Better to make a program that works than a strict program that doesn’t.” Doesn’t really matter whichever way you do it, it doesn’t need to be in realtime and it does what it’s been programmed for. What else would you ask?
True, but there’s a certain amount of pride to be had in a well constructed and maintained program It started out with what I think was a good starter, but since I’m no pro at algorithms and data structures per say, I’ve done the best that I could think of. Undoubtedly there may be optimisations or more suitable collections to do the job - that I’ll accept as being something I can’t realistically solve without help from more experienced or knowledgeable people So that’s fine.
However, as time progressed, to fix certain issues and make things work - I got sloppy and just “did what it needed” with quick fixes - which kinda breaks my own personal pride factor in trying to make it the best it could be… but I was limited by time and willpower
For instance I read system files twice… Why? Because it was the quick and easy fix. Read the files, get all the nicknames - then read the files and check that the jumps “goto=” line is actual referencing an existing jump object in the target system. I could parse the files just once instead - it required altering the jump objects to hold target object instead of just a link to the system. Then it’d be a simple matter of iterating through the collection of jump objects after reading all the files and checking that referenced target object is contained within the collection of jump objects.
The reason I read it twice? I point out the line number of the file containing the mistake, couldn’t be arsed to start altering objects - how the reader originally read it and amending etc. Just re-reading the files again (loop already existed) and checking the reference exists was a much quicker solution and allowed the ability to highlight the line number easily too so that error reports could pinpoint the location. It could still all be done in one single reading of files, but to save a second or two and make it more “correct” I couldn’t be bothered
There are other similar lazy short cuts that are what I consider poor programming. There will be far more style or structure issues I’m sure
-
ok - just to be sure ive downloaded the latest path generator (again) and tried it
I made some screenshots to explain it betterThis pic shows how a path should look like (waypoint… path leading from the ship to the waypoint… and next waypoint shown on the target box on the lower left side)
I simply switched from the custodian system to the new york system which is just one jump away … both systems connected via ordinary vanilla jumpgates
In new york i placed a waypoint… now FL originally should generate a path to that waypoint… but as you can see this is not the case… the destination waypoint is there… but no path leading to the gate in custodian (like it should be) and no path to the waypoint in new york
In normal case there should be 2-3 waypoints (i cant remember if waypoint 1+2 are the same)
waypoint 1 should be in custodian at the gate to new york
waypoint 2 should be in new york at the custodian gate
waypoint 3 should be the destination
systems_shortest_path.ini contains following for this path relevant code:
Path = li01, cf02, li01, cf02
Path = cf02, li01, cf02, li01shortest_legal_path.ini:
Path = li01, cf02, li01, cf02
Path = cf02, li01, cf02, li01shortest_illegal_path.ini naturally doesnt contain any paths for those systems since there are no jumpholes
-
ah now I understand what you mean, i’ll try that again in a bit and see what I can get.
Here’s the source-code - the src folder with all the packages and the classes.
I use netbeans as my ide of choice, so the “form” files within the gui package are from netbeans as I hate making GUI’s due to layout issues within Java being hard work (gridbags), so used the guibuilder to do the leg work.
It means the GUI code is NOT pretty. I could have used some fairly standard layouts, but it was easy to use a gui builder.
Fraid the comments are NOT as full as they should be, far from it and typically I never filled in method headers (stupid oversight, but right now I’m not inclined to go through it due to personal issues).I’ll clear the code up at some point in the next day or two, comment methods, remove excessive rubbish etc.
The main class is FLScanner inside the GUI package, or should I say the “view” anyway.
However, the controller is the Main.java class inside the pathscanner package and therein you find the amalgamated mess of code which does everything (kinda). The lockedgateparser, solararchparser,systemparser and uniparser do what their name implies (uni for universe.ini, system for all systems files).Tis free for anyone to look at, fiddle, critique, comment etc (please if you critique, make it constructive by telling me what it should be!) or amend (likewise, if you amend/alter something - please let me know what you’ve done/why - or just fire me a changed version over).
Erm, guess you could say it’s open source under gpl (can’t be arsed to look up which one is preferential at the mo) or whatever it is. Basically do what you want with it, but NO commercial gain may be made from it’s use or inclusion into anything etc - and don’t pass it off as own work either.
-
Thank you very much Chip…
The main principal for programs is that they are working No matter how the background looks like…
At first i might fight through the source as i am not very familiar - either with java or with GUI in java I just had some lessons… but its very likely like C (i know its different - but not much :))So if i have any critic i will let you know via PM.
Thanks for your effort to make your source viewable!Greez
Huor -
Hi Chips.
I have had no further problems with this utility, it’s great.
Have you had any other negative feedback?
Has Op fixed his problems?
-
Hi Chips.
I have had no further problems with this utility, it’s great.
Have you had any other negative feedback?
Has Op fixed his problems?
Never had any negative feedback
Had bug reports, but they’re not negative - they’re a good thing
I’ll take another look to see if I can find that issue, bit busy at the mo
-
Tsk Tsk
Must be them thar Uni pills ‘es bin takin’!
I meant bug reports, Chips.
I have not experienced Op’s type of problem, have there been others?
-
-
Well, what can I say?
I tested the files made by this utility very extensively today and it plots correct paths for me each time. I’ve got maybe 20 new systems but it’s enough.
I will report again if I find anything untoward.
-
I just need to drop some ideas here, I have 115 systems and plenty of paths. the file is 700kb+ in size and have spent a lot of time working through problems with paths.
Firstly, if you have visit 128 entries on the zones at the gates or jumps this can cause problems.
Secondly, if you use the whacky invisible jumphole/ random jump holes, this does cause problems
Thirdly, you need to realise that the game doesnt read your path from the path file direct, it parses the file (in memory), so if you have any problems with your jumps it will be flakey and this is typical of the problem OP was mentioning in setting paths/waypoints. So you can have a perfect path in the file showing the right jumps etc, however, it means nothing if other paths are wrong or incorrect in the relevent file.I found that if you still have problems with paths, as long as one of your illegal or legal files match your shortest file, this can be a temporary workaround. i.e. it doesnt crash the server.
Hope some of the above is of some help to people.
-
???
More confused tbh I think it’s important to split up waypoint plotting, and jump path creation.
Without the shortest paths, jumping from one system to another (from 5+ year old memory) results in a crash. Without, however, the path files - you also can’t plot a “best path” between systems.
So somehow it’s related to the best path, the question is how - and this is where I’m starting to get confused as to where responsibilities lie.
The paths generated cannot identify objects for which waypoints should be set. The path files just contain the names of systems, nothing more…
At that point I’d assume that the path file is basically just a load of links, saying “look here, then here, then here” with each link referencing the system object or whatever it needs to look at next before passing it to potentially some sort of actual path plotting algorithm. There is nothing else within the path files that can identify targets for path waypoint plotting. It’s out of my hands so to speak, I can’t control that. For example, in the original game - plotting from Li02 to Li04, where if memory serves, the shortest and illegal both just go straight from Li02->Li04 (connected by jumphole) whereas legal goes Li02->Li01->Li04. However, there’s nothing that goes “plot to this object, then in next system, this object, followed by this object, then this object, this object and finally in the new system this object” etc. Obviously something else takes over and actually works out where the plot points will be…
So are these 128 zones causing issues for the thing that actually plots the points? (stops a course being plotted? Or makes it incorrect?)
Are the multiple overlaid jumpholes/invisible jumps causing issues?I’ve no idea how it identifies certain jump objects, trade lanes or other as being what to waypoint… and certainly the path files themselves contain nothing that indicate this either - how could they.
What can I do to resolve these issues, or are you saying that’s the problem - it’s not the path files, it’s the actual system files the modder makes that causes this issue in how he’s dealing with zones/objects? At a bit of a loss now.
I got confused quite how the making shortest/legal/illegal all the same (irrespective of whether there’s an acceptable jump object available with correct legality) can somehow make everything work without issue. That, to me, appears to make no sense… if legal = shortest, can you plot through jumpholes in Omicron Alpha? or if you try, does it target the sun or the jumpgate or just say no best path?
If the game only plots to legal jump objects, it should throw a fit and plot to the first targetable object (the sun usually) of a system whereby there’s only jumpholes, or just say “no path”. If it just says “no path”, then how come we’ve had issues with incorrectly targeted objects within a system - and why is the path file responsible for this, or how is the path file responsible for this?
Super confuddled now
-
Yes Im saying that the paths are simple, the issue lies in the modding of the systems.
For instance, I used the path gen from flscan, got similar problems to other people and edited the system inis accordingly and i have it working fine. This is the same flscan that people have said its crap at path file gen etc. etc.
So, in summary, whilst I havent used your tool Chips. I dont believe it will be a tool problem, it’s a modding problem.