Contour maps, turn based gaming, and space travel

AI Thread Summary
The discussion revolves around creating a mathematical model for ship movement in a 2D turn-based space combat game, focusing on how to calculate fuel consumption based on position and thrust. The user seeks to define a function f(x, y) that represents remaining fuel after moving to a target point (x, y) within a fixed time T, given initial velocity and thrust constraints. They propose that the points where fuel is depleted may form an elliptical shape, supported by preliminary calculations. The conversation includes attempts to incorporate the Tsiolkovsky rocket equation to account for changing mass and thrust, but the user struggles with integrating these concepts into a coherent model. Overall, the challenge lies in accurately modeling acceleration and fuel consumption under the game's specific mechanics.
ifnspifn
Messages
1
Reaction score
0
Hiya,

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 (http://en.wikipedia.org/wiki/Tsiolkovsky_rocket_equation), but I don't quite know how. Any ideas?
 
Physics news on Phys.org
Rocket mass m, exhaust velocity v and acceleration a give you \frac{dm}{dt}=m \frac{|a|}{v}

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.
 
Thread 'Question about pressure of a liquid'
I am looking at pressure in liquids and I am testing my idea. The vertical tube is 100m, the contraption is filled with water. The vertical tube is very thin(maybe 1mm^2 cross section). The area of the base is ~100m^2. Will he top half be launched in the air if suddenly it cracked?- assuming its light enough. I want to test my idea that if I had a thin long ruber tube that I lifted up, then the pressure at "red lines" will be high and that the $force = pressure * area$ would be massive...
I feel it should be solvable we just need to find a perfect pattern, and there will be a general pattern since the forces acting are based on a single function, so..... you can't actually say it is unsolvable right? Cause imaging 3 bodies actually existed somwhere in this universe then nature isn't gonna wait till we predict it! And yea I have checked in many places that tiny changes cause large changes so it becomes chaos........ but still I just can't accept that it is impossible to solve...

Similar threads

Back
Top