Flock Game

Here is a proof of concept I’m playing with in the blender game engine. It’s REALLY early days and I was after a little help.


I have an x and y radar that work fine to sens the Suzanne head approaching and I have tried to click invert the level on a copy of x and y for -x and -y. I guess this is not okay so, how do I do it?


an artist http://www.glennmelenhorst.com , not a programmer. :frowning:

Nice :slight_smile:
The way you are doing it now, you will need 4 radar sensors for each animal for them to effectively see the monkey. I suggest 1 ray or radar sensor for each animal from an empty that copies the location of the animal. the empty would always track to the monkey.

here is an example with minimal python (3 lines):

AK! I have so much to learn. That’s amazing. Thank you so much. I had no idea linked object could be seen together under the logic panel and pipe data between them like that. Now, to understand it all. :slight_smile: .
In the flow you kindly sent through, the python controller connects to a motion acutuator on the bunny that does nothing. What is that motion’s function? if I remove it, the setup breaks but I’m not sure how the setup works entirely.

Thanks again Pseudonym. It’s very much appreciated.


Nice one Pseudonym!
Thank you for sharing!

all the motion actuator dose, is let the python script see the bunny. it could be any actuator, but motion is default and i didn’t change it. let me explain it line at a time

import GameLogic

just imports the GameLogic module.

 con = GameLogic.getCurrentController()

set the variable “con” to “GameLogic.getCurrentController()” (the controller logic brick that the python script is in)

this is a bit more complicated:


the object that con is on.


sets position to…


remember con? this gets the first actuator connected to it.


the object that the actuator we just got is on


its position

hope this clears things up a bit. :slight_smile:

Dead set legend.
I understand. Hopefully I can have some sort of prototype up in the near future. :slight_smile:

Thanks for your time.

I have leard here amayzing ways of games…goor game engine …easy to use…a little bit effort we can be a expert

Hi all again,
Here is a WIP of a proof of concept level.


I have copied Pseudonym’s instructions across to my new little guy and have it kind of( :no:) working.
Here is a zip of the blend…

The little yellow dude seems intent on just crashing into the walls and staying there even if I creep up on him. Sometimes it looks like it’s working though.

One question I do have is how to stop the yellow dude from flipping and falling over. I have him as a dynamic actor but he does a whole lot of gymnastics I’d rather he didn’t.


Glenn Melenhorst

Please pack your textures by going to File>Pack Textures. We cannot see the textures you are using.

select the empty and hit F7. notice the “anim” tab. the track settings are what the track to actuator looks at. try setting them to track y and up x.
then change Empty.003’s ray sensor to the x axis. also, you may want to check the “3D” button in the Empty’s track to actuator, so the ray doesn’t have a chance of going over the player’s head.
about the acrobatics, that can be solved by removing “rigid body” from the bunny. however, if you do this, you may want to lower the time value a bit in the bunny’s track to actuator as well. (5 seems to work good for me)
the ray that senses the player seems a bit short too.
hope this helps.

on a positive note: I love that map. really nice job there.

Amazing! That level has come quite a way since the last release.

Two things that I saw that probably need to be worked on:

  1. The “rabbit” gets stuck in the floor a lot. I could not get it to move past the first purple rock.

  2. When the “shepherd” collides with the “rabbit”, the the “shepherd” can be flipped over. This causes the controls to be reversed. (Left goes right, vice-versa.) Additionally, if the “shepherd” gets flipped on its back panel (opposite the pointed end), you can fly it above the level and out of the boundary fence!

It is shaping up well. Keep up the good work!

Here’s an update (hopefully with the textures packed). I think it’s better but it’s hard to tell exactly what’s going on when the empties are invisible. I guess I’ll try to link a box to one to see.
The next thing to try will be to get some random wandering into the yellow guys and some animation which will mean armatures etc.



The track to on the emptys should have 3d enabled. otherwise, the rabbits won’t see the rabbitherder if it is above or below them. (like on a hill) unless you want that…

either way, the textures are working this time. It sure is fun to chase around those bunnys.

I think, in a way, this project, although simple, may be beyond me. :(. I have been trying to make the rabbits wander around using a random sensor in 3 motion actuators (forward, side, side) but they just jitter and bounce into a wall. I have been hunting for scripts on random walking but am just getting frustrated. I’ll give it a rest and work in the garden for a bit.:slight_smile:

Ultimately, I’d like to be able to repel or attract the bunnies (easy enough now) and I’d like there to be distractions or threats to the bunnies in later levels that would mean you don’t make your quota of animals in the pen. So much to do :slight_smile:


Hi all, I have a menu that I would like to zoom in when the quota of bunnies is reached. i have it set up and animated and overlaid, how do I trigger the animation from my current game play level? I can’t seem to move a property between scenes to trigger the action.
Any help appreciated.



Here is my updated level. Still so much to do :p.
The magnet icon changes the action from flock herding to flock attracting but so far it only seems to attract one dot and even then, he is attracted backwards!
There is no animation on anything yet and I have still to add the puzzle aspects of the game.



Glenn Melenhorst

Here’s my first version with basic animation on the dots.
Any advice as to why they are flying away (and I suspect it’s an axis thing I don’t understand) would be appreciated. As well as that, I’m trying to get the little dots to randomly eat, wag their tails as they stand around. How would I trigger these events randomly? Python? :frowning:
edit oops. had the wrong file at the head of this message. :slight_smile:

Glenn Melenhorst

If anyone could help me with my ‘flying away’ characters, I’d really appreciate it.

Glenn Melenhorst

Here is another character for my flock game… Now to animate him :slight_smile:


Glenn Melenhorst


My new level. I have a bunch of things in the pipeline, not the least of which will be proper textures.
There is a berry you can pick and throw with ctrl. This does nothing yet but will become important in the game. I have a lot more to do but am happy with my progress given this is my first game in Blender ( In anything :yes: ).

Glenn Melenhorst