Forum

Collision bugs?

Discuss Artificial Intelligence and Bot programming.

Moderator: InsideQC Admins

Collision bugs?

Postby blubswillrule » Sat Jun 11, 2011 12:00 am

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 :)
User avatar
blubswillrule
 
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California

Postby Spike » Sat Jun 11, 2011 10:48 am

setorigin doesn't trigger triggers.
walkmove does, but I'm not sure if you need to be FL_ONGROUND for that.
Spike
 
Posts: 2853
Joined: Fri Nov 05, 2004 3:12 am
Location: UK

Postby andrewj » Sat Jun 11, 2011 12:12 pm

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.
andrewj
 
Posts: 133
Joined: Mon Aug 30, 2010 3:29 pm
Location: Australia

Postby blubswillrule » Mon Jun 13, 2011 12:34 am

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 :)
User avatar
blubswillrule
 
Posts: 68
Joined: Mon Oct 04, 2010 9:08 pm
Location: Lincoln, California


Return to Artificial Intelligence

Who is online

Users browsing this forum: No registered users and 1 guest