Boids in a Maze

I just got “Bounce, Tumble, and Splash” a few days ago and really enjoyed to learn from it. As I got to the particles chapter and read about boids I was really impressed by all the imaginable possibilitys. As a simple test I made a maze for the boids to travel through it.

Well… I thought it would be simple, but now it became a too hard task for me.
I created a simple flat maze by extruding the edges of a plane. Then I extruded the outside edges to create a wall.

I told the boids to move on the plane only, and never to collide with the wall. Finally I set a goal for them.

But the boids don’t listen at all. They keep passing through the edges of the wall no matter how the prioritys are set.

Maybe you have an idea, and if you have please tell me. Because it’s really getting me down at the moment:(.
The Blend is attached.
Thanks in advanced, Malacath.


Boids.blend (395 KB)

This is what I’ve noticed: your boids are very large compared to the passageways. If you turn on the Visualization: Size, you’ll see what I mean. They are crowding each other out of the passageways. Try scaling the size of the maze up (I didn’t see any way to decrease the size of the boids, but if there is, maybe that will do the same thing.)

There’s also the possibility that the verts in the wall are too far apart to keep the boids from sneaking through. Or, maybe there is some parameter that can be tweaked to keep them away from the walls. They seem to be breaking through at corners.

i fixed your blend.

Scale your boid down.

Apply scaling to all objects.

Apply a permibility to maze above 0 (like 0.1), this is the source of your problem.

Turn down the amount of boids. (It slows my fast computer down.)

PLay with the crowding factor.

I deleted your hook. (this may have helped.)

I didn’t post a .blend because I think it will help you learn more easily to try it on your own.

@Orinoco: Thanks for the idea, the particles can be scaled in the extras tab of the PSys, but it didn’t help.

@Nathanael: thanks for all of your ideas, but…

Scale your boid down.
As mentioned before it did’t help.

Apply scaling to all objects.
Makes sense, but it didn’t help too.

Apply a permibility to maze above 0 (like 0.1), this is the source of your problem.
Doesn’t make sense for me, because permeability discribes how many particles pass through the object. And it also doesn’t help.

Turn down the amount of boids. (It slows my fast computer down.)
For my computer it isn’t a problem and the only benefit is that less boids go through the corners, and thats just math-logic.

PLay with the crowding factor.
There is also no sense for me, because I thought a high crowd makes the boids less crowdy.

I deleted your hook. (this may have helped.)
I don’t know of wich hook you are talking, beacause I don’t remember putting one in there.

Even everything changed together doesn’t help me. I’m not lazy, but could you please upload the blend, I would rebuild it myself, but what I did now didn’t help.

I did some more experimentation with the boids. I removed the maze and ground objects, and added a cylinder as an obstacle, in between the emitter and the goal, and made the cylinder a collision object. I used a cylinder because it didn’t have corners, and the boids seemed to be using the corners to escape through the maze walls.

The cylinder acted as a boid trap. They all wound up inside the cylinder, after a while. Very interesting.

I think the problem is the boid behavior parameters. Collision is 2.000, the highest value, but the other values are also high. This doesn’t give the boids an “avoid flying through walls at all costs” behavior. So I lowered some other parameters by a factor of 10 (0.050 instead of 0.500.) This helped a bit, it took longer for boids to be trapped inside the cylinder, and fewer were trapped.

So I lowered the parameters again by a factor of ten. (The factors that seem to have an effect are crowd and center.) The boids behaved better, none got trapped inside the cylinder.

I replaced the cylinder with the maze, keeping the new parameters. The boids tended to stay inside the maze, but corners were still a problem.

Try modeling the maze with beveled corners, make the hallways larger, avoid places where corners in different hallways join each other.

Sorry, I meant to say empty.

Here is the .blend.


Boids.blend (196 KB)

@Orinoco: Your idea works well with a normal cylinder, but when I’m beveling the corners of my maze and start the animation Blender crashes after a few frames for some reason.

@Nathanael: Your blend works well, as long as there are no goalls or predators. In this case the same problem occurs, and without a goal or a predator a maze wouldn’t make much sense.
Furthermore the object applied to the PSys for the 2D-option are the walls, what means that the boids can easily go on top of them.

If you have any other ideas, or anyone else has one, please post. Beacuse I don’t believe that there is no way to do this.

On The Other Hand…

Boids Behavior 2.46 Release Notes As a final note, the Collision algorithm is still not perfect and in research progress, so you can expect wrong behaviors at some occasion. It is worked on.

What you want to do may not be possible, yet.

Regarding the crashes: you may be pushing the limits of your system with so many boids. The added calculations caused by beveling may have pushed it over the edge. Try reducing the number of boids to something like 40 or 50, run the simulation for only 2000 frames instead of 50000. Once you get it working you can explore the limits of your system.

Oh, a sad thing but what can i do, nothing, now I even know it’s not my fault;).
Thanks very much for your efforts, hope it’s getting fixed in the next realese.
Oh and, I only used 25 boids with 25 frames, and a crash after 2-8 frames, my systesm shouldn’t be that bad:no:.
Edit:Ok, actually it doesn’t crash that fast.