Weekly Update #131: AI and flight model experiments

Hey everybody ! We’re just back from our end-of-year vacation and wish you a happy new year. As you can imagine, development has slowed down in the past 2 weeks, but I started to work on a bunch of experimental changes that were on the todo list for a while.

AI improvements

The interception algorithm was redesigned. The old algorithm wasn’t anticipating well enough where a moving target would lead and lagged behind. The new algorithm takes that into account. You can see the difference in the following picture ( click to zoom in ); the red object is moving from top-right to top-left with a constant velocity, and the green object starting on the bottom right tries to intercept it. As you can see, the new algorithm immediately leads towards the future position of the red object and intercepts it twice as fast as the old algorithm…

The interception code is currently in use in various systems, so all of these will benefit from the improvement: bots AI, flight assist ( formation modes ) and missiles/torpedoes.

On the topic of AI improvements, I’m currently working on rewriting the bots AI. Battles ( especially the large ones involving 100+ targets ) are too chaotic. Now, chaos in battles is somewhat expected and desirable, but our AI code basically ignored any teammate. The new AI will take teammates positionning into account. For this, I took inspiration from “boids” algorithms. If you don’t know what a “boid” is, just google the term and look videos for “flocking simulations”. Here’s a video where you can easily see what it looks like:

Those algorithms are used to recreate the natural behavior of animals ( or fishes underwater ) flying together as a crowd from a set of very simply physical rules.

My goal is to have battles form structures: ships flying together, in formation and covering for each other, and only breaking formation during dogfights with a specific target. Then regrouping after the fight is over. The result is that we should see “clumps” ot ships flying together much more frequently.

Another important change that I’m working on is having a clear start / end to battles; At the moment, battles randomly start all over the world without any clear indication on what’s happening. In the next update, the AI commander will accumulate credits on a per-location basis, instead of a global pool, and schedule fleet battles accordingly once a credits pool for a given strategical insllation target is reached. Once scheduled, a timer will appear, letting all the players know that a battle will start at location X in 5 minutes. The AI will also stop reinforcing once credits are exhausted, resulting in a clear loss for a side after a while. If I have time, I also want to give the ability to bots to attack enemy structures… which as you can imagine, will cut down the match duration by a lot.

Flight model experiments

The next patch will also introduce a bunch of very experimental changes related to the flight model and weapons range. Before Christmas I tried to reduce ships accelerations by half, but didn’t like the result ( it felt like there wasn’t enough difference in acceleration power between some ships ). I settled on a reduction of ~20% for the interceptor, ~15% for the bomber and ~10% for the corvette, and no change for the capital ships, as a starting point for the new patch. I also reduced accordingly some of the weapons projectile speeds, and introduced a “soft” cap speed for all the ships ( basically, the target / throttle maximum speed cannot exceed 10 seconds of acceleration. This makes more sense than a bar that goes up to 50 km/s, which nobody used ). Note that you can still go over the cap temporarily by manually accelerating.

There is still a lot of work to do for the next patch, so I’m not sure when it’ll be released, but we’ll probably have a better idea next week.

29 Likes

The AI stuff is really exciting, i can imagine the huge numbers of AI swarming like bees already… glorious.

Perfect missile interception AI might not be possible to evade manually while also giving the missile good accel/turning ability… could be a concern. It might also be worth it to keep both interception modes around for use in different AI skill levels, maybe even blend between them to get more “tiers” but im not sure.

10 Likes

I hope you had a good holiday!

@mattk50 I agree that it should be possible to evade missiles but I think that should be due to the physical limitations of the missile’s manoeuvrability, rather than due to poor interception algorithm.

11 Likes

Great post and thanks for the AI insight!! Very interesting!

11 Likes

Niiiice! :slight_smile:

If it achieves this, I wonder if it could feed into a player’s flight guidance to encourage them to form up with teammates (AI or real)?

Say you select a particular squadron of AI ships to join, your HUD could indicate the best space in the formation for you. Then you could follow manually or with autopilot, breaking off for combat, but ideally being able to spot and rejoin the formation.

Extend this even further and maybe you earn some AI wingmen that fly in formation with you and protect you/attack your target…

If this works, it will provide some really nice gameplay, as fighters in real life rarely work alone. Having some formation and wingmen mechanics could really make things interesting, particularly for lone players.

11 Likes

The problem with that line of thinking is that if a missile has more acceleration and turning than your ship (and it almost certainly will) then you cannot manually evade a perfect interception algorithm in newtonian space. You could limit the lifetime of the missile, but then it just reduces the range of the unavoidable hit, which isnt really much of an improvement especially when it’s nice that missiles fill a long range, large relative velocity combat role as it stands. An interesting option would be making it easier to manually shoot them down, but just adding more countermeasures would be kind of boring for both sides. If the player needs to evade, the shooting player can use it as a distraction which is gameplay for both sides.

I did think missiles were too easy to evade in the interceptor but maybe the accel changes would have been enough to change that, just voicing potential pitfalls as usual. I have no idea how close to perfect the new algorithm is.

9 Likes

Maybe use both algos and just switch to the good one when the range gets really close(and switch back if it slips out of this range), that way if you manage to keep the missile out of it’s peak homing range you can manually evade it.

6 Likes

I think that new interception code will enhance the long range usabilty of rockets, reduce frustration for the attacker and will probably make it a little bit harder to evade the rocket close range.
That last bit has to be countered in a fun or challenging way.

On the defender side that would be:

  • Optimising countermeasure usage and tactics. I can’t add much to that because I don’t have beta access.
  • As you said manually shooting down missiles
  • Which reminds me that this could be good cap ship gameplay like in Starlancers Big battles (–> 19 year old game video)
    Not sure if such combat can be recreated in a none scripted enviroment.
    You have to force the attacker somehow to launch the big ones only over longer distances and the interceptor pilots need a dedicated “target nearest torpedo” hotkey.

On the attacker side you could enforce the following gameplay:

  • Missiles don’t have their own guidance. The attacker needs to face the target until the missile hits.
    Can prevent missile spamming and kill stealing because you have to focus on one target
  • Missiles have a very narrow seeking cone and will loose lock if the target is not straight ahead
    Forces the missile to be only usable in long range or jousting combat - which makes it easier to shoot it down.
  • Laser guided torpedos - teamplay missile for cap ship and installation bombing - cap ship fires big missile - interceptor has to home it in onto the target.
6 Likes

It would be nice if we could see notable missile trajectories on the HUD as dashed 3D lines. The ones locked or locking onto target as green, and the ones locked onto player’s ship as red. Only hostile missile trajectories that are dangerous, trajectory aligns with target, should be shown, not all of them. My missiles often miss as I have no idea of what their trajectory is going to be. All I can do is match velocity with target and hope for the best. Missing a torpedo launched at a capital hurts as there is only 6 of them on a bomber.

Oh my this necromancer thread!

They follow the new interception code for sure. They take a very direct path to the locked on target. But they do not have nearly enough acceleration / deceleration to instantly change flight paths. So you can very easily power to engines and boost sidestep decelerate to dodge them. In an interceptor at least. Not really a corvette, and maybe a bomber?

Not to mention using countermeasures (More or less flares) causes them to change path into the direction of the countermeasure (Shot directly ‘behind’ the ship.) and they explode if they ‘hit’ the flare. Otherwise they just fly past and do some weird spins until they reacquire the target 10 years later and suddenly hit me in the butt.

2 months is still a fully fleshed zombie. :stuck_out_tongue:

I’m posting here, because Flavien seems to have a prototype for trajectory projection created here and could be ported to the game itself.


Locking a missile only means that it will track the target. But it does not take velocities of the the target or the launcher in mind. So it is very easy to overshoot. I want the trajectories to be visible. It would also make it easier to slingshot them while behind an obstacle.

I do not consider a hit on a countermeasure a miss. Though I feel the countermeasures last too long. With a bomber, there is a way to avoid it, by first firing a torpedo, switch to the other missiles and shoot them with a notable delay, making the target use their countermeasures on the least lethal warheads.

I honestly don’t even know if that’s possible right now, but if so then I agree. Trajectory paths displayed is a great idea either way.

As to firing missile. You only need 1 missile to hit ti kill an interceptor. So I have tendency of firing 1 ever 5 seconds. That’s about how long a flare lasts IIRC. Otherwise your method works as well. Just remember people can spam countermeasures so long as they have it.

Aah yes, I won’t forget that, sneaky, trick.

It works alright, I was the victim, caught me completely off-guard. (Not that catching me off-guard is hard to do in general.) But the “sling-shot” works.

2 Likes