Even though I understand how to create genes for simple things (when this happens, do this), I am having trouble coding higher level behaviors into DNA. The hunting strategy that I wanted to implement was a simple hunting in a swarm behavior. My bot would form in loose swarms, and when one bot sees food, everyone else in the swarm follows. I can write a gene telling the bot to follow conspecs. I can write a gene that tells the bot to back away from conspecs when too close. I even figure out how to get other bots to follow the bot who sees food. But when I combine them, the end result does not function as I anticipate. What happens is that, when feeding, all of the bots become to close to each other, and they all end up shooting each other when they try to feed off of the prey. This allows the prey the opportunity to destroy the entire swarm, which usually happens. (the code for my bot is saved on a different computer) Besides just this one example, what is some advice to help me code higher level behaviors?