The "in a solar system" part threw me off, and I thought you were going to have gravitational effects into account (e.g., potential wells and slingshot), which sounds like a really cool problem, but I wouldn't know where to begin. I was a bit disappointed that you don't deal with that at all.

I didn't go too in-depth with your solution, but if your aim is to simplify it to the point where it's an analytic solution, then you can just use a Hohmann interplanetary transfer orbit, right? Is this not similar to what you did? This paper explains it better than I ever could: http://ocw.mit.edu/c...07F09_Lec17.pdf

And yeah, like alvaro is implying, and as I'm sure you already know, it's a bit more complicated if you want to take a whole lot of bodies into consideration. It's no longer just "a couple of two-body problems stitched together". At best, it would likely mean having to correct your course due to the many minor perturbations that you undergo as you travel from one planet to the other. At worst, it would mean having to postpone launch or taking a highly inoptimal course to ensure that your ship won't run smack dab into some other planet halfway through the journey. Have fun with that. If you succeed, you should probably be working at NASA. ;)

The "in a solar system" part threw me off, and I thought you were going to have gravitational effects into account (e.g., potential wells and slingshot), which sounds like a really cool problem, but I wouldn't know where to begin. I was a bit disappointed that you don't deal with that at all.

Yes that would be a cool problem! It also sounds like it would be a "complete" solution to projecting trajectories for celestial travel, taking all bodies, their orbits and gravity effects into account. That however would require sophisticated numerical analysis algorithms and is far beyond what's "practical" for my game! That's a "NASA problem" as taby mentions. :-)

Note that the solution is about planning a trajectory in advance; the actual space travel simulation in the game does take gravitational effects into account. But in the game universe the spaceships have strong thrusters, usually providing between 1 and 10 g. That makes the planets' gravity effect almost negligable in practice. (At the altitude of geostationary satellites for example, the earth's gravity is only about 1/36 g.)

As I mention in the article, the trajectory needs to be recomputed regularly to take the destination's velocity changes into account. This also compensates for any gravitational perturbations the travelling spaceship undergoes, as long as it doesn't directly collide with something!

I didn't go too in-depth with your solution, but if your aim is to simplify it to the point where it's an analytic solution, then you can just use a Hohmann interplanetary transfer orbit, right? Is this not similar to what you did? This paper explains it better than I ever could: http://ocw.mit.edu/c...07F09_Lec17.pdf

And yeah, like alvaro is implying, and as I'm sure you already know, it's a bit more complicated if you want to take a whole lot of bodies into consideration. It's no longer just "a couple of two-body problems stitched together". At best, it would likely mean having to correct your course due to the many minor perturbations that you undergo as you travel from one planet to the other. At worst, it would mean having to postpone launch or taking a highly inoptimal course to ensure that your ship won't run smack dab into some other planet halfway through the journey. Have fun with that. If you succeed, you should probably be working at NASA. ;)

Thanks for the link, it's an interesting article! However it seems to deal with the specific case of orbit transfer and has energy conservation as an aim. I needed to develop a solution for the general case, including being able to chase other ships! ;-)

They were launching craft 50 years ago and doing the math. The computing power I have in my toaster is probably 1000 times what NASA had then. It'd still be a bit of a project to read up the academic papers and figure out how to approach the problem. But even a completely naive implementation would probably run more than fast enough. Especially if it's an autopilot feature for a proper simulation type game, there's nothing wrong with a "plotting autopilot course" wait dialog of a second or two.

They were launching craft 50 years ago and doing the math. The computing power I have in my toaster is probably 1000 times what NASA had then. It'd still be a bit of a project to read up the academic papers and figure out how to approach the problem. But even a completely naive implementation would probably run more than fast enough. Especially if it's an autopilot feature for a proper simulation type game, there's nothing wrong with a "plotting autopilot course" wait dialog of a second or two.

It was a bit of a joke. I honestly believed him when he said that he already had a working solution, and I honestly didn't bother reading his web site beyond the first two paragraphs, and perhaps that was my problem. My first reply assumed he was doing something simple, like a Hohmann transfer. After alvaro posted a more realistic answer, I realized otherwise. Still, I didn't bother to read the guy's web site, and perhaps that was my problem yet again. Anyway, please consider that it took me more than 2 minutes to write my first reply, and even longer to edit it to reflect the new knowledge.

The key word that I was going on was optimal, and the link to the book that I posted seems to be for fairly new theory (~20 years ago, for JAXA and NASA missions). Perhaps I made a mistake when I assumed -- using my new knowledge -- that what he meant by optimal was optimal fuel usage in a chaotic environment, perhaps not. In any case, plotting a course with optimal fuel usage in a chaotic environment requires a bit more than just naivety, as the 220 page count of that book goes to show. Outside of the bounds of chaos (ie. a couple of two-body problems stitched together, such as the Hohmann transfer) where things are reasonably predictable in the long term, yes, calculating ahead to see where the target will be at later is not exactly rocket surgery. Outside of the bounds of optimality and determinism/chaos, where fuel is infinite and/or enemies are unpredictable even in the short term, yes, AI for chasing and evading is most definitely nothing remotely close to rocket surgery. ;)

Thanks for the input either way. I really did learn a ton of stuff from you, and I rated you up for it (yeah, thanks for those Intel fluid simulation links too). ;)

Is it possible to phrase the problem in a way so that we can find the solution numerically, using only some sort of an error function?

Yes. You can solve the problem numerically by value iteration, if you describe it as the optimization of the sum of future values of a utility function, with some exponential discount as you go further into the future. You will also need to quantize the space of states somehow to make this work.

I've thought of trying to write precisely what I just described, but I never found the time.

I don't have a good reference to value iteration. It is described on the second volume of this book, but the book is expensive and not particularly readable, so I won't recommend it. If anyone finds a good online reference, please post it.