• Welcome to the new COTI server. We've moved the Citizens to a new server. Please let us know in the COTI Website issue forum if you find any problems.

Update on my project and what it means

Hal

SOC-14 1K
Hi Guys,
A while back, I embarked upon a pet project designing a methodology for tracking locations of starships within the Traveller universe as relates to normal space newtonian movement. The plan was to see if I could do it using the vector movement rules from BOOK 2: STARSHIPS from the original Traveller rule set such that the rules could be used with ANY of the TRAVELLER incarnations. As many of you already know, the process for vector based movement was to follow certain steps:

1) have the current location as a known location.
2) from that location, add to the current location, the vector of the ship's current built up velocity vector.
3) from the location of the built up velocity vector having been added to the "current location" a third point is plotted with this point treated as the final destination point that becomes the "New current location" in step 1.
4) determine the built up velocity vector as being the vector defined by the old location versus the final "new ending location".
5) repeat the steps.

Ok, so how does this help with my project and why am I talking about it here? The nice thing about computers is that they can store all of the plotted locations on a turn by turn basis (where one turn is 20 minutes). Relatively simple physics formulas can be used to determine distances traversed in any given time period. The real trick however, was to simplify all of the calculations such that they can used either by hand with a calculator, or by use of a soft ware program designed to handle all the drudge work and record all of the locations. To that end, this is what I've created as the means to an end.

The original formula for converting polar coordinates to rectangular coordinates required the following:
Note: I can't use the symbol for theta here, so I will use (theta) as its substitute...

x = r cos (theta)
y = r sin (theta)

Converting rectangular coordinates into polar coordinates requires the formulas:

r = (x^2+y^2)^.5
(theta) = arctan Y/X

Now, why is this important? Built up velocity is scalar and is represented by a "distance travelled within a given time period". It is also directional. This lends itself to polar coordinates VERY well. Acceleration is also to some extent, an issue of distance traversed within a time period, as well as directional. For example, if you stated that you intend to travel 135 degrees at 3.5 G's (where the direction of zero degress is due east on your map), you'd be travelling in what amounts to a near fourty-five degree angle towards 10 O'clock. At 3.5 G's, you can determine how far you'd go in 1200 seconds based solely upon those 1200 seconds. So we have what amount to inertial movement (built up velocity) and accelerated movement - both of which can be described easily as polar coordinate movement. Oddly enough? Planetary movement is more easily described in polar coorinates than it would be in rectangular coordinates. Which is yet another reason why one should look at the use of polar coordinates for any given TRAVELLER based campaign movement system.

Which brings me to the final point. I had searched for two years, off and on, for a DIRECT method of vector addition using only polar coordinates. As it turns out, it is not possible. You need to use conversions between the two methods. So here is what I discovered or had to "invent" for myself.

When you want to add the built up velocity vector to a known location that is already in polar coordinates, you need to convert the original position into an X,Y coordinate. Convert the ship's built up velocity into an X,Y coordinate system as well. ADD the two X values together, and add the two Y coordinates together to get your new location created by the vector addtion of current location plus first vector. Once you've done that - the next step is to convert your acceleration into a vector - which oddly enough, is done by means of the formula: distance (or r) = 1/2 acceleration x time^2 (make sure you convert that value into the units you intend to use for the game, ie miles or kilometers). Then, add THAT vector to your previous work, and presto: a mathematical system for emulating the basic components of vector movement from Book 2: Starships.

There is one final step you need to do, and that is update your built up vector based on last position plus the vector of your acceleration (which in this case is equal to twice the distance actually travelled, because distance travelled is not the same as speed attained while travelling during acceleration). Once you update the built up velocity vector - you're all set to repeat the process for the next "turn" (ie, 1200 seconds of time).

I've tested this process by hand, and it works. There are some minor irritations because arctan produces some odd results when used with angles greater than 180 degrees (and I will get into that later). Suffice to state, it is NOW possible for someone to create a spreadsheet in excel that will do all of those steps I mentioned above for keeping track of ship movement within any given star system. It would be even nicer when you think about it, to create a program that does all of this for you and keeps it hidden. All the "wargamer" wants, or all the GM wants, is to know where any given ship will be based on a movement plot, or where a ship will be given a movement plot - at any given time.

For example: suppose you take the time to determine how long it will take for a ship to travel to a point, and based on distance, will take the pilot/navigator of a ship, some 324 hours to reach that point. 324 hours at 1 G acceleration is roughly 972 turns! Who wants to plot each and every move one turn at a time? With this "program" that can be built - one enters in the plot: heading, acceleration and duration. The GM or whomever is using this software application can state "move clock from current time to time + 120 hours. Computer faithfully executes the plot as given, and moves time ahead 120 hours (or 360 turns). It calculates the current position and gives it as a simple (theta)/Distance pairing. No mess, no fuss.

Why is this valuable? With this program, you can now, because it keeps track of ship locations - keep track of missile locations because they follow the same rules as ship movement. You can also determine how far away ships are from each other at any given moment. Lets say for the sake of argument, that someone wanted to run a play by email wargame like game. The one ship is on patrol and is hunting for an enemy ship. The GM has specific rules that he uses for sensor operations, and can now keep one "team" in the dark and giving them only information that their sensors would give them. Two ships running picket duty could give away their position while using active sensors while the prey they seek remains more or less in quiet running mode by using passive sensors. If the player of the prey uses enough wits and is lucky enough that the predators do not spot him, he might slip past them using strictly the rules of the game set the GM is using.

Want to run a piracy hunting scenario? This "software" would let people do it. Want to run a wargame where raiders are slipping into a star system relatively unannounced, and begins to prey on civilian ships where ever it can find them? This will permit the GM to run it, and players to play it.

Now for the finer points in all of this. What I don't have finished as yet, are the rules for keeping track of planetary motion. If a planet's orbit is a perfect circle, this movement can be simulated VERY easily as a function of how many degrees per game turn a planet moves. As there are 360 degrees in a circle, and by definition, a planet moves one complete orbit in a precise time - divide the time by 20 minute turns, and that helps define how much of an arc is described by a planet's motion in one turn. But, as you might guess, orbital motion generally doesn't follow a perfect circle. So, what I needed, were formulas for describing the motion of a planet along an ellipse rather than circle. I also needed to find formulas that describe planetary motion according to orbital mechanics. To that end, I think I've finally found the formulas that will do the trick. They are located at:

http://www.braeunig.us/space/orbmech.htm

and

http://www.en.wikipedia.org/wiki/Ellipse

I'm not TOO good when it comes to using math in those areas. But it seems as though the problem given in the orbmech.htm site, fits precisely what I need. The explanation of the example problem for 1.11 and 1.12 at http://www.braeunig.us/space/problem.htm#1.11 seems to be what I need for predicting where a planet should be at any given time. The information on how to plot a location of an elipse in polar coordinates based on eccentricity of the ellipse seems to be what I need. If I have to, I will attempt to boil down the formulas from the orbital mechanics website and problem 1.11 and 1.12 for use with a spreadsheet until I can get the formulas in my spreadsheet to replicate the answer given in problems 1.11 & 1.12. Then, I'd use that spreadsheet to see if I can get the answer for a planetary body whose distances and radii and orbital mean velocity will be significantly higher than the values given in the example for 1.11 & 1.12 to see if I can use the methodology for my virtual mapboard. If so, fine, if not, back to the drawing board. Thing is? If some of you more adept mathematical and mentally more agile types can give me what I need in far less time than it would take for me to plod about getting it - my "project" can see fruition all that much sooner, and can be placed at the disposal of the Traveller fans.

And thus, ends my update on my project. One reason I took the time to work on this project was because this is one tool that I myself would have wanted for use in a double blind scenario of pirates verus pirate hunters. Too often, people at TML would debate the merits of either pro-piracy or anti-piracy aspects and one person would say "hypotehtically, based on these points, piracy is possible" only to have someone say "Well, based on these presumptions, they trump your presumptions, so there" and back and forth it would go without resolution. With something like this? Gm's can now set the stage, set the parameters, and let loose the hounds (rockets?) Of war and let the whole thing unfold strictly based on the rules or rule set he is using. Now, a GM can set in motion, combat between two opposing military forces (say, re-enacting the fifth frontier war scenarios) where one side is comprised of Player character naval officers and the other side are NPC officers (or if using a double blind game - one side of player characters fighting their ships against another team of player characters on the opposite side fighting THEIR ship). Want to debate the merits of how many escorts a Batron really needs? Use this system for it and watch how much fun it can be as two opposing batrons try to find each other in the dark in a parody of blind man's bluff. Now for the first time, smaller picket ships will become important as the one element long missing from Traveller games is reinstated - the issue of TOO much intelligence. Now, ships will need to fight tooth and nail for every ounce of information they can squeeze from their sensors - with some commanders making mistakes they otherwise wouldn't have made because of them having "tabletop perfect intelligence".
 
Oh, ahem, as far as the system goes, I'm affaid it's beyond me. I've long since forgotten trig (much to my disgust).

It'll need to be ecapsulated in software if I'm to make use of it.
 
Hi !

Hal, I would suggest to use a regular ellipse for the planetary orbital path and assume a constant angular velocity.
Thats a simplification but works well for most orbits.
Well, I used that method in my "System View" software and I guess its ok for gaming purpose.

Anyway, cool project ...


regards,

TE
 
Hi TheEngineer


if it turns out I can't get the formula to work regards to the orbital mechanics, I suspect that will be the work around that gets around that issue. It does seem to be a shame if I can't get it working.

I've put out a call for help in various locations - TML, CT-Starships, and of course here. I've even gone a step further and mentioned my "problem" to someone whom I think shows a lot of brainpower in their programming acumen. So now, if things work out as I hope, we can have a few people working in parallel and perhaps find the solution faster that way.

For what it is worth - I would rather see this project be successful and have someone else's name on it than for me to hog it and perhaps have it die with me. Someday - I hope that this tool will HELP people who debate the finer points of fleet tactics or the environment of piracy/anti-piracy efforts etc. Instinctively, the region between a planet and its nearby gas giant would appear to be a rich environment for pirates to ply their trade. In a war time environment, it would appear that disengagement from battle via acceleration would appear to be a viable option. Factor in what is involved with CT's rule set of requiring a set amount of hydrogen per week of power plant operation, and the game of cat and mouse becomes even more important. Sensor rules are truly the crux of ship to ship operations in a game where one can use the ENTIRE solar system as a playground. Now GM's won't be limited to a segment of the "play area" as bounded by the paper map on the table or a piece of graph paper. Large scale maps generally lose detail at the lower levels of resolution. Maps that have higher levels of resolution often aren't able to portray large areas of action. But a virtual map? Therein lies potential. I myself would LOVE to play in a double blind scenario. Failing that, I'd love to run one - and THAT program would let me do it
file_23.gif
 
Well, that's pretty cool for doing combat-related, sub-hunt-related stuff.

But (ah, did you know there was going to be a 'but'?) I figure piracy is axiomatic. And I participated on some of the TML piracy threads several years ago.
 
I'll send some code, Hal


Perhaps You could take over the complete system view stuff, combine it with the vector classes of the star combat simulation, expand the gui a bit and the project is finished.
(Consultant talking)

Really, your project is a combination of two separate things I already finished to a working state.
Maybe even a expansion/modification of the ship combat sim could perhaps do it (well, no planets here).
Has to be checked.
(Engineer speaking)

regards,

TE
 
Originally posted by robject:
Well, that's pretty cool for doing combat-related, sub-hunt-related stuff.

But (ah, did you know there was going to be a 'but'?) I figure piracy is axiomatic. And I participated on some of the TML piracy threads several years ago.
And, as a veteran of those "debates" you know what I mean when I state that those debates never had a unified dataset to work off of. Each time, each proponent (be they pro or anti piracy) would argue the merits based on their "hypotheticals" and each person trumping each other's hypotheticals without really addressing the issue. This way, if the situation is set forth in stone so to speak, then both the anti and pro piracy teams gets to do what they think will attain their specific goals. As I've commented in the past to those around me - wars are fought by two sides, both whom whom believe they can win. Almost invaribly, one of them will be wrong ;)

In this particular case, it is my hope that with a larger virtual "tabletop", where the 100 diameter boundaries for planets and stars will be known, where the gas giant positions will be known etc - we can finally approach some of these tactical and/or strategic discussions with some semblence of order and a foundation to build it upon. Otherwise, we will all have to agree that like arguing the merits of how many angels can dance on a pin-head, discussing tactics of the Traveller Universe is nothing more than mental masturbation ;)

I'd hate to see people here become reduced to that...
 
Originally posted by TheEngineer:
I'll send some code, Hal


Perhaps You could take over the complete system view stuff, combine it with the vector classes of the star combat simulation, expand the gui a bit and the project is finished.
(Consultant talking)

Really, your project is a combination of two separate things I already finished to a working state.
Maybe even a expansion/modification of the ship combat sim could perhaps do it (well, no planets here).
Has to be checked.
(Engineer speaking)

regards,

TE
Mi TE (and yes, I still remember your first name, but I'll refrain from using it publically),

Sounds good. The only thing I'm concerned about with an actual graphical representation is that if you show all of the ships at all times, the scale of the displace has to be relatively limited. If you show the scale of the ship in fine detail, you then won't be able to view the entire star system. So what I'd need in this case, would be something that can display in a columnar format, the locations of each ship along with its velocity vector. Since that really only needs two pairs of numbers, that won't be prohibitive. Actually, I take that back. There has to be a time stamp so that those numbers make sense


But just getting this to work strictly as a "text based" program/application would get the job done. Adding the graphics would be PURE GRAVY (and tasty at that!). I look forward to seeing what you've got. Do you still have my email address? If not, I'll dig up yours and contact you again. Until then, catch you later...

Hal
 
I also find this a really fascinating project.

Perhaps a columnar table with timestamp, coordinates display and velocity, as well as a 'selected/focus' option, so that any object can be the 'center' of the coord system, and distances listed from that 'focus' object to each other object in the system.

And re: piracy - it was always my pirate crew's tactic to 'dive' into the nearest gravity well, at just the angle for a 'ricochet'. The way the GM calculated it, it was possible to get away clean by high-tailing it and some nervewracking flying.

Neat problem, Hal!
 
TheEngineer,
Your system view prog was pretty cool!

Any chance of adding to it... ?

I have your Starship TestDrive and Nav Calc as well... If they could be combined into a total Traveller space sim....
 
One of the nice things of this approach (I know, I'm biased here) is that you can also do the following:

If you select that level of "grittiness", you can include the effects of the sun's gravity on the ship's motion. Thus, those diving towards the sun gain in speed, those who continue on past the sun begin to feel its tug. Also, you can determine whether a point is contained within the planet's sphere (collision checking) or even (assuming we can find rules or create an ad hoc rule) in the planet's atmosphere.

For now, concentrating on the planetary motions, ship motions, and missile motions will be enough. Adding in the ability to create "shortest path" navigation is easily enough done. How? If you can calculate the planet's position at any given time, you can use the formula T = 2*(D/A)^.5 to see where the planet and ship intersect at the same point based on ship's max acceleration. Having the program do this means the GM can say "Ok, if your character succeeds at his navigation roll, he plots the short distance plot" and because the GM KNOWS what that value is (for a change), he can use that information as a plot device.

One of the ideas I had was an "America Cup" style yacht race for use with Traveller. The idea being that now it becomes a matter of picking up navigational co-ordinates at a "bouy" (satelite broadcasts the data on a short ranged radio), navigate to the next "bouy", grab its information, jump to the next system (as designated by the second bouy) and navigate to the third bouy to pick up next point. The idea here is to turn this into a real race of piloting, navigation, and so forth. Failed piloting rolls induce a pilot error failing to maintain the plotted course correctly (say, 1% for each point the roll is failed by?) and so on...

But these are thoughts for later after the prototype is working, after I can (or some other kind hearted soul!) can get those blasted planetary orbital mechanics to work, or failing that, a reasonable facimile be made to work - and we can plot a planet's location using polar coordinates. And Micki? Glad to have you interested in this. Between you and The Engineer - I suspect that this project will be off to a great start
 
Well, if we do not need a special user interface and graphical output, a spreadsheet program would perhaps do the best job.
It would need a set of functions for vector calculations and another one for orbital movement.

Let see ....


TE
 
Engineer - I don't wanna duplicate your efforts, so here's an Excel suggestion for you...

...use Excel's 'conditional formatting' option to format the 'velocity' and 'distance' column cells with a color that varies as the velocity increases, or the distance decreases... so you could in essence have a guide to the objects' relative speeds and distances without even looking at the numbers.
 
Which version of Excel are you referring to Micki? I've got Excel from Office 97 - I suspect however, that this is not the one you're referencing ;)
 
Hi !

Just finished a sheet do show both calculations for orbital mechanics stuff and vector movement.
I will perhaps put it online tonight. I could attache this thing to a mail, too.

Anyway using an iterative way to figure out orbits is VERY simple.
Take these definitions:
GX/GY : primary center of gravity
X/Y: objects 2D coordinates
VX/VY: objects velocity vector
aS : acceleration directed to center of gravity
aX : x component of aS
aY : y component of aS
G: gravitational constant
mS : mass of the sun

So, what You do to calculate a somehow realistic orbit is:
- set initial location and velocity (X/Y, VX/VY)
- calculate distance SQR((X-GX)^2+(GY-Y)^2)
- calculate accelaration a = G x mS / distance^2
- split it up into vector components aX/aY
- for a given time increment dt calculate:
vX = vX + (dt*aX) and vY=vY+(dt*aY)
- based on the calculated velocity vX/vZ calculate the new location
X = X + (dt*vX) and Y = Y + (dt*vY)
- and do it again and again

In order to save processor time, you might calculate a orbit using that way during initialisation and store orbital positions in an array or so for later use.
But here you would need to find the parameters for a somehow stable orbit first (practically meaning, that objects position is nearly the same after one orbit).

Thats an approximative method which totally ignores disturbances by other bodies, but in fact calculation is just the same for n-body problems. The smaller dt is choosen, the better the results are.

You might test this in the spreadsheet


The perhaps well knows site http://www.burtleburtle.net/bob/physics/kempler.html present a java applet using similar methods but a bit more professional...

Ms. Mickazoid (name still reminds me of good old aracade game times).
Yep, the conditinal formating stuff is very cool and I already use that to the limit in my deckplan design spreadsheet.
Unfortunatelly Excel designers believed, that just three conditions are enough for the people in this world :(
Maybe this is enhanced sometimes....


Generally vector movement is just easy.
What perhaps is difficult to set up a logic, that the movement makes sense or is kind of optimized for its purpose.
So, for this part you really need a bit of code in the spreadsheet...

regards,

TE
 
Hi !

And the other part...
Somehow Hal's topic brought me back to the "tracking" problem.

Well, here's some code spitting out a new movement vector in order to track a target with a certain velocity and position.
You could just use it in a spreadsheet.

</font><blockquote>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
Function CalcDXY(v1x, v1y, v2x, v2y, dx, dy, a, t, mode) As Double

' v1x,v1y: "my" velocity vector (per t units of time)
' v2x,v2y: target velocity (per t units of time)
' dx,dy: relative target position
' a : accelaration
' t : time units
' mode : "x" returns new velocity x component
' "y" returns new velocity y component


If dx = 0 And dy = 0 Then
If mode = "x" Then CalcDXY = v1x
If mode = "y" Then CalcDXY = v1y
Else

' max distance in time unit
sMax = 0.5 * a * t ^ 2

' Distance
dist = Sqr(dx ^ 2 + dy ^ 2)

If dist < sMax Then sMax = dist

' normalized vector for distance adaption
dxn = dx / Sqr(dx ^ 2 + dy ^ 2)
dyn = dy / Sqr(dx ^ 2 + dy ^ 2)

' current v-component in target direction
SPvD = v1x * dx + v1y * dy
vdx = SPvD / Sqr(dx ^ 2 + dy ^ 2)
vdy = SPvD / Sqr(dx ^ 2 + dy ^ 2)

' length of v-component in target direction
B_vd = Sqr(vdx ^ 2 + vdy ^ 2)

' approx. time to reach target
If B_vd <> 0 Then
TDist = dist / B_vd
Else
TDist = 1000 ' a patch
End If

' vector for v-matching
vx = v2x - v1x
vy = v2y - v1y

' normalized vector for v-matching
vxn = vx / Sqr(vx ^ 2 + vy ^ 2)
vyn = vy / Sqr(vx ^ 2 + vy ^ 2)

' length of vector for v-matching
B_dv = Sqr(vx ^ 2 + vy ^ 2)

' time for v-vector adaption
tdv = B_dv / a

' distance adaption factor
pdDist = TDist / (TDist + tdv)

' velocity adaption factor
pDV = 1 - pdDist

' approximated future target position
future_dx = dx + TDist * (v2x - v1x) * 0.5
future_dy = dy + TDist * (v2y - v1y) * 0.5

' normalised target vector
future_dxn = future_dx / Sqr(future_dx ^ 2 + future_dy ^ 2)
future_dyn = future_dy / Sqr(future_dx ^ 2 + future_dy ^ 2)

' vector distance adaption
sdistx = pdDist * sMax * future_dxn
sdisty = pdDist * sMax * future_dyn

' vector veloctiy adaption
svx = pDV * sMax * vxn
svy = pDV * sMax * vyn

' total: old vector + new ones
neu_dx = v1x * t + sdistx + svx
neu_dy = v1y * t + sdisty + svy


If mode = "x" Then CalcDXY = neu_dx
If mode = "y" Then CalcDXY = neu_dy
End If
End Function</pre>[/QUOTE]Well, its not optimized yet, but it works.

The factor 0.5 in this line
future_dx = dx + TDist * (v2x - v1x) * 0.5
describes the relevance of the target future position calculation.
Large values speed up target approximation but usually cause "overswing" results, while lower values concentrate on actual target position.
Efficiency largely depends on the single situation and it needs perhaps a bit more logic to dynamically adapt this factor during tracking.

Hvae fun :9

TE
On target
 
Hey TE - glad to see you succeeding where I can't. If you've got an Excel sheet, can you pop it out my way in an email? And while you're at it, give me a primer on how you did it so I can try to teach myself why your spreadsheet works?


thanks,
Hal
 
Hi Hal !

Well, doing the spreadsheet is quite easy.
Set up a sheet with a columns for time increment (not abolute time!), objects x,y positions, objects x/y velocity, target x/y position, target x/y velocity and object max accelaration.
Thats all you need to feed the function shown above.
This function will return the next movement vector to make the object approximates the target.
So use these x/y values to calculate the new objects position in the next row.
Use targets velocity vector to calculate the new targets positions in the next row.
Then just copy the row content and its formulars down as far as you want (and the spreadsheet can).

You may add additional rows to also calculate e.g. distance to target, headings etc.

Remember, that the value of the time imcrement is important for the accuracy of the calculations, but still far less important, than for the orbital mechanics stuff.

Anyway I'll mail the actual experimental spreadsheet...


Regards,

TE
 
Back
Top