Collision bugs?

Discuss Artificial Intelligence and Bot programming.
Post Reply
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Collision bugs?

Post by blubswillrule »

I'm trying to get zombies to climb walls in Nazi Zombies Portable, but for some reason they won't detect collision.

I'm using setorigin to move them up a bit every frame if the conditions are right and they are touching a certain brush, but I've added a trigger at the top of the wall to climb, which should make them stop climbing a wall, yet they keep flying up, why would the zombie not detect this trigger, but detect the first one?

The basic code is...

The triggers have collision detection.

If they hit a zombie, the climb trigger set the zombie's .climb variable to true

This is the part that doesn't work...
The stop climbing variable should set the zombie's .climb to false, so the zombie would stop climbing, but for some reason it doesn't even detect that it's hitting it, when it should.

Zombies part of the AI, if climb is TRUE, setorigin(self,self.origin + '0 0 8');
ran every frame ^^^

My guess is it has something to with setorigin.

previously I had just changed the origin
(eg self.origin = self.origin + 10;)

but that produced the weird result of the zombie flying up, yet it's bounding box would stay on the ground.

setorigin fixes this.

The zombie can be shot and killed as he is ascending, he just will not detect collision though.

Here are some screenshots, although I doubt they're going to help :P

Image

Here's a zombie "hitting the triggers"

Image

Here's a runaway zombie...

Image
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

setorigin doesn't trigger triggers.
walkmove does, but I'm not sure if you need to be FL_ONGROUND for that.
andrewj
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Post by andrewj »

I think the bottom trigger would need to change the zombie's movetype to MOVETYPE_FLY and set the 'velocity' field to make it fly upwards, and the top trigger would change the zombie back to MOVETYPE_STEP and perhaps move the zombie forward a bit so that it will land at the top of the cliff (and not simply fall all the way down to the bottom trigger again).

Better (but harder) would be to make the zombie do this without needing the triggers. It would need to change the check for bumping into a wall (which normally makes the monster choose a different direction to walk) to check that the player is higher than the zombie, and that the zombie could get past the blocking wall if it were higher up -- if those conditions are satisified then it goes into flying mode and only stops when it is able to move forward again.
blubswillrule
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Post by blubswillrule »

I see your point here, but the zombie's AI is waypoint based, using the A* pathfinding algorithm, so I could just use waypoints instead of triggers, I'll toy around with this and see what results I get :)
A truly rewarding experience for an AI coder: watching your ai navigate the map... makes all the time invested in the code worth it :)
Post Reply