Request: an easier way to implement paths (no idea whether this is even possible)
-
[…] A [c]visit =[/c] entry isn’t necessary, and hence redundant, for Trade Lane Rings. Could you think of a h[a]ck that totally eliminates the entire line from the generated code?
I could, but the VB6 decompilers I had didn’t work, which is why I just changed the number. I’ve now got a new decompiler, so here’s how to remove the visit line altogether:
2E74 12->00
77B9 0C->11
7C2A 0C->11That replaces something like [c]str += “visit = 1” + vbCRLF[/c] with [c]str += “” + “”[/c].
Significant (to me at least) is that leg 1, 3 and 4 all go from upper-left to lower-right, while leg 2 (which was the one that was skrewed up in the first tests) goes from upper-right to lower-left.
Attached is a new version which should flip automatically. To summarize usage: the first leg should define [c]shape[/c], [c]size[/c] (first value), [c]pos_begin[/c] and [c]pos_end[/c], whilst subsequent legs should only need [c]pos_end[/c]. It may still need tweaking if there are any paths across the Y plane.
-
Thanks!! It’ll have to wait until late in the evening though.
-
There’s a few more settings I could automatically duplicate: nickname (add 1), sort, toughness, density, repop_time, max_battle_size, pop_type, relief_time, path_label (add 1), usage, mission_eligible, density_restriction (multiple), encounter, faction (multiple). Alternatively, take the TLC approach and instead have a standalone utility that takes a few parameters and generates all the zones.
-
adoxa wrote:
There’s a few more settings I could automatically duplicate: nickname (add 1), sort, toughness, density, repop_time, max_battle_size, pop_type, relief_time, path_label (add 1), usage, mission_eligible, density_restriction (multiple), encounter, faction (multiple). Alternatively, take the TLC approach and instead have a standalone utility that takes a few parameters and generates all the zones.Both approaches would be great assets, I suppose.
The first one (the extended / enhanced ZonePos) would have as advantage that it would make the creation of more complex systems, like the House Systems, exponentially more easy! It would become possible to, almost intuitively, alter the course of a patrol_path by changing a single set of coordinates!
(One would almost be temped to re-write all the paths in the vanilla files according to this new ZonePos format, to create the ultimate SDK! But that’d be hard labour… Oh btw, would these new-style coordinates be parsed by RimShot’s System Calculator?)
The second one (the standalone ‘TLC style’ utility) would have as advantage that it would render ‘orthodox’ code, indistinguishable from the vanilla paths. As a layman I’d presume that, the less plugins, the better, to avoid possible conflicts; then again your plugins do not seem to trigger any conflict anyway, so this presumption might be baseless.
A standalone tool would btw also have an unintended second function that the TLC lacks: it could be used to calculate a trade_lane’s traffic zone. This isn’t that difficult, but it takes some time doing it manually. A path calculator would be able to do that faster, and more accurately (although a trade_lane differs in several aspects from a typical patrol_path, the pos, rotate and size (length) work the same.)
-
adoxa wrote:
Attached is a new version which should flip automatically. To summarize usage: the first leg should define [c]shape[/c], [c]size[/c] (first value), [c]pos_begin[/c] and [c]pos_end[/c], whilst subsequent legs should only need [c]pos_end[/c]. It may still need tweaking if there are any paths across the Y plane.
The new version works fine, both without and with [c], flip[/c] added (I tested that to see whether that parameter could still be used. It didn’t cause a crash but it also didn’t do anything so I wonder if it would work when somehow the path would actually need to be flipped?)
-
Oh btw, would these new-style coordinates be parsed by RimShot’s System Calculator?
That’s a good point - none of the system readers (e.g. FLE, Studio) or ini error checkers would recognize them, so the standalone utility is probably the way to go. Bugger, I didn’t really want to write one.
[…] then again your plugins do not seem to trigger any conflict anyway, so this presumption might be baseless.
Actually, I’m still amazed that there’s only been one (known) conflict (EngClass & MultiCruise).
-
The new version works fine, both without and with [c], flip[/c] added (I tested that to see whether that parameter could still be used. It didn’t cause a crash but it also didn’t do anything so I wonder if it would work when somehow the path would actually need to be flipped?)
Only the point is read, everything else is again ignored. It would, of course, be better to fix the generator rather than require manual flipping (it was uncertainty on my part that I did that).
Oh, you might also want to check the direction is right (i.e. ships go from start to end, not end to start). Is there a better way of testing that than just waiting for a patrol to show up and join it? Or is direction implied by the sequence of paths?
-
adoxa wrote:
Oh, you might also want to check the direction is right (i.e. ships go from start to end, not end to start). Is there a better way of testing that than just waiting for a patrol to show up and join it? Or is direction implied by the sequence of paths?
Interesting question from the point of view of trying to understand the game engine, but of little practical consequence: there is no use tracing a ship from the start til the end of a path anyway. So, if the ships reverse midway, it has little consequence (unless the other legs aren’t used because of it).
A path imho should:
-
not trigger a crash;
-
appear as if the faction would actually use it, if FL’s universe were real;
-
actually generate traffic;
-
occasionally trigger a trade_lane attack (if it’s a pirate faction’s path
assumed
-
When the player’s ship approaches a pop zone, that zone will be filled with traffic as defined in the zone’s setup.
-
While the player’s ship is inside a pop zone, the game will render traffic as defined in the zone’s setup.
-
-
I’ve always assumed that path-legs are bi-directional, mostly because it would be awfully inconvenient if they weren’t […]
Yeah, makes sense.
So, is the zone primarily a property of a certain area in the system that gets ‘alive’ by the player’s ship approaching, or a condition of the player’s ship being in a certain area? (Of course, these are hard to distinguish between, and I’m not even 100% sure whether I fully comprehend what I’m asking :D)
Sounds like you’re asking is there traffic because of where you are or what you can see. A quick experiment suggests the former (from Manhattan I went 21K straight up, outside New York’s NW ambient zone, and the traffic stopped). That makes sense, too, because where you are is a lot easier to test than what you can see.
-
adoxa wrote:
Oh btw, would these new-style coordinates be parsed by RimShot’s System Calculator?
That’s a good point - none of the system readers (e.g. FLE, Studio) or ini error checkers would recognize them, so the standalone utility is probably the way to go. Bugger, I didn’t really want to write one.
Well… for me personally it wouldn’t actually matter that much, because I mainly have used the System Calculator because creating paths was such a drag — which ZonePos has now fixed.
To elaborate: On a few occasions I used an existing system as a basis for a new one. To make it look different enough, I changed its size with FLSysCalc, and semi-manually left-right-mirrored it. Then, I replaced the Faction constellation i.e. Rheinland Navy + Hessians with Bretonia Navy and Mollys. But now that paths can be generated a whole lot easier, this approach is now redundant.
FLSysCalc might still be usable if all pos_begin and pos_end entries are changed into just pos? Each path would have two pos entries then; not sure whether one would be ignored? Also, afterwards all the _begin and _end suffices must be restored.
The main error checker that I use is FLScan, mainly to eliminate those very obvious yet overlooked errors (e.g. missing base files, undefined archetypes and loadouts etc.) Afaik FLScan doesn’t even check whether the legs of a path properly connect. So, no real loss here.
-
I should be able use two [c]pos[/c] values, if you like (although then you’d have to supply both, as there’s now way to tell if begin is missing). There’s also the option that having the plugin deliberately prevents the patrol paths from being read. Well, not really a big deal with paths, but if there was a similar trade lane plugin, it would hide those from things like Companion.
I’ve had the thought of using a separate file, allowing all your custom patrol paths and trade lanes to be stored in a single file (per system), The tool would then take that file and generate the equivalent FL version, which you would then (manually, possibly automatically) insert into the system file.
-
adoxa wrote:
I’ve had the thought of using a separate file, allowing all your custom patrol paths and trade lanes to be stored in a single file (per system), The tool would then take that file and generate the equivalent FL version, which you would then (manually, possibly automatically) insert into the system file.
Sounds great, I suppose, but I do not fully comprehend.
-
I’m not entirely sure of exactly how I’ll format it, but given something like:
[PathPatrol] nickname = Zone_Li01_path_navy6 ; underscore & number appended automatically sort = 99 toughness = 2 ; etc ; path_label, if absent, could be based on nickname, taking everything after "path_" pos = <begin point="">pos = <next point="">attack_ids = 24 ; specific to this leg pos = ... [PathPatrol] ... [TradeLane] ; normal common stuff start = <number of="" first="" ring="">begin = <point of="" first="" ring="">end = <point of="" last="" ring="">; still haven't decided how to handle ring-specific values [TradeLane] ...</point></point></number></next></begin>
you would end up with a file (or maybe stdout or clipboard) containing the proper Freelancer zones/objects.
-
adoxa wrote:
[…]you would end up with a file (or maybe stdout or clipboard) containing the proper Freelancer zones/objects.
That’d certainly be nice!!
However, attack patrols aimed at trade lanes, can imho only be made after the trade lane rings are already in place, because it seems like they need to be aimed at an individual trade lane ring to trigger the “lane interrupted” event.
So, to me it makes sense to first create the physical setup of a System, including trade lanes, and only then generate the paths.
-
Here’s the first version of Tracks, a program to generate complete FL definitions of trade lanes and patrol (or trade) paths given abridged definitions. For example, this will generate the first trade lane found in [c]Li01.ini[/c]:
[Settings] system = Li01 reputation = li_p_grp loadout = trade_lane_ring_li_01 [TradeLane] number = 16 ; nickname number, not number of rings first = 3628, 0, -52369, 196776 last = -11163, 0, -78469, 261658 zone = 839, 3 ; size (both width & height) and nickname number sort = 14 toughness = 1 density = 6 ...
and this will generate a patrol path found in [c]Br01.ini[/c]:
[Settings] system = Br01 [Path] name = molleys, 7 pos = -71115, 0, 27545 pos = -52152, 0, 9177, return pos = -40132, 0, 12130, return pos = 7661, 0, 26736 pos = -9684, 0, 46240 tradelane_attack = 10 pos = -40162, 0, 12415 tradelane_attack = 10 sort = 99 toughness = 7 density = 3 ...
There’s a [c]readme.txt[/c] that describes the format; hopefully that’s sufficient documentation, along with the program’s own help.
Current limitations:
[olist]* it’s 2D - Y is ignored (could do with examples if this is desired);
- there’s no provision for individual trade lane rings having a different loadout;
- only writes to file (options for stdout or clipboard shouldn’t be a problem);
- it’s intended that a single file has a single system, but could add extra housekeeping if you’d like multiple systems in a single file.[/olist]
-
Great work Adoxa! It looks very promising!
A few questions though:
[olist]* First of all: how to even use this? When I double-click tracks.exe, it opens and closes within a tenth of the blink of an eye, where I had expected to be asked for a specific text file, or maybe a text interface, or otherwise a dialog to point to the proper directory.
-
Second: when you say that [c]lane_id[/c], [c]tradelane_down[/c] and [c]attack_ids[/c] are not used, do you mean not at all, not ever, in vanilla? Or, by tracks.exe (implying that one has to manually add these after the code is generated)?
-
Btw I presume (but never gave it much consideration actually) that [c]tradelane_attack =[/c] is a 1-divided-by-value (meaning that the smaller the number, the bigger the chance) rather than a percentage-ish-type value (meaning: the higher the value, the bigger the chance). Do you know how this is treated?
-
-
1. It’s a console program, so ideally you’d run it from Command Prompt. Running it from Explorer should display the help and wait for a key (it does for me on 7). Drop a file on it (say [c]tracks.ini[/c]), it’ll open & close, and you should end up with the output file ([c]tracks-fl.ini[/c]). … Ah, in testing on 10 I realized I forgot to mention that it expects Freelancer to be installed (I use its ini-reading code). If that’s not the case copy [c]common.dll dacom.dll dalib.dll zlib.dll[/c] to subdirectory [c]EXE[/c] (or point [c]HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft Games\Freelancer\1.0\AppPath[/c] to where you installed FL).
2. Not at all - Freelancer does not read them (same with [c]difficulty_level[/c] and [c]pilot[/c] in [c][Object][/c]s).
3. I know it’s apparently treated as a percentage (the value is divided by 100), so presumably higher means more likely.
With regards my point 4: I need to do that anyway, as it should work with multiple files. And with point 3: I’ll test if output is redirected and send it there if so; piping to [c]clip[/c] will then put it on the clipboard.
-
I can only write a very short reply because my time is pressed!
adoxa wrote:
1. It’s a console program, so ideally you’d run it from Command Prompt. Running it from Explorer should display the help and wait for a key (it does for me on 7). Drop a file on it (say [c]tracks.ini[/c]), it’ll open & close, and you should end up with the output file ([c]tracks-fl.ini[/c]). … Ah, in testing on 10 I realized I forgot to mention that it expects Freelancer to be installed (I use its ini-reading code). If that’s not the case copy [c]common.dll dacom.dll dalib.dll zlib.dll[/c] to subdirectory [c]EXE[/c] (or point [c]HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft Games\Freelancer\1.0\AppPath[/c] to where you installed FL).Hmm… I’d prefer to point it to my mod, instead of Freelancer directly, also because at some point I have multiple installations of Freelancer. (Btw I haven’t installed Freelancer from an installation disk for years, naybe well over a decade. So, how could there be a register entry for it?)
About tracks.exe: I imagine a GUI like your XML->UTF tool would be excellent: in XML->UTF the user can enter an input and an output folder (and it also helps with my, admittedly irrational, aversion against console programs). But I have no idea how this would complicate your task, and/or how much work that would be.
Gotta run!