Improving the Movement in the Simulation

Initially I was planning to cover each movement algorithm as its own post but I quickly realized it was going to be too involved, Part 1 and Part 2 combined are almost an hour. And that’s after a lot of editing trying to keep them as short as possible because there’s so much more I could’ve covered. Part 1 is a bit longer because it also includes the explanation of some fundamental concepts that are built upon to create the movement algorithms.

The two videos cover what I consider to be more “naive” movement algorithms. That is simplistic movement algorithms without too much smarts in them. By this I mean for example they don’t try to predict where the other entities are going (what direction and speed they are moving), instead they just look at where they are now to make their movement decisions. That isn’t to say they don’t have logic and computations, they definitely look at other entities within their eyesight, it’s just that the calculations are based on the current state of things so they tend to be more simplistic in nature.

On a positive note some of the movement algorithms had interesting behaviors, even some emergent behaviors, from almost creating particle like behaviors all the way to what looks like animal prints as shown above (after adjusting the colors from red and blue to brown and yellow). 

The following movement algorithms are covered in the two videos:

  • Part 1
    • Move Towards Smallest Enemy
    • Move Towards Nearest Smaller Enemy
    • Avoid Nearest Larger Enemy
  • Part 2
    • Move Towards Smallest Enemy and Avoid Largest Enemy
    • Move Towards Nearest Smaller Enemy and Avoid Nearest Larger Enemy
    • Move Towards Average Smaller Enemy and Avoid Average Larger Enemy

One thing you’ll quickly notice between the two videos is that the movement algorithms in Part 1 only have one criteria whereas the movement algorithms in Part 2 combine two different criteria. This is because the first video is also introducing some concepts and the framework, and so to keep things more manageable I mainly focused on simpler, and hence singular, movement algorithms. Not that combining movement algorithms was that much complicated, it’s more in terms of the resulting behaviors. But I don’t want to give too many spoilers.

In the videos I explain what each of these movement algorithms works with diagrams and examples, and then I cover their resulting behaviors. I also go over some of the limitations of each movement algorithm, explaining why they happen and in some cases what we could do to improve it. And of course I cover any interesting resulting behaviors, including emerging behaviors like the animal print above.

In the next video for the movement series I plan on pitting all the above movement algorithms against each other to see if one will consistently beat out the others (as well as a random movement option). The entities will be color coded according to their movement algorithm. It should be interesting to see how it plays out. After that I’m most likely going to introduce some kind of concept of DNA with the goal of introducing evolution, in some form or other. But I’m getting ahead of myself. For now I recommend watching Part 1 and Part 2 of the Movement Algorithm series as they are quite interesting.

Leave a Reply