[Pogamut-list] RayCasting Bot

cazub pogamut-forum at artemis.ms.mff.cuni.cz
Wed Oct 1 01:13:19 CEST 2008


RayCasting Bot
Hi guys, still tryin to figure out pathfinding but in the meantime i have a raycaster bot question. I'm building on top of the RayCasterBot implementation in the lectures section of this site. I've got a couple problems. 

First: I shrunk the rays to 50 or 100 length (so it would get through a door once in a while) then tried to add a ray for Straight ahead + 45 degree up angle and Straight ahead + 45 degree down angle. These would be used to see if i'm on a ramp or if an obstacle in front of me is jumpable. I declare the rays like so 

STRAIGHT_UP45(7, new Triple( 1,0,1), 100);
STRAIGHT_DOWN45(8, new Triple(1,0,-1),100); 

The result: i get 3 rays pointing straight ahead with no elevation angle change. Its as if rays can only be cast in a horizontal plane around the character. If this is so the raycasting idea may only work on flat maps.

SECOND: the bot is REALLY slow, all i did was add 3 more rays and a part that will turn the bot to fire at a player if it sees one. WHen i run the bot it basically hangs for about 20 seconds (it will however retarget me every 5 seconds). Finally it will move and actually seems to be getting trace results at a normal pace until i kill it. Then the 20 second thing starts all over. Sometimes at a point where the bot has 2 or more rays all hitting something it just gets stuck and does nothing until i walk my character over and shoot the bot. I can't tell if this is a hang like the 20 second lead time or if this is because of the overly simple Logic the bot uses when a ray hits.


----

Reply Link: <https://artemis.ms.mff.cuni.cz/pogamut/tiki-view_forum_thread.php?forumId=6&comments_parentId=243#form>





More information about the Pogamut-list mailing list