Yesterday I stumbled upon Craig Reynolds
Boids , and subsequently realized that I would suggest implementing a simple 2D version in Java. I put together a pretty basic setup based on
Conrad Parker notes .
However, I get a rather strange (in my opinion) behavior. Currently, my combat vehicles move quite quickly into a coarse mesh or grill and continue to move in place. By this I mean that they move a little and rotate very often.
Currently I have implemented:
- Alignment
- Cohesion
- Separation
- Speed ββLimit
At the beginning, my fights are randomly distributed over the screen area (slightly different from the Parker method), and their speeds are all directed to the center of the screen area (note that randomly initialized speeds give the same result). Changing the speed limit value only changes how quickly the coids move into this pattern, and not the pattern formation.
As I see it, it could be:
- The consequence of the parameters that I use (now my code is described in the Parker pseudo-code, I have not tried the influence areas defined by the angle and radius, as described by Reynolds.)
- Something I need to implement, but I do not know.
- I am doing something wrong.
The expected behavior would be something more compared to the two-dimensional version of what is happening in the applet on the Boids Reynolds page, although now I have not implemented any way to save the boids on the screen.
Has anyone come across this before? Any ideas on the cause and / or solution? I can post the .gif of the behavior in question if that helps.
Iskar jarak
source share