To avoid or not avoid....?

Started by
11 comments, last by Byron 17 years, 6 months ago
I need some advice... I am writing a game in the vein of Space Harrier, tempest and Unity (I was lucky enough to have the dev build of Unity on my desk while working at Lionhead). Now, in this game things are moving rapidly towards the player and there are also path based aliens flying around. Currently the aliens don't avoid the 'static' obstacles so they just pass through them. Should I worry about this? Do I need to add obstacle avoidance for the aliens - I can put it in but it adds an extra complexity to the code and I am not convinced that the end results will end up looking any better. I could always do a Star Wars and have the Aliens explode on contact with the obstacles.... but I don't really want to do that. Any thoughts? All views welcome. You can see various videos of the game in action in my Gamedev journal: Gamedev Journal
ByronBoxes
Advertisement
I think that adding the avoidance would be worth it. It would look a bit weird to see the aliens passing through solid objects :P.
I think I am just a little worried that it could result in the alien bouncing all over the place as it attempts to avoid one obstacle just to get in the path of another since the obstacles are moving quite fast.
ByronBoxes
But are the obstacles really moving? Sure, they appear to move because you're character is running, but probably they are really not moving. If it were me, and I like to keep things as simple as possible, I would just make it part of level design to make sure enemy paths don't collide with things.
What you call obstacle avoidance wouldn't be that difficult in this case I think. You could give the alien a set maneuverability, that would determine at wich range from the static object they could still react, if the range is too small simple let them collide (and explode), it would add a great feeling of pace to the game I think.
My Blog
Kiome - I like that idea. It might give a lot of dynamic to the later levels.

"Anonymous Poster" - One design flaw I have is that the obstacles are on a random positional release so I can't really design a path to avoid them.

ByronBoxes
Just a thought on the actual implementaion of the avoidance - or more correctly the reaction to the avoidance.

All the obstacles effectivley have a velocity of 0,-1,0 (Z is up in this world) so to avoid major problems I am thinking that I should only project along the X axis otherwise the Alien would be seen to be moving incredibly fast along Y as it will be trying to outrun the obstacle (which might be fun :))

Should the direction on X projection be random or should I try and make the Aliens a little more intelligent by looking ahead to see if the new position puts them into danger... mind you just having them avoid might bring out some emergent behaviour.
ByronBoxes
If you know the path that the objects are moving, tell them to aviod the path of the object in the next few seconds.
Given that the alien spaceship has a maximum velocity, then for each obstacle, there exists a cone of positions which means certain death (because nothing can move out of that cone fast enough to avoid the obstacle. When moving your spacecraft around on a given iteration, consider these cones to be impassable obstacles (because you don't want to enter them).

To make movement smoother, use weights: the alien wants to go somewhere with a weight A, and wants to avoid obstacles with a weight Bi, where Bi is infinite when trying to move into a danger cone, and diminishes when moving away from the cone (it's zero if not on the path at all).
Quote:
To make movement smoother, use weights: the alien wants to go somewhere with a weight A, and wants to avoid obstacles with a weight Bi, where Bi is infinite when trying to move into a danger cone, and diminishes when moving away from the cone (it's zero if not on the path at all).


This sounds interesting, can you expand upon this a bit more with an example? No, seriously - I would like to explore this a bit more.
ByronBoxes

This topic is closed to new replies.

Advertisement