.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Releases, Installers, Docs & Coding (http://forums.bots-united.com/forumdisplay.php?f=48)
-   -   podbot grenade throwing bug (http://forums.bots-united.com/showthread.php?t=1527)

Abu Amok 01-06-2004 20:49

Re: podbot grenade throwing bug
 
hi!

in my opinion studying ballistics to solve the grenade throwing bug is a
somewhat "academic" approach..

As this isn't about reinventing the wheel I' d rather propose a more practical attempt: Check out how the others are doing...

Joebot does throw grenades quite frequent and well aimed and at some point in the code there's a hint like "substrakt 15 to avoid the grenade hitting the ceiling" or so.

So why not get "inspiration" by someone who solved the problem? (And probably follows this thread leaning back in his comfortable chair with this biiig grin 8) in his face?)

Pierre-Marie Baty 02-06-2004 01:29

Re: podbot grenade throwing bug
 
Aspirin, stop grinning immediately, or I'll break in your house by night and convert all JoeBot XP to ANSI C and delete the original! :D

Huntkillaz 05-06-2004 01:41

Re: podbot grenade throwing bug
 
so is the joebot author wanting to give us a hand???

@$3.1415rin 05-06-2004 12:03

Re: podbot grenade throwing bug
 
dunno if there's much to say about it, just look at the code. checvectoss and checkvecthrow are just from the SDK I think.
In CSBotCS look at CheckGrenadeThrowing(), ( lol, another function where I should add some comments when I have time )
in CBotBase, take a look at the CBotBase :: HandleGOrder() function

( I know Pierre, i'm cheating :) but still grinning anyway :P )

sPlOrYgOn 05-06-2004 12:36

Re: podbot grenade throwing bug
 
thanks!
I'll look at it right now :D

[NvT]_KaszpiR_ 09-06-2004 17:43

Re: podbot grenade throwing bug
 
i guess more advanced will be where grenade will land after boucing off the wall etc

@$3.1415rin 09-06-2004 20:30

Re: podbot grenade throwing bug
 
yes, that would be cool, but the more bounces you calculate, the more possibilities you have to calculate. you won't be able to calc all those possibilities in realtime any more from a certain point on. Of course one could think about optimizations, but checkvectoss works fine most of the time, so this complicated stuff wouldnt be notices by any bot user I guess

Whistler 13-07-2004 13:53

Re: podbot grenade throwing bug
 
from bot_combat.cpp VecCheckToss() function:
Code:

  // get a rough idea of how high it can be thrown
  vecMidPoint = vecSpot1 + (vecSpot2 - vecSpot1) * 0.5;
  TRACE_LINE (vecMidPoint, vecMidPoint + Vector (0, 0, 500), ignore_monsters, pEdict, &tr);
  if (tr.flFraction != 1.0)
  {
      vecMidPoint = tr.vecEndPos;
      vecMidPoint.z = tr.pHit->v.absmin.z;
      vecMidPoint.z--;
  }

...but if tr.pHit is the worldspawn entity, the tr.pHit->v.absmin.z will just be zero. so this may be wrong code.
Perhaps you need to change this part of code back to the original HLSDK one (looks like CF has modified the two VecCheckxxxx() functions)

Pierre-Marie Baty 13-07-2004 14:57

Re: podbot grenade throwing bug
 
yea, this code looks somewhat mistaken to me.

I would think of
Code:

  // get a rough idea of how high it can be thrown
  vecMidPoint = vecSpot1 + (VecSpot2 - VecSpot1) * 0.5;
  TRACE_HULL (vecMidPoint, vecMidPoint + Vector (0, 0, 500), ignore_monsters, head_hull, pEdict, &tr);
  vecMidPoint = tr.vecEndPos;
  vecMidPoint.z--;

as the right code.

TRACE_HULL because a TraceLine would pass through the sky meshes whereas the grenade would bounce on it

And checking for flFraction is a bug since IF the grenade can actually reach 500 ft high (which is not that high in fact), then vecMidPoint would be left lined up with vecSpot1 and vecSpot2, which is NOT something we want, definitely.

sPlOrYgOn 02-10-2004 05:00

Re: podbot grenade throwing bug
 
I think I've found a good way for nade throwing :D
NOTE: PHP tags because code tags are currently broken..
Code:

  // get a rough idea of how high it can be thrown
  vecMidPoint = vecSpot1 + (vecSpot2 - vecSpot1) * 0.5;
  TRACE_HULL (vecMidPoint, vecMidPoint + Vector (0, 0, 500), ignore_monsters, head_hull, pEdict, &tr);
  if (tr.flFraction != 1.0)
  {
      vecMidPoint = vecMidPoint + (tr.vecEndPos - vecMidPoint) * 0.75;
  }



All times are GMT +2. The time now is 06:33.

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