.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Something about msecval
Old
  (#1)
strelok
Member
 
Status: Offline
Posts: 26
Join Date: Jan 2004
Default Something about msecval - 13-01-2004

Why, when I use this code (by Count Floyd):

if (pBot->msecdel <= gpGlobals->time)
{
pBot->msecdel = gpGlobals->time + 0.5;
if (pBot->msecnum > 0)
pBot->msecval = 450.0/pBot->msecnum;
pBot->msecnum = 0;
}
else
pBot->msecnum++;
if (pBot->msecval < 1) // don't allow msec to be less than 1...
pBot->msecval = 1;

if (pBot->msecval > 100) // ...or greater than 100
pBot->msecval = 100;

my bots freeze (in the beginning of a round) for some seconds?
  
Reply With Quote
Re: Something about msecval
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Something about msecval - 13-01-2004

This code is Rich "TheFatal" Whitehouse's method to estimate the duration of the next frame, in order to predict how long the pfnRunPlayerMove call for the movement of the bots should last. It looks correct, I find it strange that it could cause you trouble. Are you sure your problem comes from here ?

Anyway, there are several other methods to estimate the frame duration. The simplest one is to use the time difference between previous_time and gpGlobals->time in StartFrame(). But it is best to filter this value with time, and that's the purpose of msecnum and msecdel.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Something about msecval
Old
  (#3)
koraX
Member
 
koraX's Avatar
 
Status: Offline
Posts: 145
Join Date: Jan 2004
Location: Slovak Republic
Default Re: Something about msecval - 13-01-2004

PMB is right, This piece of code should not cause errors. I'm using it too.


kXBot
koraX's utils
- see my homepage for other projects (OpenGL CSG Editor, FAT16 Sim, NNetwork Sim, ...)
  
Reply With Quote
Re: Something about msecval
Old
  (#4)
botmeister
Ex-Council Member
 
botmeister's Avatar
 
Status: Offline
Posts: 1,090
Join Date: Nov 2003
Location: Canada
Default Re: Something about msecval - 13-01-2004

Well, I've had poor results with this code, but I don't think it is the code that's the problem.

For example, I have two dedicated servers, both ar erunning realbot WIP#6 (and previously RB:AI ver 1.0). One server has the bots running around just slightly faster than they should, the other server has the bots running WAY faster than they should (2 or 3 x faster).

When I tried adding my own prototype bot into a game, I got the same problem - a bot that moved around way too fast depending on the server.

What i ended up doing, is setting the max speed of the bot entity to sv_maxspeed and that fixed the problem. I've added this "fix" to my bot manager (to be released soon), but a real solution to the problem should be found.

I posted this problem in botmans forum but no one had anything to offer at the time.


Maker of the (mEAn) Bot.Admin Manager

"In theory, there is no difference between theory and practice. But, in practice, there is." - Jan L.A. van de Snepscheut
  
Reply With Quote
Re: Something about msecval
Old
  (#5)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Something about msecval - 13-01-2004

botmeister, your method will force the bots to move as fast as can be, whether they carry heavy weapons or not. Have you tried hooking pfnSetClientMaxSpeed() and set each bot's max speed to this value ?



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Something about msecval
Old
  (#6)
Bert
Member
 
Status: Offline
Posts: 11
Join Date: Jan 2004
Default Re: Something about msecval - 13-01-2004

I hook pfnSetClientMaxSpeed() and my bots move at the correct speed. I also use The Fatal's msec code, and I haven't noticed any problems with it.
  
Reply With Quote
Re: Something about msecval
Old
  (#7)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: Something about msecval - 13-01-2004

Isn't this not the problem in CS where the bots angles overflow when they spawn? You should know all about that PM

edit: may aswell explain some:

If you are using botmans template, if the bots try to move more than 10 degrees (I think, maybe its 20) they stop and try to turn. If they're angles have overflown this might jumble up the bots interpretation and are not turning properly, meaning they will never turn the 10 degrees (or whatever) and will not move.

Use BotFixIdealAngles() function when a bot spawns.

.. or is It IdealYaw()...

Something like that... I don't use those functions anymore

Last edited by Cheeseh; 13-01-2004 at 18:57..
  
Reply With Quote
Re: Something about msecval
Old
  (#8)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Something about msecval - 13-01-2004

<offtopic>
how come there are a lot of bot developers in here and we never heard of their bots ? o_O
@Bert: You have an URL for your bot ?
</offtopic>



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."

Last edited by Pierre-Marie Baty; 13-01-2004 at 19:07..
  
Reply With Quote
Re: Something about msecval
Old
  (#9)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Something about msecval - 13-01-2004

@Cheeseh: Strelok is using Count Floyd's code, and CF obviously fixed this angle problems for quite a time already



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Something about msecval
Old
  (#10)
Cheeseh
[rcbot]
 
Cheeseh's Avatar
 
Status: Offline
Posts: 361
Join Date: Dec 2003
Location: China
Default Re: Something about msecval - 13-01-2004

Alright, well maybe they are just stopping to buy stuff eh? :p I haven't looked at CF's code, if you can debug, break when their move speed is 0 and see whats making it 0.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com