Why bots get stuck in each other?
Actually a question in the thread name...
I tried to change 'server' argument value in PM_Move() to false for bots due to this code (from PM_CheckStuck() function): Code:
// Deal with precision error in network. Someone can knows in what business and where it is necessary to search for the reason. Thanks! P.S. Sorry for bad english |
Re: Why bots get stuck in each other?
Hi,
I had the same problem of bots getting stuck when bumping into each other, and I do not understand why either. I have coded a "player collision avoidance" system but it cannot make sure bumping will not occur from times to times. As regards your code question, I actually redirect PM_Move code to my own code, so I think it could help you, but I cannot be more precise as I do not understand what you are trying to do. We can discuss it further if you want. You could also have a look at JKBotti source code. regards. |
Re: Why bots get stuck in each other?
Thanks for response! I can try to write simple anti-stuck code, like in PM_CheckStuck function, but I just want to figure out the reason of bot bumping.
Best regards! |
Re: Why bots get stuck in each other?
AND FINALLY I HAVE UNDERSTOOD IN WHAT THE REASON!!!
The guys from Valve forgot to add a check "if (host_client->fakeclient) return" for functions SV_GetTrueMinMax and SV_GetTrueOrigin, which sets predicted variables 'mins'/'maxs' and 'origin' to pmove->moveents, but these variables aren't correct, as they aren't calculated for bots! - this is the source of the problem. To fix this you need to delete these lines: Code:
SET_CLIENT_KEYVALUE (index + 1, infobuffer, "cl_lw", "1"); THESE VARIABLES DO NOT NEED FOR THE BOT! P.S. also to test it on the fly, you can simply set the value of console variable "sv_unlag" to 0! |
Re: Why bots get stuck in each other?
Too bad that so many years even Valve with their CSBot didn't suspected that this is the problem... Nice that you have found it! :)
By the mean "deleting these lines" are you saying that we should unset them for the bot like that: Code:
SET_CLIENT_KEYVALUE (index + 1, infobuffer, "cl_lw", "0"); |
Re: Why bots get stuck in each other?
Quote:
The official bot uses only "*bot" key value - that's all!!! Quote:
Code:
Q_memset(fakeclient, 0, sizeof (client_t)); ADDED: bonus Code:
edict_t *PF_CreateFakeClient_I (const char *netName) |
Re: Why bots get stuck in each other?
Are you sure? I remeber seeing the CSbot to get stuck in each other, regardless that they have nice algorithm to avoid themself... Anyway if you have tested this good there is no point to argue. :)
|
Re: Why bots get stuck in each other?
Sometimes I myself am not sure that I do. :)
My test was simple: on very small map (de_killzone - simply box) I have created 14 bots, each of them has been subordinated to my actions. And I drove them from corner to corner. Result: at cl_lw = cl_lc = sv_unlag = 1 - bots get stuck into each other at almost every collision; at cl_lw = 0 or cl_lc = 0 or sv_unlag = 0 - bots have never got stuck in each other, except for cases when boats have faced and intensively jump in a direction to each other, and that isn't often! |
All times are GMT +2. The time now is 12:18. |
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.