Important Message

You are browsing the archived Lancers Reactor forums. You cannot register or login.
The content may be outdated and links may not be functional.


To get the latest in Freelancer news, mods, modding and downloads, go to
The-Starport

Automated Trade Lane builder - anyone want to try it?

The general place to discuss MOD''ing Freelancer!

Post Tue Dec 14, 2004 2:57 am

Automated Trade Lane builder - anyone want to try it?

I got a wild idea yesterday and decided it would be cool to automate the process of making a trade lane. Trade Lanes are interesting to play with; they are really labor-intensive to build, but the basic stuff - start here, go to there - is pretty simple. If you know where the lane should start and end and how widely spaced rings should be, the actual positions, angles, and links to next/previous ring can be generated mechanically.

I have a complete tool now, but I don't have much experience with making trade lanes and I'd be interested in getting feedback on it from people who want to try it out. I want to make sure it gets stress-tested before I submit it as a download. If you're interested and preferably have done trade lanes before, let me know and I can get you a copy; I just need feedback on how it behaves.

Unfortunately I don't have an easy spot to put up a screenshot right now, but here's a quick word picture. It's a simple graphical app (actually an HTA like aFLDirectIP and MyFLAccountID from Freelancer) for convenience.

At top there are 2 spots for you to put in the start and end ring positions - obviously you need to know where you're coming from and where you're going to even start a ring. There's a box for maximum distance between rings (default is 7500), and another one for a "base" name for your trade rings. The default is "TLR".

If you leave the defaults and then just plug in the start ring pos -29000, 0, -29000 and the end ring pos -20000, 0, -17000, the following is all automatically generated in a box at bottom. You can then copy and paste the entire thing into the system ini file where the trade lane is going to be.

A couple of comments on what I have...
+ I wanted to make it as generic as possible so that simple use wouldn't produce weird things. So I used an empty ids_info spot and there is no faction orientation for the rings created this way.
+ The example data would give you a short lane in li01.ini pointing vaguely from Trenton towards the sun.
+ The angles are automatically generated and worked ok for minor variations around the Trenton-to-sun orientation. The calculation will blow up for some angles, and does NOT work vertically yet. It's a standard but complex transformation based on the direction of the lane relative to the system axes, and I need to figure out details. Also, I get the impression that there may be a problem with near-vertical lanes from prior posts, so there may be an actual limitation for purely vertical lanes.

<pre><font size=1 face=Courier>
;; Autogenerated trade lane ring data follows.
;; vector: 9000,0,12000
;; lane length: 15000
;; Ring count: 2
;; ring spacing: 7500
;; unit vector: 0.6,0,0.8

[Object
nickname = TLR_Trade_Lane_Ring_0
ids_name = 260616
pos = -29000, 0, -29000
rotate = 0, -143, 0
Archetype = Trade_Lane_Ring
ids_info = 66170
next_ring = TLR_Trade_Lane_Ring_1
behavior = NOTHING
difficulty_level = 2
loadout = trade_lane_ring
pilot = pilot_solar_easy

[Object
nickname = TLR_Trade_Lane_Ring_1
ids_name = 260616
pos = -24500, 0, -23000
rotate = 0, -143, 0
Archetype = Trade_Lane_Ring
ids_info = 66170
prev_ring = TLR_Trade_Lane_Ring_0
next_ring = TLR_Trade_Lane_Ring_2
behavior = NOTHING
difficulty_level = 2
loadout = trade_lane_ring
pilot = pilot_solar_easy

[Object
nickname = TLR_Trade_Lane_Ring_2
ids_name = 260616
pos = -20000, 0, -17000
rotate = 0, -143, 0
Archetype = Trade_Lane_Ring
ids_info = 66170
prev_ring = TLR_Trade_Lane_Ring_1
behavior = NOTHING
difficulty_level = 2
loadout = trade_lane_ring
pilot = pilot_solar_easy
</font></pre>

Post Tue Dec 14, 2004 3:37 am

well, i couild probably write the code in C++ in a day or so, but i'm pretty damn busy right now with finals and all.

it wouldnt be that hard either, the hardest will just be calcualting points. each trade lane is 7 km away from each other, so with a bit of input corrections and thick algorithms, its perfectly and easily accomplishable.

Post Tue Dec 14, 2004 3:53 am

It's the angles that are killing me. I'm not sure about details of the coordinate system FL uses - I got the impression it might be a lefthanded system - and on top of that I don't remember the details for getting angles with respect to axes. Rotations aren't invariant for order IIRC.
I'm a little puzzled about why they actually require rotation specification. Sure you need to know which way is "in" and which way is "out" but that can be inferred from previous-next ring, and the orientation of the rings would be determined by the vector along the lane.

Post Tue Dec 14, 2004 9:37 am

hmm.. angle's are painful lol. id get lost with that also, but here's a suggestion.
You Should make the Trade Lane Marker like an Item or something, like a weapon .. wait nvm that wouldnt work out. ud got to do alot of thinking to get that working o.O.. not even sure if FL can support soemthing like that.

<Watch your 12! Incoming !>

Post Tue Dec 14, 2004 2:20 pm

Erm, he is not talking about ingame-equipment, but a tool to create tradelanes, used by modders for their systems.

Post Tue Dec 14, 2004 2:41 pm

I'm confused. We can make tradelanes in FLE, why do we need a seperate program?

--------------------------------
[email protected]

Leader of the Republic Mod Team.
"Criminal Organisations don't just spring up overnight. It's a conspiracy" - overheard on a a Liberty comm frequency

Post Tue Dec 14, 2004 2:47 pm

The only thing FLE's TradeLane builder can't do is vertical tradelanes...
Maybe they want to work on this? (A friend of mine tried to make vertical tradelanes, and it bugs with a vertical angle of 45 degrees or more if I remember well...)

Post Tue Dec 14, 2004 3:54 pm

Dang. I never saw that in the interface, but I can see it described in the help file. I need to check out the tutorials on FLE.

At least this was good practice.

Post Wed Dec 15, 2004 4:45 am

it'll take a long time to calculate how to transform two given points into an angle and divide that into coordinates properly.

Post Wed Dec 15, 2004 2:31 pm

Nice idea though keep em coming!

+++ out of cheese error - redo from start +++

Xtreme Team Studios

Post Wed Dec 15, 2004 3:51 pm

Excuse me for popping in (I ocasionally still read the LR forums) but I believe BL-Winter already created the tool WatercoolerWarrior describes. He refers to in on the 3rd page of this thread (scroll down to about 90% of the page), and put his Tradelane Calculator V2 up for download. As far as I can remember (it has been months ago I created a trade lane), it works fine.

Btw, good to see the FL modding community still prospers


Edited by - moonhead on 12/15/2004 3:55:04 PM

Post Thu Dec 16, 2004 1:17 am

Interesting, moonhead, this looks like it does most of what people would need for modding the same way mine works: give the endpoints and it does the rest. It doesn't do 3-d, but really that isn't necessary for the vast majority of trade lanes. Even if you've offset something up or down a thousand units or so, over a 10k or longer lane you can just vary z position linearly - visual effects due to the angles being off will be tiny.

One thing I'm curious about that seems odd. Why does everyone refer to the second coordinate as being the z-axis? It doesn't matter what we call them of course, but I assume there's a reason based on what we know about FL's geometry?

Post Thu Dec 16, 2004 1:49 am

Coolbeano,

Actually it isn't too time-consuming to calculate, just a little complicated. You can transform the vector along the lane into spherical coordinates to get the orientation from the angle; there are only 2 important values, the angular ones in a spherical coordinate system. The calculation will blow up for particular orientations, but that can be handled in code by just catching the errors and assuming that those values point directly to the problem angle.

Dev

Post Thu Dec 16, 2004 2:02 am

Most people are used to a flat plane containing the x and y axes. Since FL is in general built around a flat plane of sorts, it is natural to consider the two axes that it contains as the x and y axes; however, according to FL coordinates (and, if I'm not mistaken, the coordinate systems of most modeling programs), these are the first and third numbers in a coordinate triple, as opposed to the first and second as would be expected in a "conventional" coordinate system. Rather than go against intuition, it is usually easier just to say that the first and third numbers refer to the x and y axes and that the second number refers to the z axis.

Post Thu Dec 16, 2004 2:14 am


It doesn't do 3-d, but really that isn't necessary for the vast majority of trade lanes


A long time ago (actually my 1st attempt to create a system) I created some trade lanes that went up and down. The 1rst ring was just straight, the 2nd bent up about 15 degrees or so, and the 3rd and subsequent rings 30 degrees. At the end, it was the reverse, to get the ship straight again. It wasn't really satisfying, visually speaking (the ship seemd to escape from the lane, especially at the rings 2 and 3) but it didn't crash the game.

What really would be nice is to rotate trade lane rings 90 degrees, so that there is a left and right instead of an upper and lower tunnel. Of course it's easy to simply rotate the rings, but the docking script should also be altered, otherwise the ships will also rotate when they dock at a ring (flying on their sides, and from the player's point of view there would still be an upper and lower tunnel when docking at a ring).


Why does everyone refer to the second coordinate as being the z-axis? It doesn't matter what we call them of course, but I assume there's a reason based on what we know about FL's geometry


I'm not sure I understand your question... I think it's just a convention coined by the first modders. It seems logical: The X and Y coordinates refer to the east-west axis and north-south axis of the system's map respectively; the 3rd coordinate refers to the up-down axis and has been baptized "Z-coordinate."

Edited by - moonhead on 12/16/2004 2:15:08 AM

Return to Freelancer General Editing Forum