Need to make foes attack an objectref

Post » Tue Jul 02, 2013 9:26 am

Okay, so here's the deal: I have a wall that gets placed by a player spell. The wall is designed to slow down foes, either by making them run around it or by smashing it down, segment by segment. To facilitate this, I am using immobile, invisible actors belonging to the player's faction as targets arrayed along the base of the wall on either side. If you'll forgive me some ascii art...

ooooooXXXXXX         o = actoroooooo         X = wall segment

So in the ideal situation, the wall gets placed, the actors get placed, and the enemy either runs around the wall or starts to attack the dummy actors. If they kill some of the actors, the wall collapses. The dummy actors also resolve another major problem, which is that enemies would get stuck running against the wall rather than around it; apparently the navmesh system isn't smart enough to handle dynamically placed obstacles, even if they're marked as dangerous.

The problems with this method are numerous. The actors bump each other around and wind up anywhere from the next cell to on top of the wall itself, despite being marked immobile. So I have to place the actors, disable their AI (otherwise TranslateTo will fail), then translate them to the right place. Unfortunately, if the enemy has already reached the wall, the translation of the dummy actors will sometimes fling the enemies sky-high or get them stuck in the wall itself, which leads to problem #2...

If the dummy actor (or any actor, really) gets "stuck" half-in/half-out of the wall geometry, or between two segments, the entire game slows to a crawl (we're talking <1 fps here) while the engine tries to sort out the problem. It'd be much simpler if I could just use a single larger actor and place it IN each segment, leaving part of its geometry exposed on both sides, but the engine totally chokes on this, so I have to use two small actors per segment.

I toyed with the idea of making the segments themselves actors, but in early testing using the segment NIF as the actor, I ran into a ton of problems like CTDs, and the wall segments getting knocked around by explosions (again, despite being marked as immobile).

So I'm stuck with this horribly inelegant, buggy solution. It does work most of the time, but most of the time isn't good enough. Here's what I'm hoping someone can help me with:

  1. I need a way to get foes to attack the wall if they can't reach the player.
  2. I need a way to keep foes from getting stuck running against the wall geometry, like clipping the navmesh around it.
  3. I need both of the above to be very reliable and preferably more elegant than the current method.

You can see the way AI treats the wall in this https://www.youtube.com/watch?v=UuCq95xLXUM&t=34s for it.

Notice even after the giant smashes the wall, he still gets hung on the corner of it for a moment. Although I've greatly improved the https://www.youtube.com/watch?v=dIFpiITmnp0 of the ice wall visual effect since that video, the dummy actor system hasn't changed a whit and I'm tired of it :P

Any ideas?

User avatar
Jennifer Munroe
 
Posts: 3411
Joined: Sun Aug 26, 2007 12:57 am

Return to V - Skyrim