Captain Personalities, Fleet Control Update

Ship captains (and wing leaders) can now have their own personalities. What exactly is a personality, in game terms? I’m so glad you asked!

For now, we’re concerned with combat-related aspects, so a captain being greedy or corrupt isn’t important – although it will be once you assign him (or her) to run an outpost for you. A personality consists of two parts – an overall bravery rating, and a desire to perform certain types of assignments (if you haven’t yet, check out this post to see what those are).

The following baseline personalities are in the game now:

  • cowardly
  • cautious
  • steady
  • aggressive
  • suicidal
  • fearless

It’s better to think of these as character traits that will later be combined with non-combat traits to make up a complete personality.

So, what do these *really* do?

Bravery
A captain’s bravery affects the immediate combat performance of their ship. A cowardly captain will hang back unless his side greatly outnumbers the enemy – and will be extremely careful to avoid enemy fire. A fearless captain doesn’t care much about being outnumbered (never tell him the odds), and is willing to face down the guns of the biggest battleship in the Sector if that means performing his duty.

In gameplay testing, a brave captain does much better against tough odds than a cowardly one – they’re able to commit to a a particular maneuver and not interrupt it out of fear, which, ironically, often keeps them safer. However, if the odds are too stacked against them, a brave captain’s ship is almost certainly doomed.

A cautious captain is much more likely to keep their ship safe when the odds are bad, but isn’t as useful in an even fight – unless their ship is armed with long-range support weapons, which they can use effectively while feeling safe. A cautious captain is also quite good at harassment, as he won’t force the issue and can keep an enemy tied down in a game of cat and mouse for a long time.

Assignment Affinity
As the fleet commander, you give general assignments to your fleet. For example, you can order your fleet to assault a particular objective, form a carrier group behind your lines, and patrol an area for enemy presence. The ship captains themselves organize to carry these tasks out, and their personality plays an important role in who does what.

An aggressive captain scoffs at the idea of staying out of direct contact with the enemy. They’re likely to join assaults, capture objectives, perform strikes on enemy battleships – but not hang back wih fire support ships, escort a carrier deep in friendly territory, or (gasp) lead a civilian craft to safety. Suicidal ones will outright refuse to perform some of these duties, finding any excuse to attack the enemy.

Cautious and cowardly captains are naturally the opposite. They’ll look for any excuse to avoid joining a direct assault, and will prefer sitting back in support roles whenever possible – and even retreat against your orders, when it’s not.

Thus, knowing their personalities and managing the assignments you create is important to your fleet’s performance. For example, you might want to keep an overly aggressive captain from going off on their own and getting killed – but telling them to defend a location won’t do. Instead, you might assign them to more dangerous-sounding patrol duty… in a safe location. Read the rest of this entry »

Thoughts on AI, collision avoidance

If you’ve been keeping up with the ongoing patch notes, you probably know I’ve spent most of the last week re-working large parts of the ship AI.

A week ago, it was in a decidedly “if it ain’t broke, don’t fix it” state. In fact, it was quite good, except for a few dumb things it sometimes did. Still, Starfarer is a single-player game, so good AI is critically important, and these needed to be fixed. Armed with a list that I’ve been updating based on player feedback and my own experiences, I decided to devote a few days to eliminating them.

As an aside, making the AI not do dumb things is as important to the experience than making it do smart things, maybe more so. Seeing it do something ridiculous – such as repeatedly ramming a friendly ship in an attempt to escape some other danger – is immersion breaking. But if it tries to do something smart, you better make sure its plans actually come off, or it will look silly anyway – since as the player, you usually won’t know what smart thing it was trying to do, but will see it fail. The payoff for doing something smart is lower than the penalty for doing something inane.

It is wholly a matter of perspective, though. If your goal is to have the AI maneuver more strategically, you might state it as “avoid being surrounded” (negative – don’t be stupid!) or “keep enemy ships in one general direction from itself” (positive – do something smart!). Notice that the negative goal is easier to state – and if it’s easier to state, chances are it’s easier to approach when it comes time to implement it.

Incidentally, almost every new gameplay addition breaks the AI – either by making it easily abusable, or worse – so AI work is always going on behind the scenes to keep up with features.

Collision Avoidance
So, after fixing most of the items on my list, I realized that there was a big problem there wasn’t a quick solution to – collision avoidance. The algorithm I had implemented initially had some issues that could not be easily fixed. I know that, because I spent almost a whole day trying! It was time to toss it out and start fresh.

The main trouble with the old algorithm was that it wasn’t context-aware. Collision avoidance isn’t something you want to be doing all the time – generally, a ship is trying to do something else that’s actually useful, like attacking an enemy or getting out of danger – but then you also want it to not run into things while doing these. The old algorithm was an all-in proposition – if you were in danger of hitting something, it took over without regard for what the ship was trying to do at the time. Oftentimes, it would end up on the wrong side of a broadside as a result of successfully avoiding a minor asteroid.

The challenge was to come up with a collision algorithm that could incorporate current ship preferences into its response to potential collisions.

The first part, expressing ship preferences, was easy – the ship AI simply keeps track of which direction it wants to be going, and tells the collision avoidance module. For example, if it’s strafing around an enemy ship, it wants to go away from it if it’s too close, and towards it if it’s too far.

The hard part was coming up with an algorithm that could both be successful at avoiding collisions and could accept this preference as an input. Instead of talking about it in great detail, I recorded and annotated a video showing it in action first, with overlays that tell you what the AI is thinking at any given time. Seeing it will really help make sense the explanation that follows.

In the video, the blue line shows where the ship wants to go. The yellow line shows where the collision avoidance algorithm actually tells it to go. Green arcs show potential collision dangers. The arcs turn red when the danger is imminent and the ship is actively avoiding it.

Here’s a high-level breakdown of what the algorithm does (continued):

Read the rest of this entry »

“Turning the Tables” Mission Playthrough Video

Well, I finally beat the combat UI into reasonable shape, and was able to record a full playthrough of one of the earlier (and definitely easier) missions. The fleets are comparatively small, and so is the map, making for faster-paced action.

The mission briefing, to set the mood:

The independent prospector ISS Hamatsu is coming back from a tech mining expedition on a decivilized world. The haul is good, and the Hamatsu’s captain has retained a mercenary ship to provide protection en route to market at the Hegemony worlds.

It turns out the captain’s worries were justified. Coming out of hyperspace for a routine refueling stop in the Corvus system, the ships are attacked by a suspected Cult of Lud task force. The Ludii blame technology for humanty’s ills, and will do anything to prevent the Hamatsu and its high-tech cargo from reaching Hegemony space.

After a brief conference, the captains of the Hamatsu and the mercenary ISS Black Star conclude that a counterattack offers the best chance of success – retreat is not a viable option as the Hamatsu is running low on fuel.

The ISS Black Star is under your command.

This is the first look at a continuous slice of Starfarer gameplay. Enjoy!

Read the rest of this entry »

Starfarer Interview At Immortal Machines

Hey, everybody!

I just wanted to let you know that Immortal Machines has just interviewed our very own fearless leader Alex! Oh yes.

I certainly enjoyed the podcast, so should you. Why? I’m not going to say that top secret Starfarer details are revealed. No, no. But you will find out how Russia has affected the development team (the game designs us).  Have a listen, comrades.

P.S. Vegetables!

Celestial Spheres

The world of Starfarer has lovely 3d planets which roll beneath whatever chaos you are sure to wreak out in space. It is only right, for what good is space without planets to fight over?

Below: Flying an absurdly over-armed frigate past a jungle-covered planet.

Read the rest of this entry »

Forum Blog Media FAQ Features Digg it! Del.icio.us! Share this on Facebook Reddit Stumbleupon it! Technorati Tweet it! Download Starsector for Linux Download Starsector for Mac Download Starsector for Windows Preorder