Raised This Month: $32 Target: $400
 8% 

[CS:GO] Smoothening bot movement


Post New Thread Reply   
 
Thread Tools Display Modes
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 09-30-2015 , 14:25   Re: [CS:GO] Smoothening bot movement
Reply With Quote #11

I wonder.. if I were to record the player's velocity and then teleportentity the bot with the same one (so not calculating it), wouldn't that technically fix those?
Or not work at all?
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
blaacky
Senior Member
Join Date: Oct 2012
Old 10-01-2015 , 08:08   Re: [CS:GO] Smoothening bot movement
Reply With Quote #12

No, that can often cause the bot to go off track and he'll just be jumping in the air and shit. You can perhaps record both velocity and position. Teleport with the recorded velocity and make sure he's near the correct position. This shouldn't be necessary though.
blaacky is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 10-04-2015 , 12:47   Re: [CS:GO] Smoothening bot movement
Reply With Quote #13

Sorry to be annoying, but I still get quite hefty "lags" or corrections often.
I also tried my idea of saving the velocity, but it turned out to be even more laggy.

Current code (mostly unchanged from my last post)
Spoiler


Example replay on surf_aircontrol_ksf (lags begin after about half of the map).
https://youtu.be/kuWZffJMbMA

Smooth replay on surf_ace_fix (only one very short hiccup)
https://youtu.be/1o1aXNV1rBs

And lastly, a half-half replay, with a smooth start then hefty lags later
https://youtu.be/SMHcKm6T-T0

Thanks again everyone for your help!
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Mehis
Senior Member
Join Date: Mar 2013
Location: basement
Old 10-04-2015 , 14:15   Re: [CS:GO] Smoothening bot movement
Reply With Quote #14

That seems to be this part:
PHP Code:
if(GetVectorDistance(vecPositionvecCurrentPos) > 50.0
Increase it. Try 128.0

Also, you should use this:

PHP Code:
#define MAX_DIST    128.0 // Change it to your liking.
#define MAX_DIST_SQ    MAX_DIST * MAX_DIST

if(GetVectorDistance(vecPositionvecCurrentPostrue) > MAX_DIST_SQ
There's no reason to square root the result since you are just comparing it.

Last edited by Mehis; 10-04-2015 at 14:16.
Mehis is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 10-05-2015 , 17:13   Re: [CS:GO] Smoothening bot movement
Reply With Quote #15

Thanks, that fixed the hard lags on aircontrol (there still are some on other maps, but not that many anymore).
The only problem I still have is those weird "flicks" you can see on doodles after stage 4, like it miscalculates the speed/angles somehow.
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Mehis
Senior Member
Join Date: Mar 2013
Location: basement
Old 10-06-2015 , 06:14   Re: [CS:GO] Smoothening bot movement
Reply With Quote #16

Try these:

PHP Code:
float vecAngles[3];
vecAngles[0] = GetArrayCell(g_hFramesg_iReplayTick 13);
vecAngles[1] = GetArrayCell(g_hFramesg_iReplayTick 14);
// To
angles[0] = GetArrayCell(g_hFramesg_iReplayTick 13);
angles[1] = GetArrayCell(g_hFramesg_iReplayTick 14);


// Reset the cmd velocity
vel view_as<float>( {0.00.00.0} );


// You can also try giving the bot noclip and disable gravity on spawn... (will also disable annoying footsteps)
SetEntityMoveTypeclientMOVETYPE_NOCLIP );
SetEntityGravityclient0.0 );

// As a last option make sure the bot's render mode isn't RENDER_NONE since I've had bad experiences with it. 
This basically sums up what I've done and my bots are fine.
Mehis is offline
aexi0n
AlliedModders Donor
Join Date: Nov 2014
Location: bhop_deluxe
Old 10-06-2015 , 10:28   Re: [CS:GO] Smoothening bot movement
Reply With Quote #17

I've actually had some recent success with using a prop dynamic with a player model then parenting a camera to it. The replays are not viewable without using the command, but in exchange its smoother and it also doesn't take up a player slot.

Last edited by aexi0n; 10-06-2015 at 10:29.
aexi0n is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 10-06-2015 , 16:17   Re: [CS:GO] Smoothening bot movement
Reply With Quote #18

Thanks a lot, it's running smoothly now (apart from rare, minimal hiccups here and there - even KSF's bots have these).

This is what I ended up changing:
PHP Code:
float vecAngles[3];
// keep the following two lines
vecAngles[0] = GetArrayCell(g_hFramesg_iReplayTick 13);
vecAngles[1] = GetArrayCell(g_hFramesg_iReplayTick 14);
// add these
angles[0] = GetArrayCell(g_hFramesg_iReplayTick 13);
angles[1] = GetArrayCell(g_hFramesg_iReplayTick 14);


// Reset the cmd velocity
vel view_as<float>( {0.00.00.0} ); 
I think the significant part was overwriting the predicted velocity/angles, as the bot itself did these (as in, the game).
__________________
Stopped hosting servers as of November 2018, no longer active around here.
pcmaster is offline
Reply



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


All times are GMT -4. The time now is 01:20.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode