Discussion Solving the problems of space combat in Orbiter

I've been working on an orbiter combat framework for a while now;
http://escapetomsfate.webs.com/pages/ocf.html

All it does is fire a custom weapon class, and spawn a mesh on explosion. haven't really figured out how to make it actually explode on hit yet.

Try it with "Ray-Primitive-Intersection", it is a typical problem in computer graphics and you can get tons of example code for it.
 
The adding a new vessel to a running simulation is very fast if:1)There is already a vessel of the same class which preloaded its mesh and textures, 2) The vessel initialization is relatively short.

Dummy projectiles should have very little built in code besides collision detection, more advanced missiles should probably be preloaded onto hard points of vessels for realism anyways.

I think what I'm wondering about is the physics. If a vessel/projectile is spawned, are the current orbital parms applied to it? Will they be updated during its flight? If that's an automatic function of all polled existing vessel objects, then yeah, it should be pretty easy to generate spawn code. But it would have to a modification of the engine, wouldn't it? Or is this something that can be done with the API?
 
Try it with "Ray-Primitive-Intersection", it is a typical problem in computer graphics and you can get tons of example code for it.

I have this so far -

Code:
DLLCLBK void opcPreStep(double simt, double simdt, double mjd)
{
//Iterate through all Weapons.
    for(vector<Weapon>::iterator it=WeaponList.begin();it<WeaponList.end();++it) {
        for(int i=0;i<=oapiGetVesselCount()-1;i++) {
        //Weapon to vessel explosions.
        if(it->GetDist(oapiGetVesselInterface(oapiGetVesselByIndex(i)))<0.5){
            it->explode();
            }
            //Ground to vessel explosions.
        if(it->vessel->GetAltitude()<0.5) {
                it->explode();
            }
    }
        }
}

Where WeaponList is a vector of weapon classes.

That code just doesn't work. The weapon explodes whether it hits the ground or not.

I'll have a look at Ray primitive intersection. It could be useful for collision detection too. (I suppose that is what it is).
 
I think what I'm wondering about is the physics. If a vessel/projectile is spawned, are the current orbital parms applied to it? Will they be updated during its flight? If that's an automatic function of all polled existing vessel objects, then yeah, it should be pretty easy to generate spawn code. But it would have to a modification of the engine, wouldn't it? Or is this something that can be done with the API?
Yes, all vessels active in the simulation have correct physics applied to them.

I have a "gatling gun" sort of thing which spawns several "bullets" each second, and they're all properly physicsed.
 
I have this so far -

Where WeaponList is a vector of weapon classes.

That code just doesn't work. The weapon explodes whether it hits the ground or not.

I'll have a look at Ray primitive intersection. It could be useful for collision detection too. (I suppose that is what it is).

Yes, but your problem is, that you don't exclude the current vessel itself from the distance calculations. The distance between you and yourself is always 0. ;)
 
It'd be an interesting exercise to use Orbiter to attempt to predict how armed combat in outer space is likely to evolve. What technological hurdles would need to be cleared before Orbiter can be used to effectively simulate space combat, and then what form is that combat likely to take?

1.Spot the target, calculate trajectory.
2.Launch missile
3.Target is off the grid
That is for interception...
Target will not have enough fuel to evade missiles

For bombing it would be
1.Spend millions building a small base on an alien planet
2.Drop a big rock on it
3.Base is gone, everyone is dead, it is too expensive to build another one.

But the most important... who is your enemy? ET? MIB creatures?
 
Yes, but your problem is, that you don't exclude the current vessel itself from the distance calculations. The distance between you and yourself is always 0. ;)

Oh yeah.....:/

So something like this?
Code:
    if(oapiGetVesselByIndex(i)==it->objvessel) {} else {
        if(it->GetDist(oapiGetVesselInterface(oapiGetVesselByIndex(i)))<0.5){
            it->explode();
            }
 
1.Spot the target, calculate trajectory.
2.Launch missile
3.Target is off the grid
That is for interception...
Target will not have enough fuel to evade missiles

For bombing it would be
1.Spend millions building a small base on an alien planet
2.Drop a big rock on it
3.Base is gone, everyone is dead, it is too expensive to build another one.

But the most important... who is your enemy? ET? MIB creatures?
Of course they're anti missile defense and pushing that big rock out of the way so it doesn't fall on you but then everything just got a bit more complicated. :P
 
Oh yeah.....:/

So something like this?
Code:
    if(oapiGetVesselByIndex(i)==it->objvessel) {} else {
        if(it->GetDist(oapiGetVesselInterface(oapiGetVesselByIndex(i)))<0.5){
            it->explode();
            }

Try it better with:
Code:
if(oapiGetVesselByIndex(i)==it->objvessel)
      continue;

As you are inside a for-loop, you can use the continue keyword, to skip to the next iteration. Dijkstra would sure appreciate it.

---------- Post added at 10:44 PM ---------- Previous post was at 10:41 PM ----------

2.Drop a big rock on it

While you are busy to move the big rock, you might notice one day that the world has changed and the war is over.

A battle is over when the battleships arrive.
 
It still doesn't work. Does anyone know of any source code that I could look at?
 
Agreed, but energy weps bring up other questions. We're still talking about a lot of distance here and light energy, in any form, diminishes exponentially with distance. How much power do we need for such a weapon? It is going to need to have a looooong reach because of the orbital dynamics problem we're trying to overcome in the first place. How much mass will power generation require? Will the laser itself generate thrust that we have to worry about?

Beam diffraction could be minimized by increasing the size of focusing mirror and operating frequency of a laser. According to Atomic Rockets site effective combat ranges up to several dozen light seconds might be achievable with advanced but still somewhat realistic technology.

Regarding power requirements for such a laser to be worthwhile it would probably require perhaps 10 - 20 GW of electrical power generation and a huge capacitor bank. The whole assembly - power plant, capacitors, laser, cooling systems are likely to have a total mass of several thousand tons being a significant fraction of a whole vessel mass.

The warship itself are probably going to be the size and mass of a medium ocean going freighter.
 
Interesting.

in space , a simple 12 shotgun shell becomes a very destructive weapon if is fired in a opposite course in front of the target.

the future wars could be more a chess game than a star wars, with small orbit changes and trying to predict the enemy movements, and fire when is on range or the weapon , (missile, mine, fragmentation ammo,laser) can hit the spacecraft.

the first space weapon was launched by soviets but it failed , the polyus sat :lol:

polyus1.jpg
 
Taking a different view

One of the major draw backs to point-to-point combat in space is that it takes a very little delta V to turn a hit into a miss. Any course correction made against any form of missle or ballistic object would be fairly effective until the range is too short to dodge. By then the principle of MAD is brought into play. Militarily, Space is the high-ground. You can take pictures and drop things quite handily from it. Once the high-ground is taken, it will be hard to take. Any attacker will be working up a very steep hill, into most likely a lot of ballistic rocks and other nasties.

Stealth is an issue. Small and fast moving is hard to detect, especially if the thrower is patient enough. A pellet the size and consistency of a copper BB can do a goodly amount of damage if it hits. String a bunch along a path in orbit and its like a chaingun.

I believe that most battles will be one side outlasting the other in the race to get to the high ground and the victor will be the one who is able to take it. The most logical high ground for earth at this time is the moon. Lots of rocks to drop and a good veiw of a lot of the surface. The energy budget to hit earth is low and cheap. While hitting the moon will be hard. Not just to hit the moon, but to hit the right spot. It will be expensive and it will be in full view. The LaGrange points are not an option as there is no way to cheaply re-supply them. Combat will be on the ground once the ships arrive. Battle of attrition where even a nick can lead to depressurization and death.

All of this is what real space war is about. With today's tech, only a few tens of people can make it to the moon. They have to do everything right and watch their step always. Tossing in combat and life expectancy falls to zero for both sides. Trying to take the high gound in the geostationary orbits or lower is even more risky. Think about those BB's I mentione earler.

Automated vehicles will rule. Their complexity will grow as mankind teaches them to defend themselves. Physics still will apply, but the intrinsics of automation makes spacewarfare a more viable endeavor. In orbiter, you will could the beginings of the kernels that will drive these futuristic vehicles.
 
Well if you launch projectiles at Earth from the Moon its gonna take a little time for them to get all the way down. If its going fast enough maybe only a few hours. It will likely be detected ahead of time even if the exact target isn't known until very late. (impact time will be known)

Its tactical usefulness is dubious unless it can maneuver enough to hit a designated target in its last few minutes of 'flight'. In this case the default target will either be a less important static target or empty ground.

That's actually a strategy that is used with cruise missiles. Fly to an area, loiter until low fuel (impossible for the moon artillery), if not retargeted hit the original low priority target or some uninhabited mountain. (if retargeted it just kills the new target)

EDIT: Also, you might only be able to strike an area for a few hours once per day.
 
Its tactical usefulness is dubious unless it can maneuver enough to hit a designated target in its last few minutes of 'flight'. In this case the default target will either be a less important static target or empty ground.

Strategic targets like infrastructure, agricultural zones, industrial centers abound.

True, the best angle of attack is "straight down the throat" but a wide orbit with a large enough of a rock can cause an airburst similar to that of a nuke. With a chain of rocks, any ground target will be pulverized in time.

Think Strategic, not tactical for warfare like this. The ultimate outcome is what is desired, not what happens between. Thinking tactical in space with humans will cause the humans involved to be killed on both sides. It will be a war of attrition and decided on the "ground". Who ever has the most resources they are willing to throw away will win.

In short, I do not believe that realistic space battles will happen anytime in our near future (next 100 years or so).

As with the ancient mariners, sailing ships used to transport armies to a battle. Occasionally, they rammed and sank each other. In space, that will be fatal to both sides. The principle of MAD applies in close order space combat. If one side is close enough to hit, then it is close enough to be hit. A lot of 2 dimensional thinking is taking place. Some of you are looking at pointing your ship at a target and shooting. Ever hear of turret mounted weaponry?

This is why I believe any form of space warfare will be automated. Humans are too fragile to last long in this particular environment. Planning for strategic advantage and tactical numeric superiority with automated assets is what will win in a space war.
 
Well, you have to see where you want to end.

For a simple shoot-'em-up like space combat simulator, you don't need no politics, no economy. Only a "There is the enemy, and stop asking questions.".

If you want a limited amount of strategy, you need key resources. A factory, a station, maybe even just a orbital region with favorable properties.

If you want complex strategy, you need an economy, so you can have logistics (War is always won by logistics). You would have resupply chains, which would be new targets and require you as well to protect them.

For politics and their impact on strategy, you would need even more - politics are not always economic and usually not logical.

Also: Who says that humans are too fragile, should remember, that the cold hard fact, that human modern infantry in combat has only a life expectancy of 2 seconds.
 
For politics and their impact on strategy, you would need even more - politics are not always economic and usually not logical.
I used to think so, but I keep seeing Machiavelli's influence everywhere I look. It may seem illogical until you recognize a few less obvious factors.

Overall, I think you made a good point. Modern warfare is less about killing the other guy's eighteen year old kids than it is control of a populace. Whether it is threatening a populace into submission or trying to enforce law and keep the populace from being held hostage.

But whatever way you imagine space wars to be fought, reality will always be somewhat different; especially since adaption, deception and surprise are a big part of the Art of War. ;)
 
But whatever way you imagine space wars to be fought, reality will always be somewhat different; especially since adaption, deception and surprise are a big part of the Art of War. ;)
So it is said that if you know your enemies and know yourself, you will fight without danger in battles.
If you only know yourself, but not your opponent, you may win or may lose.
If you know neither yourself nor your enemy, you will always endanger yourself.

- Sun Tzu, The Art of War
 
Back
Top