Request: an easier way to implement paths (no idea whether this is even possible)
-
Adoxa wait!!
Just noticed that a rotation value in one of the vanilla-style paths got mauled! Maybe that caused the issue!
EDIT, No it matters not. With the error in that vanilla-style-path* corrected, the path-new-style still has the same issie.
*I presume that that path just somehow inherited the value of its predecessor? (Although I once tried to see how much is inherited, and was disappointed.)
-
Since I don’t really know what I’m doing, I took the simple approach and added an extra parameter to [c]pos_end[/c] that flips the rotation. Now you should be able to have a single [c]pos_begin[/c], with a chain of [c]pos_end[/c]s, manually adding [c]flip[/c] to the legs that aren’t right. I hope.
-
Thanks, I’ll test that tonight.
Btw some vanilla paths have 90, but other -90 as the first rotation value. I don’t know how significant that is here, but iirc if you reverse these values (turning 90 into -90 or vice versa), those paths show the same behavior as the faulty paths generated by ZonePos.
No success with looking into the Trade Lane Calculator? That tool does the angles right.
I have absolutely no idea how complicated it is to create such a standalone tool like the TLC or your XML->UTF (and vice versa) converter. But as I’ve always been content with the TLC (although I do find a bit annoying that it writes a [c]visit = 1[/c] line to every single Trade Lane Ring) , I always wondered why the same dude didn’t make a path (a single leg of a path that is) calculator, which would be similar. Maybe he already left the scene before paths were even discussed; iirc the TLC was a very early tool.
-
Btw some vanilla paths have 90, but other -90 as the first rotation value. I don’t know how significant that is here, but iirc if you reverse these values (turning 90 into -90 or vice versa), those paths show the same behavior as the faulty paths generated by ZonePos.
That’s effectively what swapping begin/end did; flip does it by subtracting 180.
No success with looking into the Trade Lane Calculator? That tool does the angles right.
That wasn’t my experience with these paths. Both this and FLDev generated <0, n, 0>, which apparently is a vertical cylinder. I add 90 to the X-rotation and swap the X values for Y & Z.
[…] although I do find a bit annoying that it writes a [c]visit = 1[/c] line to every single Trade Lane Ring […]
Change 2E88 from 31 ([c]1[/c]) to 30 ([c]0[/c]) to write [c]visit = 0[/c] instead.
[…] iirc the TLC was a very early tool.
V2 is from May 2004, so about a year after FL was released.
-
adoxa wrote:
Moonhead wrote:
[…] although I do find a bit annoying that it writes a [c]visit = 1[/c] line to every single Trade Lane Ring […]Change 2E88 from 31 ([c]1[/c]) to 30 ([c]0[/c]) to write [c]visit = 0[/c] instead.
Thanks, but tbh that’d be just annoying A [c]visit =[/c] entry isn’t necessary, and hence redundant, for Trade Lane Rings. Could you think of a heck that totally eliminates the entire line from the generated code?
About to download and test the updated ZonePos now.
-
With [c], flip[/c] added, the second leg of the path is properly connected now:
[zone] nickname = Zone_Br07_xpath_mollys9_2 shape = CYLINDER size = 750 pos_begin = 71125, 0, 3996 pos_end = 60000, 0, 9800, flip
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.
Btw As they now show up as they should, I think we can assume they are treated by the game as any other path encounter. So, whether or not ships show up, whether or not they actually attack Trade Lane Rings etc. is not something governed by ZonePos.dll and hence not relevant (Adoxa correct me if this assumption is wrong).
-
[…] 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.