Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Suggestions for fixing boid example? #5

Closed
miketucker opened this issue Dec 28, 2011 · 3 comments
Closed

Suggestions for fixing boid example? #5

miketucker opened this issue Dec 28, 2011 · 3 comments

Comments

@miketucker
Copy link

hey Ricardo,

I think the radar changes (http://www.arges-systems.com/articles/252/unitysteer-experimental-vehicle-and-radar-changes/)
threw something out of whack and now the boids jitter around randomly.

I've spent the afternoon tweaking but haven't had much luck.. Any suggestions?

best,
mike

@ricardojmendez
Copy link
Owner

Hi Mike,

Actually, this is likely because of how AutonomousVehicle currently interprets the forward vector (which is mentioned on the same article). If you attempt to run the boid example, they'll look as if they're having a seizure. I'll need to figure out what to do with that - it's possible that I may end up keeping AutonomousVehicle the way it was and fork the current behavior into a different class.

For now, if you're running into one of those cases, you may need to stick with the master branch.

@ricardojmendez
Copy link
Owner

Let me elaborate a bit more on what the issue is here, from the point of view of how things are on master. It's not just an issue of tweaking - this stems from the completely different way in which the development / master versions perceive velocity.

For master (and the working boids) velocity is an effect of its forward vector and speed. When it decides to move,it moves forward and can change direction by gradually moving its forward vector to be aligned with the new desired velocity. This means that they'll tend to move forward before turning around, like a car or a bird in flight would do.

For development (and the dubstep-dancing boids) velocity is the actual movement we're executing. Instead of tending to move forward, the agents are able to move in a direction while retaining a different forward vector. The jittery that you're seeing is the effect of the boids not gliding, but instead trying to sides-step each other. The new behavior just doesn't lend itself for boids.

If you want to retain the more vehicle-like behavior but take advantage of other improvements from the development branch, you could look into merging both AutonomousVehicle classes, or reverting the relevant commit, although I doubt such a change would apply cleanly:

65d15d9

That commit also explains the changes, so it might be good reading if you're considering adjusting the code.

@miketucker
Copy link
Author

hey Ricardo,

Thanks so much for your time. I've worked through it at this point. A while back i wrote you because the master branch wouldn't compile on iOS so i switched to the dev branch. It compiled but broke the boids :)

So today after writing you, I took the master branch, removed the C5 dependency and that fixed the iOS compile.
Really amazing job on this library, hope I can return the favor sometime. Btw I've been keeping an eye on your tile-based game, looking forward to playing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants