Jump to content

HarvestAI (the 'I' is a real stretch)


Sandworm

Recommended Posts

One of the first things a player is likely to do is build a small mining ship and hand it over to a captain. The amount of time the player spends designing this ship will be directly proportional to the amount of disappointment they feel watching their ship flounder around trying to accomplish what they believe to be a simple task.

 

To solve 90% of likely ship layouts:

Point the front of the ship at the center of the asteroid, move into range, fire lasers.  The concept is simple, the math is simple, yet we still have ships that look like they're piloted by drunks, and at this point I'm pretty sure alcohol is a contributing factor.

 

What about the other 10% of layouts:

Orientation Blocks. Blocks that can 'point' in one of six cardinal directions. Turrets on these blocks can be assumed to fire in the relative direction of said block and the 'AI' can go about aligning the ship so that those blocks are 'pointing' at the target. If the target is an asteroid, the code can search for orientation blocks with mining lasers on them, salvage can search for orientation blocks with salvaging lasers, absent any blocks for the love of god use the 'front' of the ship for alignment to point at target.

Link to comment
Share on other sites

  • Boxelware Team

Hi Sandworm!

 

We could have made the harvest ai to only work for ships that are specifically tailored to it and have turrets only at the front but this was not our goal. Players love to design their own ships and turrets are part of the design. That's why we wanted the ai to be more general.

 

Additionally, turrets built on the front-facing side don't work so well because of how turrets' rotational axes are set up. And having them on the side right next to the front might cause dead angles when the target is too close and the turret can't reach it because it is already pointing fully "down".

 

So in this case maneuvers to move turrets out of their blind spot are required. Having the ai come in a bit sideways makes it possible to do this by simply rolling which also doesn't interfere with navigation and pathfinding.

Link to comment
Share on other sites

Hi Sandworm!

 

We could have made the harvest ai to only work for ships that are specifically tailored to it and have turrets only at the front but this was not our goal. Players love to design their own ships and turrets are part of the design. That's why we wanted the ai to be more general.

 

Additionally, turrets built on the front-facing side don't work so well because of how turrets' rotational axes are set up. And having them on the side right next to the front might cause dead angles when the target is too close and the turret can't reach it because it is already pointing fully "down".

 

So in this case maneuvers to move turrets out of their blind spot are required. Having the ai come in a bit sideways makes it possible to do this by simply rolling which also doesn't interfere with navigation and pathfinding.

 

Hi Qui_Sum,

 

Before I start, I want to make sure we're on the same page. In my message I refer to 'front-facing' turrets, this is different from 'turrets on the front-face'. Mine would be sitting on the top/bottom/'left/right'side of a block that's towards the front of the ship, not ON the front 'face' of a block. I also want to emphasize that I'm talking about starter ships with 2-3 mining lasers not a ship with 20 mining lasers facing every direction/top and bottom where I imagine even the dumbest ai could randomly accidentally point the ship in a suitable direction.

 

While I appreciate that 'players love to design their own ships', a quick look at the workshop shows that 99.9% of all ships have a 'front' direction. Watch any video of players mining, and you will see them point straight at an asteroid, boost into range, stop and then start mining - only moving a little bit to get in range of the back side of the asteroid. I ask only that the AI use the same common sense.

 

I don't think I'm being unreasonable here when I say people expect a ship to mine when they tell it to, not dance all around the asteroid occasionally firing mining lasers into empty space for an hour. I think anyone who has actually played this game can attest to the fact that *where ever* you place your turrets, your captain will find a way to point the ship in the exact opposite direction needed and sit there dumbfounded rotating on the wrong axis while you debate alt-f4'ing.

 

Again, I'd like to stress the 'I' in AI. Would it not be 'intelligent' for the AI to consider that the front 'area' of the ship has turrets facing 'forward' and at least try to mine from a head on position and then try doing it's weird little dance around the object if that didn't work?

 

I've got nothing against figuring out what works, but that would require a state where it actually does work, and I've yet to see anything from the AI to suggest that there is an optimal way to place turrets. Or should I say, I've yet to see the AI behave in a reasonable human like manner.

 

Maybe I can put it another way: when I ask a ship to mine and it behaves so erratically trying to accomplish that task, I don't think to myself 'hey maybe the developers want me to design my ship differently' - no, I think to myself the design is perfectly rational/normal and yet for some reason it can't accomplish this basic task, something must be broken.

 

Anyways, thanks for reading - I hope there is a compromise to be had somewhere.

Link to comment
Share on other sites

  • Boxelware Team

Thank you for your explanation.

 

The ship never really coming to a stop is related to an issue with pathfinding. Currently ships overshoot their waypoint and then turn around to get back. This interferes with the harvest ai, because turrets can't turn fast enough to compensate the ship's rotation.

 

We are working on a fix. Let's continue this discussion when the fix is out  :)

 

Mounting the turrets the way you describe and flying straight to the target has the dead angle issue I mentioned for larger ships.

Link to comment
Share on other sites

  • 3 months later...

If I may make another suggestion, now that I've seen the developer response.

 

To me, the most logical way to approach a harvesting AI, is to have the AI check the available firing arcs of all applicable harvesting turrets fitted to the ship, and maneuver the target asteroid into range of as many of those arcs as possible.  Then sit still, and shoot the target.  Only minor adjustments may be necessary, if pieces of the asteroid or wreck drift out of range.

Harvesting does not need to be dancing around at all.  The targets are mostly stationary (admittedly, wrecks may be moving, so that may need a different approach for salvaging), so there is no need to move around once the target has been brought into range of as many firing arcs as possible.  This strategy is suitable for ships of virtually any design, wherever turrets have been placed.

The same mostly goes for salvaging, except that if the wreck is in motion, then it may need to match the trajectory of the target wreck.

 

From what I've seen, the harvesting AI does manage applicable fighters perfectly fine.  Good job on that.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...