Jump to content

Modeling 3D orbital movement on a 2D grid - Soliciting physics and programming advice


Accelerando

Recommended Posts

I'm designing a 2D grid-based video game that models orbital mechanics, and doing this alone is one of the most confounding parts. Part of the problem is that I don't understand how generalized ∆V maps work. Another part is how to model orbital combat maneuvers.

For creating the ∆V map system, I used the hexagrid-based ∆V map of the out-of-print Rocket Flight, by Phil Eklund, as my basis. A hexagrid seems the most generalizable to me, since it breaks down ∆V into tiles of a standard size which can be repeated indefinitely, and offers the most connection points between each tile.

Here is the map:

JKqAjkY.jpg

It seems simple enough. The map radiates out from the Sun, with Mercury, Earth, and Jupiter descending directly from an unseen Sun tile. However, I don't understand why any of the other bodies are placed where they are. Why is Venus a tile to the side? Why is Mars or any of the asteroids off to the sides?

I tried to rationalize it myself, but it always comes back to the hard math. Since Rocket Flight, its descendant High Frontier, and cousin Attack Vector seem to have done ∆V already, I don't want to re-invent everything.

Rocket Flight has the Zodiac, which appears to be like a compass. I don't know what their real significance is though, leading to my confusion about the position of solar system bodies. I guessed that they mean something like, with respect to the Sun:

• Up/down hex faces = Retrograde and Prograde

• Upper left/Lower right = Normal and Antinormal

• Upper right/Lower left = Out and In (from the Sun, like the RAD+/RAD- options on Mechjeb's Smart ASS)

At first glance this makes sense to me, since it covers all three dimensions. Yet under this system, using RF's standard units of ∆V, it takes 3km/s to transfer from a prograde orbit to a normal/polar orbit... at the bottom of the Sun's gravity well. That doesn't seem right.

Yet, at the same time, the Zodiac symbols appear to be used as directional indicators in RF's Tactical view of the Jovian system. See:

rTYqaki.jpg

That brings me to my other question, too. How can I create a tactical interface that offers players freedom to move and execute maneuvers while simulating orbital mechanics on some level?

Does it make sense to model combat using a ∆V grid, and if so, is that what Rocket Flight's system appears to be simulating? Or should I use something more like the distance-based grids of Triplanetary or Attack Vector?

And, finally, since I want to make this a video game, what would you advise in general to a very much newbie to game creation? I want to program this myself.

bonus: The Rocket Flight image album, pulled from Boardgamegeek.com

Edited by Accelerando
messed up the Tactical map link
Link to comment
Share on other sites

Well, I don't know the rules of Rocket-Flight, but from my general understanding of the matter, this map looks just like a simple 2D-cut through the ecliptic of the solar system, without any thought put into inclined planet orbits. For example look at the Lagrange points, L4 and L5 which lie in the plane of the earth's movement. Also, the star signs of the zodiac lie in the planetary plane, and i think in this context the star signs are just used as an North/South/East/West-analogue.

So my interpretation would be:

up-down: low solar orbit - high solar orbit

left-right: trailing or leading on orbit, relative to the planet in the same row of hexes

I think this is just a rather sketchy mapping of the dV-Problem, also because a physically realistic DeltaV-map for this many bodies (5 Planets and dozens of asteroids...), that gives correct DeltaV-values for all thinkable transfers cannot fit into a 2D-Plane.

And if you want to simulate combat, distances and relative velocities of your ships are important, which a DeltaV-map can't give you. Think of it this way: you expend the same dV as your enemy, you land on the same orbit as him, but you could be drifting 1km behind him or going on the opposite side of the planet/sun, which makes quite a difference...

Also, i don't think that in a simulation of interplanetary combat the third dimension (read: orbit inclination) would be very important, as nearly every point of interest lies within the plane of planetary movements, and the inclinations of planetary orbits are just some neglectable degrees.

But you've mentioned Triplanetary which has imho the best spaceship movement system ever (if you don't know the rules, read them and try the system, it's brilliant). In my eyes It's a newtonian physics simulation, boiled down to a level of granularity that you can fit the rules in five sentences and carry it out by hand. You get the distances and relative velocities simply from counting hexes, and you can even do gravity-slingshots. I've made my own modification of the solar system map that includes a large solar gravity well and produces large kepler-ish solar orbits for your spaceships without any major rules additions. The only thing it still needs are better combat mechanics than the vanilla ones. If you're interested let me know and i will post and explain the map.

Link to comment
Share on other sites

True, a ∆V map won't leave room for maneuvers, only showing the acceleration needed to get from here to there on a certain orbit at a certain time.

And, true, RF's ∆V map including L-Points suggests the map is basing direction on trailing or leading. Need a new system...

About the realism part of the ∆V map, would it work better if ∆V increments could be scaled? Like you can drag a slider that adjusts the increments of ∆V you want to see mapped out. So for larger increments like 3km/s, you might see Earth and Luna compressed into the same hex, and targeting that hex will drop down a menu of bodies to transfer to.

Triplanetary indeed looks good, giving a very intuitive feel for gravity assist and burn maneuvers, with gravity hexes tugging the ship around, and each unit of burn pushing the ship one hex in the specified direction, adding to the final velocity. I would love to see your map! And your explanation.

I disagree that 3D won't matter. Especially in the orbital space around planets and moons, won't the differences be pretty significant? KSC launches from nearly 30 degrees north of the equator, and Baikonur 45º.

Edited by Accelerando
Link to comment
Share on other sites

I assume that you already know triplanetary's map, but i will shortly recite the rules for other readers with my addition:

Triplanetary Movement Rules

The ship's positions in the former round and the running round are connected by a drawn vector arrow.

to predict the movement in the running turn:

1. the vector is copied and drawn again starting from the tip of the old arrow.

2. any gravity arrows the ship ran through in the round before move the tip of the new arrow by one field in the shown direction, where

a) Black arrows cannot be ignored and are cumulative

B) The small grey arrows cannot be ignored, but arrows from the same ring are not cumulative. If the ship ran throug several contradicting arrows, the captain may choose wich one to count

c) White arrows are totally optional and may be ignored.

3. The captain may expend one point of fuel to move the final position of the vector by one field.

part B) and the grey arrows were added by me to model the large scale gravitational force of the sun.

The part about ,,choosing your gravitational influence'' can be reasoned as small scale correction burns that fall below the granularity of the fuel system.

PNd7qZF.jpg

If you play around with it a bit (for example, just do the movements for a ship without using the engines), you see that it produces nice parabolic and seemingly elliptic trajectories. Of course the trajectories are not closed ellipses (like real kepler orbits), but in the most practical cases you do short arcing transfers from one planet to the next without doing full solar orbits anyway. And it reproduces important characteristics of the gravitational field, like ships that go faster when falling deeper into the gravity well, or if you don't have enough fuel you won't even reach the outer planets ... just imagine what you can do with assistance of your computer: large scale map, moving planets...

On the 3D:

it really is a question of whether you do interplanetary war (here i think it would just add loads of complexity without adding anything to gameplay or strategic options), or whether you stay close to one planet's orbit.

But there i don't see a system that does fit both scenarios equally well. Except if you go totally abstract and use some graph similar to this one (just more detailed, and with cross connections):

KerbinDeltaVMap.png

But here again distances and relative velocities don't play any role.

disclaimer: perhaps i should add that i was mainly thinking in terms of board games but that isn't necessarily bad when designing a video game :)

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...