You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers. No questions about C++ programming or topics which are answered in the tutorials!
This method will work more easly if you separate collision geometry from presentation geometry. Collision geometry would have to be as simple as possible.
i think there's a raycast function to retrieve the triangle a ray collided with. Terribly slow to do every fram of course. Plus only gives triangle with 3 points, no normal. easy to create normal (crossprod of two vectors formed from points) as long as ur not worried about front-facing vs back-facing triangles.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.
good idea, but if your target is behind a wall you'll always end up stood on the triangle's normal.
i think you should do it in steps, you start by taking a number of steps towards the target. if something is in the way, you remember the angle would like to go to and push it on a stack.
if you can't go in that direction, you take the direction from the collision's triangle and head that way, and push the last direction on to the stack.
If you can go in the last direction, then you change to that direction and pop it off the stack. it wouldnt stop you getting stuck and going round and round in circles though, but it would navigate round most things and usually find a way to a moving target
another way would be to pick a direction and follow the wall circling the current object until the line to the destination collides with a different object. thats not without its problems either though, pathfinding is the best way
Just FYI, if your levels are simple, pathfinding is also simple. If you represent your world with tiles (i.e. a grid), you can apply A* or any search alg to easily generate paths. Pathfinding is really quite easy!
A* can path anything... but he mentioned that he had a simple map, but didn't want to use pathfinding. If your map is simple, you can break it up into a simple grid and easily use A*, and it's not hard to implement.
a major problem with a* is that how would ir know if that square is part of the bsp or not
unless there are predefined nodes
Not sure I understand what you mean. From your original post, it seemed like you were in need of a good way to avoid walls. If you flag grid positions as being "too close to a wall" your heuristic could just reject those nodes/grid squares and your AIs would avoid the walls.
i think thats what omaremad is getting at is the need to draw your a* map as another part of your workflow. That's the main advantage of not using real pathfinding imho.
I think what we need is an automatic a* node generator that you call on a mesh, something like smgr->createPathFindingNodes(mesh, startvector, downvector), and it uses collision detection to decide which parts can be reached from neighbouring nodes, if hills are too steep, etc,
Yeah, I'm trying to imply that there is no explcit 'drawing' of your navigation grid. If your map is simple, just generate the grid. You DON'T have to use something sophisticated like a nav mesh.
I generate my A* nodes on a pseudo grid (modifying height where necessary), then the user can move nodes around as desired, if the grid does not quite fit. It definitely beats having to draw the map of nodes out by hand.
With regards to the original topic, avoiding walls, AI Game Programming Wisdom 2 has a very good article about dynamic obstacle avoidance. Essentially, get the distance to nearby obstacles, generate a repulsion vector for each, calculate the total repulsion vector, and create a movement vector by combining the repulsion vector with the desired direction. I have yet to implement such a system myself because I am waiting for the closest distance function in Newton 1.35. Using irrlicht raycasting for the closest distance would be terribly slow, so I think a physics engine would be better suited here. Even without a closest distance function, it could be done with the raycast capabilities of the physics engine.
You do a lot of programming? Really? I try to get some in, but the debugging keeps me pretty busy.