.:: 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)

Whistler 28-04-2004 10:12

podbot grenade throwing bug
 
I've found this bug is still not fixed...

in the VecCheckToss() function:
Code:

    if (vecMidPoint.z < vecSpot2.z) // VERY BIG FAT BUG !
    {
          // to not enough space, fail
          return g_vecZero;
    }
 
    // How high should the grenade travel to reach the apex
    float distance1 = (vecMidPoint.z - vecSpot1.z);
    float distance2 = (vecMidPoint.z - vecSpot2.z);
 
    // How long will it take for the grenade to travel this distance
    float time1 = sqrt( distance1 / (0.5 * flGravity) );
    float time2 = sqrt( distance2 / (0.5 * flGravity) );

...Count Floyd only checks the vecSpot2.z here, which is wrong. We should check vecSpot1.z as well. Otherwise the following sqrt() will just eat a lot of negative values. I don't know what result this will cause (it doesn't crash in MSVC 6, but crashes in Borland Compiler and freezes in Visual Studio .NET beta during the following traceline).

Pierre-Marie Baty 28-04-2004 10:54

Re: podbot grenade throwing bug
 
Good one Whistler :)
You'll tell me I should have checked the YaPB source... and you'd be right :D

@$3.1415rin 28-04-2004 17:19

Re: podbot grenade throwing bug
 
it's not CF not checking that one, but valve, right ?

the negative root produces an NaN I think, so the following calculations will be invalid.

PS: just looked it up and it's already fixed there. so maybe I did it, or a later SDK version from valve had fixed the bug.

[NvT]_KaszpiR_ 24-05-2004 10:03

Re: podbot grenade throwing bug
 
hmm sthill noticing in RC 2.1 bots are throwing nades stangely (not mch, and usually wih suicidal effect)

g4s 28-05-2004 01:14

Re: podbot grenade throwing bug
 
Quote:

Originally Posted by [NvT]_KaszpiR_
hmm sthill noticing in RC 2.1 bots are throwing nades stangely (not mch, and usually wih suicidal effect)

yes, and thats really funny indeed.
I saw two guys walking in a same line and stuck at a point. when they see an enemy, they pull out nades at the same time, turned around and threw towards the wall. and then nades came back to them...

sPlOrYgOn 28-05-2004 01:16

Re: podbot grenade throwing bug
 
yea we need better grenade throwing algorithms :D

Huntkillaz 28-05-2004 03:14

Re: podbot grenade throwing bug
 
here's my 2cents on g throwing based on playing the cs wc3 mod as orc:


1) if enemy is near u (easy to implement)

if the enemy is near u ie in visible range up clos or a bit off here's what u do


a) up close ....when up close ..face to face u gotta watch them ..

if enemy seems to move left take it's current distance and add distnce wise what u think will be the time when the gren explodes it should land at enemy's feet...when it blows

same for the right....

if enemy is coming towards u throw it at ur feet and start moving away from it...any direction that where u was standing is best :)

if enemy is going away from u ....u'll have to calculate the distance backwards but the nade has to be thrown at an angle to achieve this since it'll move in an arc.

b) far..bascially just aim at them or thier predicted position have to use similar startegy as when enemy is going away from u...

2) don't know where the enemy is.....i was thinking if it was possible that we could probably use the danger pos...to help..basically the most dangerous areas with alot of player n enemy collsions can be used as target positions for nades .....and camp spots also using walls for rebounds

----edit---
and u can talk to two mask (bot n metamod coding forum he has some posts) on grenade detection for the victim about what he's done....if he'll want to tell ;)

sPlOrYgOn 28-05-2004 03:39

Re: podbot grenade throwing bug
 
yes thats basicly how everyone throws nades..
the problem is with calculating how high to aim to make it reach the guy and it seem that when that is calculated it is way off.. so off that they end up throwing a nade in the wrong direction...

Huntkillaz 28-05-2004 03:45

Re: podbot grenade throwing bug
 
Quote:

Originally Posted by sPlOrYgOn
yes thats basicly how everyone throws nades..
the problem is with calculating how high to aim to make it reach the guy and it seem that when that is calculated it is way off.. so off that they end up throwing a nade in the wrong direction...

then the bug is a timing issue....but if what i had just said that they use the pos of the enemy at a specific time frame then the nade would be not way off but close by...i think that there's something funny going on at the either thier calculating the pos

sPlOrYgOn 28-05-2004 03:48

Re: podbot grenade throwing bug
 
Quote:

Originally Posted by Huntkillaz
then the bug is a timing issue....but if what i had just said that they use the pos of the enemy at a specific time frame then the nade would be not way off but close by...i think that there's something funny going on at the either thier calculating the pos

nope not a time issue..
it's an aiming issue..
more like a calculating aiming height issue or something like that..


All times are GMT +2. The time now is 03:25.

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