No collision in animation

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
green_algae
Posts: 7
Joined: Wed Sep 14, 2005 12:20 pm

No collision in animation

Post by green_algae »

Hi,

i'm creatin n RPG game.
i've implemented the click on the screen n run code that is when i click anywhere on the screen my character starts to run n reaches that point on the map. i used the createFlyStraightAnimator() function.

i've 3 problems :

1. after reaching the destination my character doesnot stop running.
2. i have put irrlicht collision between the map n the model but if there is a small wall or object n i click on the other side, the model just runs thru it.
that means even if there is a bump on my terrain it just slides thru the bump n not over it.
3. even if i click on a wall because of collision the model runs in the air n reaches that point on the wall. so she is hanging in the air.

can anyone plz help me out here???
can it be solved by pathfinding algo or should i use newton physics engine to solve the collision problem???
or is there any other way of animation???

Thnx
Guest

Post by Guest »

you already posted your answer yourself:

1. how could you even do that without pathfinding?
2. newton for collision would not solve the problem since the player would never reach its destination without pathfinding
Leiden
Posts: 5
Joined: Fri Oct 07, 2005 2:13 pm
Location: New Zealand

Post by Leiden »

You definately need path finding, basically all pathfinding is just a set of waypoints around the map, when you tell the character to move to position X the pathfinding would kick in and the player would navigate the waypoints to reach the destination. So if there is something like a tree you would give the tree a waypoint type of 'Solid' or something, then if the players path collides with that 'Solid' object the player will avoid that patch and find another route to the destination. This is the basic structure for games like Age of Empires, Half Life etc. The only difference is that in games such as Half Life and AOE certain states will kick in when a variable is met, I.E. enemy within 20 units of player, the player will leave the path and head in the direction of the enemy to attack, then the player will return to the path, and resume the task.
Post Reply