## Thursday, April 1, 2010

### Across the solar system in a few short weeks!

Today I sat down and figured out the math for traveling across the solar system in a torch ship. The results are promising indeed. I'll try to keep the equations out of the main bit, posting that stuff further along.

If you'll recall my previous post on the subject, I'm building a board game that models an interstellar war taking place in our solar system. Right now I'm building a movement mechanic for the game; how long it takes ships to jet around the solar system. It's more difficult than just drawing lines on a board; I intend for the planets to move, and hence for the distances to change. Which means it might take you one turn to go from Mercury to Venus on a particular turn, but three at a later date. Neat, huh? So this is where I've got how to get the different times and whatnot worked out.

You can get the time it takes if you know the distance between the planets, and how fast the ships can accelerate. You can figure the distance between the planets from the law of cosines, which requires the distance from the planet to the sun and the angle between them. That I can get myself pretty easily.

Of course, we've got to ask the position of the planets too. knowing the distance from the sun and the time it takes for them to get around, you can work out how far they go in a given period of time and how much their angle changes.

I just got done setting up an excel spreadsheet with the data and formulas. By updating the turn number I can automatically calculate the time required to travel between planets. I can even vary this by changing the acceleration of the ship.

Which brings up a valid question: how fast should the ships accelerate?

Now, if you're running a luxury liner between planets, your ideal acceleration is going to be 1g. That is, the force of gravity at Earth's surface. It gives exactly the right weight so all the luxuries of Earth life work as they should; from bubbling champagne to toilets. Of course, I'm not really concerned with the creature comforts of my pieces, so I'm going to set the ship's acceleration based on what's best for the game.

Err... what is best for the game? As it turns out, one g doesn't work really well. At the speeds that lets you transverse the solar system, the planets barely move at all. Of course, that leads to the still further question: what rate do I want the planets to revolve at?

Ok, Ok, I'll start actually answering the questions. I figure the game will run in real time for one turn a week for about a year, and lacking anything better to base it off of, I figure one turn a week in game time ought to do it to. That means that Earth will revolve once every fifty two turns, Mercury will go around every twelve and a half turns and so forth. Backsolving, I find that I get a reasonable number of turns between planets if I make ships accelerate at one tenth g. Neat, huh?

So what kind of board does this result in? Well, it's always changing. It doesn't work much like a traditional board; the spaces between planets are dynamically generated each turn. Physically that means that I'll have to construct a board that I can change whenever I please. I'm thinking a sheet of black felt with some sort of velcro planets. Or something. I'll need a new photograph of the board each turn. Which I probably would want to provide anyway, what with moving pieces and all. Mechanically it also offers interesting results; Mercury goes around the sun every twelve and a half spaces. Half spaces? Madness. The hope is, of course, that the varying playing field will offer interesting strategic possibilities. If it doesn't do that much then all of this is an exercise in math, nothing more.

Another thing I'm free to choose is the starting locations of the planets. Imagine the solar system with the warp gate at the top. Just below it is Jupiter's orbit (remember I'm ignoring places beyond), then Mars and so forth. I can star the planets at any point in their orbits. Earth will rotate once by the end of the game, so I'm going to start it as close to the warp gate as I can get. That way it'll range outward at the start, but get closer and closer as the game draws to the end, hopefully fueling dramatic last battles. Mars starts around the bottom right corner, by the end of the game it'll have moved to the bottom left corner. Jupiter will subtend a small arc towards the top of the board. Not having to work with the entirety of their orbits means I can discard a lot of empty space, allowing the board to look a lot more like the golden ratio rectangle than a square. Venus will revolve one and a half times, Mercury four times by the game's end. I'm not sure where I want them to start and finish. Yet.

From here on out I'm talking about the physics. you've been warned.

A torch ship accelerates halfway, then decelerates the rest of the way. Since we're looking for time, we use the equation t=sqrt(2d/a), only we work for half the distance for the first part; t=sqrt(d/a). Multiply that by two and you get the time for a given distance and acceleration: t=2*sqrt(d/a)

The distance between two planets we can get from the law of cosines:
d^2=a^2+b^2-2ab*cos(angle)

Where the angle is the difference between the angle of each planet with some standard. Excel wants the angle in radians, which I'm completely fine with. I'm basing angles off of an imaginary line pointing east. (Think the usual map convention, the warp gate in the north, Mars starts in the east and rotates counterclockwise to the west.)

From the revolution period of the planets we can figure out the distance planets move in a single week, and hence the angle they subtend. With that weekly angular movement, and assuming that the distance to the sun stays constant, and with the starting position of the planets we can set up a formula that'll calculate their position and the distance between them (and therefore travel time) from the turn number alone.

Which really makes my job easier; I just have to translate the excel spreadsheet data to the map itself.

Now for the stuff that I'm not bothering to model:
1) There's a difference between starting and finishing velocity. Since the planets rotate at different rates, you have to take that into account when plotting your orbital course. The problem is, you make the change by accelerating or decelerating for slightly longer, and I don't know how to run the math to find the optimum switching point. I'm pretty sure I could figure it out given an hour with my mechanics book, but I don't feel like going to that trouble. Yet.

2) While I'm at it, Planet's aren't standing still waiting for you to arrive. They'll have traveled some distance in the meantime, which I'm not accounting for. I feel like I've forgotten so much physics...

2) As it turns out, I'm going to have to do a lot of rounding. Should be pretty obvious from the fact that none of these are going to come out exactly even. While I think I'm going to go with standard rounding (except that nothing will round to zero time traveled) I might want to deal with the different planet velocities; say if you're going the wrong way then it gets rounded up, otherwise rounded down.

3) None of this deals with getting around the sun; it assumes you can take a path straight through. How close we get to the sun is limited by the design of the spaceships. At some point I think I might deal with this; setting an arbitrary rule "you can't get closer to the sun than Mercury, go around". I don't think it'll change gameplay that much, although it might lead to headaches in the logistics department.

4) I'm arbitrarily setting planetary locations. Since we can predict the planet's locations, I guess I could come up with a start date that roughly matches my intended era with my intended starting configuration. Plus points for realism, minus points for difficulty. I really don't know how to go about figuring it, and my astronomy book has been lost longer than my mechanics book.

5) As I mentioned, I'm assuming the planets orbit in perfect circles. No way in hell am I going to do the math with ellipses.