[hlcoders] How to get the msec value for the bots in the HL1 engine?
Hi all, I know that this question is a bit outdated but I want to ask how is the best way to get the msec value for the RunPlayerMove() call? I'm talking about the old HL1 engine. I tried with gpGlobals-frametime * 1000; Work good first 30 minutes and after that the bots start to be stucked in to the round spawn. I will be very happy if someone point me the best way to get that msec value. ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
[hlcoders] Identifying all players in the current view
This is a multi-part message in MIME format. -- I'm trying to code a sniper view mode which identifies all the players currently visible in the active player's view, and displays information about each of them floating above them. I've had several ideas, including: just displaying the information for everybody on the server; always having the information attached to the people and only visible when the player's sniping; and looping through the player list, determining who's visible and attaching the information as appropriate. However, none of these methods is particularly elegant, and I was hoping there was some better way to do it. :-) -- [ philip.vcf of type text/x-vcard deleted ] -- ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] How to get the msec value for the bots in the HL1 engine?
THE STORM wrote: Hi all, I know that this question is a bit outdated but I want to ask how is the best way to get the msec value for the RunPlayerMove() call? I'm talking about the old HL1 engine. I tried with gpGlobals-frametime * 1000; Work good first 30 minutes and after that the bots start to be stucked in to the round spawn. I will be very happy if someone point me the best way to get that msec value. I used something like this (based on code Rich Whitehouse used for the Jumbot)... // adjust the millisecond delay based on the frame rate interval... if (msecdel = gpGlobals-time) { msecdel = gpGlobals-time + 0.5; if (msecnum 0) msecval = 450.0/msecnum; msecnum = 0; } else msecnum++; if (msecval 1)// don't allow msec to be less than 1... msecval = 1; if (msecval 100) // ...or greater than 100 msecval = 100; g_engfuncs.pfnRunPlayerMove( pEdict, pEdict-v.v_angle, 0.0, 0, 0, pEdict-v.button, 0, msecval); ...it does a pretty good job of averaging the msecval over many frames and clamps it to be within a fairly good range. Just make 'msecnum' be a local 'int' variable for the bot and make 'msecdel' and 'msecval' be local 'float' variables... int msecnum; float msecdel; float msecval; -- Jeffrey botman Broome ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Identifying all players in the current view
Philip Withnall wrote: I'm trying to code a sniper view mode which identifies all the players currently visible in the active player's view, and displays information about each of them floating above them. I've had several ideas, including: just displaying the information for everybody on the server; always having the information attached to the people and only visible when the player's sniping; and looping through the player list, determining who's visible and attaching the information as appropriate. However, none of these methods is particularly elegant, and I was hoping there was some better way to do it. :-) That last one sounds best to me. How much more elegant were you wanting it? -- Jorge Vino Rodriguez ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] Identifying all players in the current view
Loop through all the players, calling IsDormant() on them. That should let you pick out the ones that are being currently server-updated (and thus in your PVS). John Sheu ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
Re: [hlcoders] How to get the msec value for the bots in the HL1 engine?
Jeffrey botman Broome wrote: THE STORM wrote: Hi all, I know that this question is a bit outdated but I want to ask how is the best way to get the msec value for the RunPlayerMove() call? I'm talking about the old HL1 engine. I tried with gpGlobals-frametime * 1000; Work good first 30 minutes and after that the bots start to be stucked in to the round spawn. I will be very happy if someone point me the best way to get that msec value. I used something like this (based on code Rich Whitehouse used for the Jumbot)... // adjust the millisecond delay based on the frame rate interval... if (msecdel = gpGlobals-time) { msecdel = gpGlobals-time + 0.5; if (msecnum 0) msecval = 450.0/msecnum; msecnum = 0; } else msecnum++; if (msecval 1)// don't allow msec to be less than 1... msecval = 1; if (msecval 100) // ...or greater than 100 msecval = 100; g_engfuncs.pfnRunPlayerMove( pEdict, pEdict-v.v_angle, 0.0, 0, 0, pEdict-v.button, 0, msecval); ...it does a pretty good job of averaging the msecval over many frames and clamps it to be within a fairly good range. Just make 'msecnum' be a local 'int' variable for the bot and make 'msecdel' and 'msecval' be local 'float' variables... int msecnum; float msecdel; float msecval; -- Jeffrey botman Broome Hi botman, I used the same algoritm before but its not work well on higher than 100fps. gpGlobals-frametime * 1000; work good on 255 fps but after some time the bots start to be stucked in to their spawn points. Do you know better way ( I wonder what the official CS bot use ). Thanks a lot anyway, I will back to the way that you posted if there is no other solution. The Storm ___ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders