Contour maps, turn based gaming, and space travel

Click For Summary
SUMMARY

This discussion focuses on the mathematical modeling of ship movement in a 2D turn-based space combat game. The primary problem is to determine the function f(x, y) that calculates remaining fuel based on initial position (x_0, y_0), initial velocity V, time T, and thrust constraints. The user proposes that the boundary where f(x, y) = 0 may form an elliptical shape, supported by preliminary calculations involving acceleration and displacement equations. The Tsiolkovsky rocket equation is also mentioned as a potential tool for refining the model, particularly in relation to changing rocket mass during thrust application.

PREREQUISITES
  • Understanding of kinematics, specifically equations of motion in two dimensions
  • Familiarity with the Tsiolkovsky rocket equation and its applications
  • Basic knowledge of calculus, particularly integrals and derivatives
  • Experience with physics simulations in game development
NEXT STEPS
  • Research the application of the Tsiolkovsky rocket equation in game physics
  • Explore numerical methods for solving differential equations related to changing mass
  • Learn about elliptical orbits and their mathematical properties in physics
  • Investigate existing game engines that implement realistic physics for space combat
USEFUL FOR

Game developers, particularly those focused on physics-based simulations in turn-based space combat games, and anyone interested in the mathematical modeling of movement in a zero-gravity environment.

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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 18 ·
Replies
18
Views
3K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 0 ·
Replies
0
Views
4K
Replies
26
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 36 ·
2
Replies
36
Views
5K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
9
Views
2K