Register to reply

Contour maps, turn based gaming, and space travel

by ifnspifn
Tags: based, contour, gaming, maps, space, travel, turn
Share this thread:
Apr1-12, 02:09 PM
P: 2

I'm working on a 2D turn based space combat game, and I'd like to nail the mathematics of how a ship would truly move in space. Without going too much into my control scheme, here's the problem I'd like to solve:

"Given a ship at point (x_0, y_0), with initial velocity V, along with a fixed length of time, T, and a maximum amount of energy/thrust/fuel a player can spend during this turn (which lasts T seconds long), what is the function f(x, y) that describes how much fuel will remain should the player decide to go to point (x, y) this turn?"

Now, this may seem like an ambiguous question (and, I guess, it could be), but here are some other constraints:
-During this time interval T, only a single, constant force can be applied for the duration of T
-There are no external forces at play

Now, intuitively, I'd guess that the set of (x, y) points where f(x, y) = 0 would form an ellipse of some kind. This is backed up by some preliminary work I've done, but I'm pretty well lost at this point. Here's my attempt at solving the problem, thus far:

since x_f = x_0 + v_x * t + (1/2) * a * t^2, and likewise for the y component, I can say that:
a_x = (2/t^2) * (x_f - x_0 - v_x * t).
From this, I can find the magnitude of a:
||a|| = (2/t^2) * sqrt((x - (x_0 + v_x * t))^2 + (y - (y_0 + v_y * t))^2)
needed to bring the ship to some point (x, y) in time t. However, beyond this, I'm not sure how to model my function f(x,y) so as to draw where a player could go. Initial ideas have included creating some maximum amount of acceleration, A, that a player can use this turn, but that doesn't really make any physical sense. I've tried working in the Tsiolkovsky rocket equation (, but I don't quite know how. Any ideas?
Phys.Org News Partner Physics news on
Physicists unlock nature of high-temperature superconductivity
Serial time-encoded amplified microscopy for ultrafast imaging based on multi-wavelength laser
Measuring the smallest magnets: Physicists measured magnetic interactions between single electrons
Apr1-12, 04:04 PM
P: 11,597
Rocket mass m, exhaust velocity v and acceleration a give you [tex]\frac{dm}{dt}=m \frac{|a|}{v}[/tex]

With the approximation that the player burns only a small part of his current rocket mass during a turn, you can keep m constant. v is usually given by the type of rocket. Therefore, dm/dt is proportional to |a|. Usually, dm/dt is limited by the construction of your drive, which limits |a| for each turn.
Without this approximation, I think you'll need some integrals, as m and therefore dm/dt is changing over time.

Register to reply

Related Discussions
Two trains travel. Based on their leghths, mesure... Introductory Physics Homework 1
Partial derivatives of contour maps/level curves Calculus & Beyond Homework 2
Please set me straight about velocity based time travel Special & General Relativity 1
Time travel and space travel Special & General Relativity 9
Please explain equipotential surfaces/ contour maps Introductory Physics Homework 3