hey all,
Here's a quick demo video showing my steering behavior at work. They finally seem to be functioning properly, after two weeks of slaving away at them. I actually reverted to using Reynold's version, but I think I'm going to revisit my own Perlin noise version in the future.
I've also started a Let's Play video series of me playing Total War: Warhammer.
Cheers,
A blog about games: games I've made, games I'm making, games I dream of making, and games I'm playing.Games that changed my life, and games that I hope will change yours.
Showing posts with label Steering Behaviors. Show all posts
Showing posts with label Steering Behaviors. Show all posts
Wednesday, February 1, 2017
Wednesday, January 25, 2017
Steering Behaviors
hey all,
I've been working on getting my steering behaviors working a bit better for most of this week, and I think I'm finally getting close.
The diagram above is based on Mat Buckland's diagrams and description of the wander algorithm that Craig Reynolds developed. Basically, you pick a random point on the red circle, then add a small random displacement to it. You then normalize this displacement to put it back on the red circle. Finally, you project this circle in front of the agent. The vector from the agent to the green circle gives your agent a goal to move towards.
Another way to do it would be to pick a random angle within a limit of your agent's current value, and move your agent towards that angle at a constant speed.
I've developed on that uses 1D Perlin noise to smoothly move from one angle to another.
Here's a short video showing it at work.
Cheers,
I've been working on getting my steering behaviors working a bit better for most of this week, and I think I'm finally getting close.
The diagram above is based on Mat Buckland's diagrams and description of the wander algorithm that Craig Reynolds developed. Basically, you pick a random point on the red circle, then add a small random displacement to it. You then normalize this displacement to put it back on the red circle. Finally, you project this circle in front of the agent. The vector from the agent to the green circle gives your agent a goal to move towards.
Another way to do it would be to pick a random angle within a limit of your agent's current value, and move your agent towards that angle at a constant speed.
I've developed on that uses 1D Perlin noise to smoothly move from one angle to another.
Vector2 Wander()
{
if (currentLoc >= width)
{
currentLoc = 0;
perlinNoise = GenerateNoiseMap(width, seed++, scale, octaves, persistance, lacunarity);
}
//get the next angle and increment currentLoc
WanderAngle = perlinNoise[currentLoc];
currentLoc++;
targetRotation = new Vector3(0f, WanderAngle, 0f);
Vector3 localwanderTarget = new Vector3(Mathf.Cos(WanderAngle * Mathf.Deg2Rad), 0f, Mathf.Sin(WanderAngle * Mathf.Deg2Rad));
Vector3 worldwanderTarget = transform.TransformDirection(localwanderTarget);
wanderTarget = new Vector2(worldwanderTarget.x, worldwanderTarget.z);
return wanderTarget;
}
Here's a short video showing it at work.
Cheers,
Saturday, January 14, 2017
Flocking
hey all,
I've got some limited functionality working here on my flocking behaviors. Also show cases that the needs are still working.
I've got some limited functionality working here on my flocking behaviors. Also show cases that the needs are still working.
Thursday, January 12, 2017
Steering Behaviors
hey all,
I've programmed a little more for my The Sims-like game, but I've been focusing on implementing some steering behaviors, as can be seen in this video by another programmer. Right now, mine are not fully functional, but I hope to have them working by the end of the week.
Cheers,
I've programmed a little more for my The Sims-like game, but I've been focusing on implementing some steering behaviors, as can be seen in this video by another programmer. Right now, mine are not fully functional, but I hope to have them working by the end of the week.
Cheers,
Subscribe to:
Posts (Atom)