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

Making Trade lanes is a pain in the ass.

The general place to discuss MOD''ing Freelancer!

Post Sun Mar 23, 2003 10:41 pm

Making Trade lanes is a pain in the ass.

Oke i think the modding community getting bigger each day and we know alot now and we can make pretty neat mods but still making a simple trade lane is a pain in the ass making it go down up left or right is not very hard but making one that travels on a line of 45 degrees is almost impossible to make it look good. And before any visual editor sees the light i was hoping there was some kind of calculation for this i cant seem to firgure one out.

I have looked over excisting trade lanes and they all seem to have a nice set of steady numbers, just take two rings out of a lane and take a look at the position numbers. Example :

[Object
nickname = Li01_Trade_Lane_Ring_129
ids_name = 260925
pos = -51821, 0, 33906
rotate = 0, 109, 0
Archetype = Trade_Lane_Ring
ids_info = 66170
prev_ring = Li01_Trade_Lane_Ring_128
next_ring = Li01_Trade_Lane_Ring_130
behavior = NOTHING
reputation = li_p_grp
difficulty_level = 1
loadout = trade_lane_ring_li_01
pilot = pilot_solar_easiest

[Object
nickname = Li01_Trade_Lane_Ring_130
ids_name = 260925
pos = -58908, 0, 36359
rotate = 0, 109, 0
Archetype = Trade_Lane_Ring
ids_info = 66170
prev_ring = Li01_Trade_Lane_Ring_129
behavior = NOTHING
tradelane_space_name = 458757
reputation = li_p_grp
difficulty_level = 1
loadout = trade_lane_ring_li_01
pilot = pilot_solar_easiest

now take the -58908 from ring 130 and do it minus that of 129 : 58908 - 51821= 7087 now if you take that 7087 and put on the 58908 you wil get the position for the next ring. this also goes for the third position workes the same way. now this offcourse makes perfect sense but now making a new lane is still hard.
O by the way the exemple above here is diffrent then that of the original li01.ini i have been experimenting a little bit with it.

i was think that there would be a calculation based on how you turn your ring so if your working in a line of 60 degrees you can use this factor to make good positions for your rings..

Hope some will work with me on this.

Greetz Nataku

Post Sun Mar 23, 2003 10:56 pm

Erm, yes... it's trigonometry.

You'll do best by positioning a start and end pair of rings, then working out what angle they should be at to join (simple trig, because you've got both the x and y positions of each ring pair, you know the dimensions of the triangle). Work from there.

Don't argue with me.
I'll get all upset and not like it.

Post Sun Mar 23, 2003 11:03 pm

but who you you get time on grid cords whit a endless string of numbers behind the ","

Post Sun Mar 23, 2003 11:07 pm

Is it trig? It seems more like simple "Find the slope" I dont know the way these are setup, I would guess that its on a XY axis? I have no idea.

If it is, then all you would have to do is... if one jump gate is at -5000, -5000 and you wanted a perfect 45* angle you would just have to add (-)1000, (-)1000 depending on the way you want to go.

Man if only I could remember the calculation to convert and angle to a slope... Well if I remember I'll be sure to post it

Post Sun Mar 23, 2003 11:23 pm

No it is more complex then that, the gates are 2k away from each other, your way would set them 2k away from each other in X postions not the real distance

Edited by - Artic on 23-03-2003 23:39:25

Post Sun Mar 23, 2003 11:36 pm

Well your right making 45 degrees turns aint that hard but going between because by this way your doomed to setup stuff in 45 degrees turns.

There must be a simple calculation for it has be be.

So if you start at 0, 0, 0, (where normally the sun in newyork so the center)
and you set a ring there and setup the rotation of the ring like this 0, 160, 0,
you can either go down or up if going down you will go a little to the left and up a little to the right.

if you are going down then first make you distance for the ring should be about 7088 so you will get 0, 0, 7088, now for the hard part getting in line with you lane by setting the number how far it should be to the left.
And i think the rotation comes into play here.

Hmm i will srew around with it allitle.

Greetz Nataku

Post Sun Mar 23, 2003 11:53 pm

Now, 7500 is the distance between the two rings in your example.
To place a ring, then, you would-

1. Set the ring's rotation.
2. Multiply the sine of the rotation angle by 7500.
Round it off. This is the Y distance to the next ring.
3. Multiply the cosine of the rotation angle by 7500.
Round it off. This is the X distance to the next ring.

This should work.

Post Mon Mar 24, 2003 12:31 am

Oke great info only i am not enlish so i dont know all the words what heck do you mean with sine and cosine..???

Greetz Nataku

Post Mon Mar 24, 2003 12:36 am

Oke i figured out what it means now to get it working :p my math sucks pretty good if it comes to these kind of calculations :p

Greetz Nataku

Post Mon Mar 24, 2003 12:44 am

Oke now i totaly figured it out, been awhile since i used maths so dont remember all the terms...

But i got it..

Thx for the info.

Greetz Nataku

Post Mon Mar 24, 2003 2:05 am

No problem, glad I could help.

Post Mon Mar 24, 2003 2:09 am

I'm making a little utility to make trade lanes and I need to test it.

Does anyone know a place where the trade lane goes up and down as well as to the x and y axises

Post Mon Mar 24, 2003 12:53 pm

If you have the start Lane and the end Lane you can calc the rotation with the formular: tangenz alpha = a/b.
Because you have an simple 90 grade three corner.

Post Mon Mar 24, 2003 2:28 pm

start x,y
wanted end x,y
distance


rotation = 1 /(tangens*((end y - start y)/(end x - start x)))

OR

rotation = tangens-1*((end y - start y)/(end x - start x))
; both do the same but the second is better writtin
; note that the -1 is a force like 2 to 2 is 4

real end x = start x + tangens (rotation) * distance..;should be rounded up/down
real end y = start x + sinus (rotation) * distance......;should be rounded up/down

ONLY WORKS WHIT POSITIVE NUMBERS








Edited by - Artic on 24-03-2003 14:37:01

Edited by - Artic on 24-03-2003 14:50:03

Post Fri Mar 28, 2003 5:31 pm

iproved the above a bit whit mathamatics normaltier used for this calcuation.

a = the desired angel wich starts a horizontal and goes up against the movement of the clock, should be equil to Z-rotation

y and x start = the starting point of the tradelane
x and y end = is the end loction of the tradelane

distance = distance from 1 tradelane to another, seems to varry between 2.5 and 7.5

always round the numbers up or down at the end of each calculation.

---------------------------------------------------------------------------------------------
to calculate the rotation agale of the tradelane,
---------------------------------------------------------------------------------------------
x and y end are the disired end cords.

a = tangens (end y - start y)/(end x - start x)

---------------------------------------------------------------------------------------------
to calculate the the the Z rotaion of the jump gate
---------------------------------------------------------------------------------------------
Zrot = a + 90

----------------------------------------------------------------------------------------------
to calculate the end point of the tradelane
----------------------------------------------------------------------------------------------
x end = sin a * distance + x start
y end = cos a * distance + y start






Edited by - Artic on 28-03-2003 17:33:08

Edited by - Artic on 28-03-2003 17:33:43

Return to Freelancer General Editing Forum