The Simulation Problem

(No, not this)

I’ve been struggling with this problem for a while now every time I sit down to start playing KSP. As you may know, I am a huge space enthusiast, and a stickler for realism when it comes to portraying space and science topics. Then, of course, I also like playing fun video games. So I’m fundamentally at war with myself when I ask myself: how much realism is enough?

The key here is not striving for realism, but making it feel realistic. This means simulating what I know, and glossing over that which I know nothing about. Yes, this is lame. Additionally, there are some things that take far too much effort to simulate realistically — engine physics, weather patterns, n-body gravitation, physiology.

This problem has been eating away at me enough that I haven’t actually been able to play KSP. I tried a variety of different play styles, but ultimately I got stuck on one problem: I wanted my rockets to be as small as possible, and to take the optimal ascent route.

As I began researching this problem, I realized it was not trivial. In fact, planning an ascent path is quite complex, and the equations have a large number of parameters. Another compounding factor was that there is really no good documentation on the internet about ascent patterns. I’m not sure if this is because that information falls under some sort of ITAR restriction, or just because nobody is interested in it. I wasn’t even sure how to start thinking about it. I knew there was something called a “pitch-over maneuver”, but how does it work? Do they pitch over at a constant rate starting at some altitude, or is a more complex function? Are there multiple pitch-over functions? I could find nothing that answered this.

The second problem was that it is not easy to simulate rocket ascents. You have to account for the curvature of the Earth, so it is not a ballistics problem but a set of differential equations in a polar coordinate system. I tried some basic solution in both Scilab (a free version of Matlab) and in Python, but in both cases the complexity of the problem became so great that I threw up my hands before reaching a satisfactory solution. I mean, it’s hard enough if you consider one stage, but once you consider that a rocket can have any number of stages, the design space spirals out of control.

The design feedback loop

This problem would not stop bothering me. Every time I sat down to play KSP, I realized I was sitting down into a self-imposed math nightmare. Then after that nightmare was solved, I would still be stuck with a inability to truly simulate all the aspects of spaceflight I wanted to simulate, at least not without a lot of work making my own mods.

The moral of the story is: don’t mix realism/math and videogames.

(There is another corollary problem, which is that Reality Is Unrealistic. We have these notions of how phenomenon look drilled into our heads by TV and movies, but the truth is often different and less COOL. Unfortunate that we have been trained to have that heuristic for coolness. TV Tropes says it best. An interesting example is Star Citizen, which shows the ship engines as firing all the time — even when they are off in the physical simulation — because it “looks cool”. Sigh.)

Burn

I’ve been aiming to make a post about this for a while. Here is one preliminary design document I made a while ago. It calls for something similar to the situation described in A Deepness in the Sky.

Game Beginning

You start out as a young man, fleeing a vicious civilization collapse. As the member of a wealthy Qeng Ho family and son of a fleet leader, you are in charge of the only ship that escaped. You are powered down in orbit of a gas giant, watching the aftermath of the Fall. A lot of your archives have been corrupted, so you need to find some other traders or find a world to raise up.

The very first thing you do is name your family branch. Then you figure out how to take inventory of your ship systems, and how to scan surrounding space. You learn about light-lag. You have just enough fuel to get up to operating velocity. You can choose a target system.

Your aim is to become the leader of the Qeng Ho. This is not an easy feat; the Qeng Ho is a diffuse trading race, with no clear organizational hierarchy. There are several trading “families”, each with large offshoot branches (e.g. Vinh 2.0.3). The objective is to gain enough influence, and then call a meeting of the Qeng Ho. At this meeting you either convince all the families to follow you, or perform a hostile takeover.

You have as many years as are in your life to do this. Note that if you meet a civilization with hyper-advanced medical technology, this means a time bonus. You do have cryo-freeze for the time in transit between stars.

Personal Mechanics

Throughout the game there are personalities on your ship and on other ships that you can talk with. What you say affects what they think of you. If they hear bad things about you from others, they will enter into relations with poor expectations. Reputation influences the trades you can get, as well as favors you can ask.

If you gain a high enough reputation and interact enough with a person, you may become friends. You are not notified whether or not they consider you a friend until you bring it up. Friends will vouch for you or join in on a plan. Friends are much more likely to answer a distress signal you put out.

Traders that are well known often have available profiles. When you trade for someone’s profile, you can see their reputation with others, their personality, and most of their history. By gaining enough reputation with a person, you can find out what they think of other people.

Interstellar Travel Mechanics

A Bussard ramjet is used to travel quickly between star systems. A ramjet can only go so far before the mechanism breaks down. A ramjet needs to move at a certain fraction of the speed of light in order to scoop up enough fuel to continue operating. While flying above that threshold, your fuel tanks fill up. When decelerating, accelerating, or maneuvering, you burn fuel without regaining any. It is only possible to accelerate up to 30% the speed of light; a lot of energy is spent accelerating floating interstellar hydrogen up to your speed.

Ramjet engines can not be repaired on the fly. In order to fully repair an engine, you need to trade with a civilization that has the requisite technological level. This means that you may have to raise a civilization to high-tech in order to continue flying.

If your engine breaks down mid-flight, you will very slowly lose speed (from colliding with interstellar particles), and continue to drift until you either exit the galaxy, crash into a star, or are picked up.

Note that different regions of space have different interstellar medium densities. For instance, our local cluster lies inside a relatively sparse region, making ramjets less feasible. One aspect of choosing a destination in the game is navigating around low-density “bubbles”.

Choosing your target is important. Since you can only hear transmissions from the past, you have to judge whether or not a civilization will be as advanced as you want it to be when you arrive. Flying to a system that is at a peak level of technological advancement will probably have collapsed by the time your fleet arrives. This just means you have to spend time (although you have cryogenics, you still usually come out of it every so many months to make sure the fleet is still on track) helping them get back up to a sufficient level to repair your fleet.

Trading Mechanics

Planetary civilizations rarely want materials. They can mine almost everything they need from their system, and the price of lugging raw materials across interstellar space is too high for you. The exception is high-tech equipment. Civilizations will pay dearly for technology that they either cannot physically manufacture (as with Beyond relics) or are nowhere near the technological sophistication needed to synthesize the tech.

Civilizations value information more than anything. A faction will pay a grand sum for anything that will let them dominate their opponents. Advanced secrets help advanced civilizations keep their expanding infrastructure under control. Usually you can broadcast such information ahead of you, as long as its encrypted. This gives the civilization warning that you are coming, and when you get there you can trade away the keys needed to decrypt the information (on this note, the Qeng Ho constantly broadcast a certain amount of information for free to make sure that civilizations they meet have similar measurement standards, language, etc.).

Conversely, traders have a huge store of knowledge, but lack the infrastructure or resources to maintain themselves. Spacefleets will often bargain limited pieces of technology in order to buy volatiles, fuel, and new equipment. Sometimes civilizations will provide these for free to weasel better deals from you.

Occasionally a civilization will become exceedingly advanced in one area of technology. They will invent something truly revolutionary. If you get your hands on one of these pieces of technology, you will have leverage over all other Traders. You may have to bargain hard to wrest the technology from the civilization at hand.

Combat Mechanics

Be warned. Consistent use of weapons will cause other traders to shun you and make civilizations bar you from their systems. Someone might even try to hunt you down if you destroy their civilization but leave even part of a defense fleet.

Space combat is a fickle subject to approach. It is best summed up by these two pages on Atomic Rockets, although every page there provides good insight.

Interplanetary Flight

This will probably be some sort of simplified KSP-like interface. That is, you initiate maneuvers to change orbit. The problem here is balancing technical details against flexibility and realism. Optimally, players should be able to identify their desire to conserve fuel against time constraints, and let the computer select the best orbital maneuvers to transfer between planets, space stations, Lagrange point colonies, etc. However, because players may want to do wonky things in orbit during a battle sequence (establish oblique orbits, do hard burns, etc.)

I guess you could distinguish between normal navigation and battles. Battles would probably happen around one central body, unless there was a moon involved. However, battles would probably happen really fast (over in minutes) or really slow (taking months).


And that’s as far as I got in describing it.