endless-sky / endless-sky

Space exploration, trading, and combat game.
https://endless-sky.github.io/
GNU General Public License v3.0
5.69k stars 1.02k forks source link

Suggestion for autopilot's AI #2259

Closed Tadrix closed 6 years ago

Tadrix commented 7 years ago
  1. When ship has attained full speed, autopilot/AI should stop throttling. There's no need to do that anymore, especially when all this power could go to charge batteries and recharge shields, or, at least, when the ship could cool off instead of heating up.

  2. It's strange how ship still moves erratically when autopilot is engaged (by pressing [B], [L] or [J]), but I understand that it is part of current game mechanics and is meant to be this way. However, if autopilot is reliant on manpower and some crew stations are empty, then it should have some safety features built in, such as maximum speed it operates on. Usually, when landing, it tends to overshoot its target (b/c of not managing to turn around and brake in time) and then throttling again to unmanageable speeds. Eventually I learned to do everything manually in such conditions. What I propose: When ship is undermanned, autopilot, if engaged, sets its own recommended operating speed (which could be same part of ship's maximum speed as present/needed crew members) which it doesn't exceed, and, if exceeded, does its best to decelerate. After this it immediately begins to turn the ship around (if not already done) to prepare to brake. Of course, it would mostly still fail to stop on time, but it least it would look like it was programmed by engineers who accounted for various possibilities of space travel.

ReimeiSky commented 7 years ago

3 (as an addition). I'd like to note that if we attempt an impossible action relating to autopilot (e.g. pressing L to land in a system without a world, or pressing B to board in a system without disabled ships) and attempt to move around to back out of the nonexistent order, we get this:

Disengaging autopilot.

Wrzlprnft commented 7 years ago

i think we need to sort out what is donr by ingame autopilot and what is done by gameplay autopilot.

whismerhill commented 7 years ago

for 1) ok for 2) are you talking about when ships are undermanned ? Because the first sentence seems to imply that autopilot moves erratically in all conditions ???

Tadrix commented 7 years ago

@Wrzlprnft Trouble is, there's not much modern-day spaceship autopilots don't do: Docking to spaceships/stations: check Taking off and landing: check Flying the ship: check Crews are small and generally present to oversee the systems and be transported. I imagine auto-selecting ship to board and planet to land on is done by gameplay autopilot. Real one would require input on what to board and where to land, and operator would need to be careful enough to select something that is not a star or a gas giant.

@whismerhill The answer is yes.

Lorantine commented 7 years ago

@Tadrix you always seem to consider realism and neglect balance being undermanned is supposed to be a penalty, you could capture a ship, have 1 of your like 50 required crew left and jump several systems and land there without any trouble or penalty

Tadrix commented 7 years ago

@KiLEdEnNis Seems like you missed the point of my OP. In OP, the ship would still be jerky when undermanned, autopilot or no autopilot.

However, if autopilot is reliant on manpower and some crew stations are empty, then it should have some safety features built in, such as maximum speed it operates on.

This focuses on autopilot having optimal algorithm while still penalizing the player. Because, how it is now, autopilot is actually almost always worse than manual control, when logically it would be the other way around. If you go slowly, there's less chance to miss something even with mostly unresponsive controls. That someone gets more chances to blow you up would be a balancing disadvantage.

Lorantine commented 7 years ago

how autopilot would work: it's an autopilot; you, the pilot, player, and main character don't have to steer the ship none of your crew members help you steer, they keep the ship running because the ship can't do so itself irl autopilots have flaws as well, meaning that sometimes you're better off steering manually, so this doesn't bother me (although I do manually steer a lot, even last part for landing)

Tadrix commented 7 years ago

In real world aircraft you could have two pilots, a pair of flight engineers, navigator, radio operator, several loadmasters and gunners. Here are some examples: [1] [2] [3] [4]. Also, commander of the airplane, having other responsibilities as well, usually fills co-pilot role, and most of actual flying is done by the other pilot. But that all is beside the point.

jafdy commented 7 years ago

I would like to point out that it is very hard to optimise an algorithm to pilot a ship against the way Random works at the moment.

Lorantine commented 7 years ago

current planes and I think rockets have 1 actual pilot though, the co-pilot is mostly there in case something goes wrong you are describing a WWII B-17 and other old aircraft

Tadrix commented 7 years ago

@KiLEdEnNis Actually some of multi-crewed aircraft are still in use.

Space Shuttle had 7 crew members: 1 pilot, 3 payload specialists and 3 mission specialists. Early US space exploration crews had 2 members, and modern rockets which resupply ISS are unmanned (and probably resemble Earth Shapers), right… but do not forget about ground crew, mission control. All those people sitting in a large room next to computers? Yep, they are helping to operate the spacecraft. In ES we have far future and sophisticated automated systems, but we're also carrying some of these people along as our flight crew.

@jafdy If you're talking about undermanned ships, a question: Is it so hard to make AI cap its max speed and try to turn around the ship as soon as this speed is reached? This wouldn't account for actual random values (aside from calculating AI's speed: max_speed * current_crew / required_crew), just change the order of actions AI does.

jafdy commented 7 years ago

Yes, yes it is.

Lorantine commented 7 years ago

Actually some of multi-crewed aircraft are still in use

meaning that actually a huge amount of aircraft is not multi-crewed your thing about the space shuttles that 3 are payload specialists & 3 mission specialists is part of my point: the autopilot is an auto>pilot<, not an auto>payload specialist< or anything, meaning the autopilot still only takes the pilot's job over space flight ground crew would probably not be needed in 3014+, at most some bigger ships have like a navigator etc. but even w/o autopilot they don't have to non-stop work, usually if a pilot and his bridge crew have to wait they turn it on

Tadrix commented 7 years ago

Ok, now we are starting a discussion what hypothetical future would be like. I think this is for M.Z. to decide, as it is his world we are talking about. But just to highlight my point (yes, I'm trying to extrapolate from tech we know about): Tank crews:

Historically, crews have varied from just two members to a dozen. For example, pre–World War II French tanks were noted for having a two-man crew, in which the overworked commander had to load and fire the gun in addition to commanding the tank. First World War tanks were developed with immature technologies (..) as the single turret on a low hull design became standard, crews became standardized around a crew of four or five. In those tanks with a fifth crew member, usually three were located in the turret (as described above) while the fifth was most often seated in the hull next to the driver, and operated the hull machine gun in addition to acting as a co-driver or radio operator.

And from another source:

If the function of loading the main gun is handled by an autoloader (no current U.S. tank has an autoloader), then loading of the coaxial machine gun, as well as the stowage and care of ammunition, becomes the duty of the gunner. The absence of a loader also means the TC assumes a greater degree of responsibility for air and ATGM watch.

Here we see that while automation can be helpful, its use is still limited by human operator's ability to multitask.

Present-day naval ships still have huge crew complements for some reason. But these ships also are very large compared to any aircraft (which mirrors heavy ship categories in ES), and in them multiple crew members control movements (beside having three watches, so actual operators ×3 + spare ones).

Present-day spaceships are comparable to ES Interceptors or light ships. And, as we see, crew requirements are similar.

I actually like your reasoning that everything is automated and only captain is really needed, but if we were to propose such changes everyone would be against it, citing balance reasons. Required crew of 3 watches of 2 people + 1 per gun + 1 per turret mount (additional to turret's crew) in large ships and increased salaries would sound reasonable to me. But while we are stuck with large crew complements, it's more logical to presume they help to navigate and control the ship, manage damage control, do maintenance jobs, and generally oversee what computers are doing, ready to do manual overrides when necessary, and not just tag along taking up passenger space and draining money, and that autopilot systems actually need them (otherwise there would be no explanation for jerky movements while autopilot is engaged). I'm not wholly against "gameplay trumps realism" decisions, it's just that these should be justified in lore to avoid breaking player's immersion.

Since I feel we departed issue's topic to talk about reasonable crew sizes of fictional starships, and since these are not likely to change due to being a balancing device and part of original lore (I liked the thought of Republic gunboat having complement of two crew members though) we should return to what @Wrzlprnft suggested — to sort out what is done by in-game autopilot and what is done by game-play autopilot, to which I replied a day ago.

whismerhill commented 7 years ago

So, here's my point of view with undermanned ships: the way it works right now is simply for ambiance & to add some interesting gameplay elements : e.g. when undermanned you will not be relying on autopilot as much, and will control the ship yourself and struggle against the erratic controls.

I believe this is by design, and I like it as such. This is just my point of view. IF autopilot is able to compensate in all cases then it's an oversimplification that removes a gameplay element/feature.

sidenote/edit: I still agree with point 1 though

VonZorch commented 7 years ago

@Tadrix Navy ships have large crews for several reasons.

  1. There need to be at least 3 qualified watch standers for each watch station so that there will be time to rest. Then you have more who are under training.
  2. Damage control parties and replacements for battle casualties.
  3. Work parties for such things as loading supplies and ammunition.

Realistically, yes I know that's not really important here, light warships and all freighters and transports with tight crewing should be hit hard by low crew levels while medium and heavy warships should not really have a problem until crew loss approaches two thirds.

Lorantine commented 7 years ago

in-game you need crew to operate, not crew to standby and work in shifts capital Navy ships have a lot of crew because they are big & strong

Nechochwen-D commented 7 years ago

The current "pilotError" system could be easily re worked to allow for handling to still be impaired while not being quite so clunky.

Nechochwen-D commented 7 years ago

from Ship.cpp

if(pilotError)
        --pilotError;
else if(pilotOkay)
         --pilotOkay;
else if(isDisabled)
{
       // If the ship is disabled, don't show a warning message due to missing crew.
}
else if(requiredCrew && static_cast<int>(Random::Int(requiredCrew)) >= Crew())
{
        pilotError = 30;
        if(parent.lock() || !government->IsPlayer())
               Messages::Add(name + " is moving erratically because there are not enough crew to pilot it.");
        else
               Messages::Add("Your ship is moving erratically because you do not have enough crew to pilot it.");
}
else
        pilotOkay = 30;

// This ship is not landing or entering hyperspace. So, move it. If it is
// disabled, all it can do is slow down to a stop.
double mass = Mass();
if(isDisabled)
        velocity *= 1. - attributes.Get("drag") / mass;
else if(!pilotError)
       //continue with normal operation

I would also like to point out that one of the issues with the current system is that it does not even touch the AI at all. It merely decides whether or not it permits the engines and whatnot to fire.