.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   some problems (http://forums.bots-united.com/showthread.php?t=1116)

Whistler 17-03-2004 11:01

some problems
 
Hi all !

Haven't been online for quite a few days.

I'm now trying to do something like what Stefan and Christan was doing in their old Realbot. (That amazing "Checking Waypoint connection" process). But I've got some problems now...

When I fire a TraceLine to an obstacle(eg. walls), The tr.pHit is just the "worldspawn" entity, not func_wall or so. So I can't determine its shape by using tr.pHit->v.absmin/absmax/size. Does this mean I have to fire another whole bunch of tracelines, or is there any way to dertermine the shape ?

Also, is this correct ?

Code:

bool IsOnSamePlane(Vector &vecPoint1, Vector vecNormal1, Vector &vecPoint2, Vector vecNormal2)
{
  vecNormal1 = vecNormal1.Normalize();
  vecNormal2 = vecNormal2.Normalize();
  if (vecNormal1 != vecNormal2)
          return FALSE;
  return DotProduct(vecNormal1, vecPoint1) == DotProduct(vecNormal2, vecPoint2);
}

Thanks a lot !

P.S. Stefan, would you please give me some info or hints about how you did those things ? Of course you'll well credited if your information is useful :) Thanks a lot !

@$3.1415rin 17-03-2004 11:42

Re: some problems
 
that code snippet should be right if you assume every plane if going thru 0,0,0. Planes are normally specified with the normal and then with the distance to the origin of your coordinate system ( It's called hessesche form I guess ), but this'd be 0 in your case I guess. so two possible planes, first checking if the normal is right at all, so we know that the planes are identical. ( if you have 2 planes which are principally identical, but their calculation was different, you might still get problem due to rounding in float operations )

checking the dotproducts should then be ok, too

Pierre-Marie Baty 17-03-2004 12:33

Re: some problems
 
The only way to determine the shape of a wall with Half-Life is to read the BSP data. There's no other way. It also renders the "checking connection" step obsolete since there is no obstruction between a point and another in a BSP volume. At this cost you might consider using a navmesh instead since that's exactly it *hint* *hint* :)

Whistler 23-03-2004 11:19

Re: some problems
 
Quote:

Originally Posted by Pierre-Marie Baty
The only way to determine the shape of a wall with Half-Life is to read the BSP data. There's no other way. It also renders the "checking connection" step obsolete since there is no obstruction between a point and another in a BSP volume. At this cost you might consider using a navmesh instead since that's exactly it *hint* *hint* :)

Thanks for reply (as well as @$3.1415rin's). I have read your RACC Template 2 but because I'm still a beginner I don't quite understand the BSP stuff :) Also I just want to do something myself. So it may be not a good idea to use your navmesh code. Actually I changed the way of analyzing the map with some complicated maths stuff. My new method is: I ripped out some parts of Quake1 Engine source and use it to simplate player movement. Now it works very well at places needn't ducking/jumping and climbing ladders. But I think those things are easy to solve as long as I try to :)


All times are GMT +2. The time now is 01:42.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.