Picking Up Items, Pathfinding

Hey Folks! Hope everyone had a good weekend. A lot of family time for us due to the combo of Mother's Day and nice weather. Including the toddler's first tea party, and some quality time spent swamp-side listening to bullfrogs.

Back at the office, I resumed tackling the hull repair interaction, and trying to get AIs to seek out necessary items (patch kits) before attempting the repair. Today's screenshot shows Bo Powell in the kiosk area of the chargen station, and I've right-clicked one of the hull patch kits on the floor in the battery room on the right. (White and red squares with a yellow caution triangle on them.)

AI seems to be handling this now. I can make a hole in the hull, then select an AI, right click the hole, and choose "Patch." The AI will then contemplate a moment, walk over to the hull patch kits, pick one up, then bring it to the hole and patch it. In theory, a failure along the way should be graceful and push a message to the log to let the player know why. That'll require some more testing, though.

As a bonus, I can now make AI pick up items on the floor by using the context menu (as seen in today's screenshot). It's a special interaction that can be added to all items that can be picked up, which should prove useful in many ways down the line.

I did, however, run into a bug or two along the way. The big one I'm tackling right now is related to pathfinding. I've noticed that AI sometimes triggers an interaction while walking towards a target, instead of waiting until it gets there. And I'm unsure why.

At first, I thought it was because the AI gave up waiting too soon, but after fixing that, it's still happening. (Which makes sense, actually, since the item wouldn't know what specific interaction it was waiting for to trigger it in the first place.) So signs are pointing to the AI somehow thinking the walk phase is done before it really is.

I'll need to track that down tomorrow. But all in all, this is a pretty good step forward. A generic way to pick up items and equipment should be useful in their shipboard lives!

Comments

Rovlad's picture
Rovlad

Pathfinder, pathfinder, find me a path,
Mark it out right,
Don't screw up the math.
Try as you might, where there's stairs... failure's prone,
So find me a path,
Or we're boned.

dcfedor's picture
dcfedor

Ugh. I am not looking forward to implementing stairs/lifts. Flat spaceships for the win!

Dan Fedor - Founder, Blue Bottle Games

Rovlad's picture
Rovlad

Well, you kind of insisted on your ships using CO2/H2 as fuel instead of magic like in every other space game ever. Now it only makes sense to put those ginormous tanks + reactor on another level. :)
But yeah, having multiple Z-levels is a major pain in the ass development wise, pretty sure RimWorld dev is actively avoiding adding them, for example.

dcfedor's picture
dcfedor

I'm (perhaps naively) hoping that at some point in the future, I can just abstractly tack-on z-levels by making certain grid nodes connect to nodes on other floors the same way they currently do to adjacent ones.

But I realize there's a heap of other problems that come into play with z-levels, such as multi-floor objects, cross-floor line of sight and other area effects, etc. I'm sure I'll hate myself when the time comes :)

Dan Fedor - Founder, Blue Bottle Games