Enemy Collisions

Hello everyone. I am working on a game without using the Bullet physics engine at all. All “collisions” are faked by using properties, near sensors, radar sensors, and so forth. It has been working pretty well so far until I add multiple enemies from a hidden layer. I can’t for the life of me figure out how to make the copies not overlap each other. I was hoping to use the steering actuator set to ‘flee’ but since all of the enemies are the same objects, they try to flee themselves and the game breaks.

I could make it work by creating a ton of copies (so its not the same objects that are added) but that would require making A LOT of changes to my current logic bricks and I don’t really want to do that for every enemy that I make.

I don’t know any Python at all. The entire game is logic bricks. Thanks.

I think you need to rethink your enemies logic.

I mean, for example, you can set by near and ray sensor a property which objects it should only sens.

So if your enemies flee for example from the player, give the player say, a property “player” and the enemies a area senosor and add in the property “player” so the enemies wouldn’t flee from themselves as they have no player property.

I have all of the enemy - player logic set up fine. Here is how my game works to better understand the problem. It’s a swordfighting game. Enemies seek the player and they when they are a set distance away, they randomly circle left or right or stay still. Multiple enemies work fine but they can potentially overlap each other. When circling the character, they can overlap. I’m trying to prevent that without using physics. Is that possible?

Secondary question: Is there a way to add a property to an object after the game has started? I think I could solve my problem that way.

You could try using the ray sensor to fire short rays to the enemy’s left an right. If one of them is positive, the enemy should not circle left or right respectively.

As for adding properties in game, I belies there’s a property actuator that’s easy to use.

I you are not using bullet at all, you need to use python. Note that setting the objects to static does not mean bullet isn’t running, otherwise near and radar sensors wouldn’t work.
You may use empties to make the enemies avoid obstacles. If obstacle on the left, turn right, and so on. The radar sensor could work well, since it wont detect the parent, and try to escape from it self. I had a simple example in 2.49, it should be in the resources as simple ai or something…

I suppose I am using Bullet, just not detecting any collisions. All my objects are static or no collision. I’m pretty sure sending out the rays to either side will work. Thanks for your help! I’ll let you know if I have any more problems.

Read the notes about: TrackTo and added Objects

this is valid for all logic bricks referring to an object (incl. steering actuator)