Raised This Month: $51 Target: $400
 12% 

High entity think delay affect velocity


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 11-01-2020 , 00:15   High entity think delay affect velocity
Reply With Quote #1

Hey there,
I found out that decreasing think delay affects movement speed.

For example, in this case, the entity will move for 250 units in the second:
PHP Code:
    static Float:vDirection[3];
    
// get direction somehow

    
static Float:vVelocity[3];
    
xs_vec_mul_scalar(vDirectionfSpeedvVelocity);
    
set_pev(entpev_velocityvVelocity);

    
set_pev(entpev_nextthinkget_gametime() + 0.04); // 25 fps 
but for 0.1 seconds delay (10 fps) the entity will move for about 224 units:
PHP Code:
    set_pev(entpev_nextthinkget_gametime() + 0.1); 
I've tried to set FL_BASEVELOCITY flag in every think, but it didn't really affect the behavior.

So for 0.1 delay velocity should be about 280 ups to cover the 250 units in 1 second.

I can't find any mention of the effect of time on velocity for entities with MOVETYPE_STEP move type in HLSDK and Xash3D engine code.
Is there any way to fix this effect?

Thanks!
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities

Last edited by Hedgehog Fog; 11-01-2020 at 12:35.
Hedgehog Fog is offline
AnimalMonster
Senior Member
Join Date: May 2020
Old 11-01-2020 , 11:17   Re: High entity think delay affect velocity
Reply With Quote #2

Quote:
Originally Posted by Hedgehog95 View Post
Hey there,
I found out that decreasing think delay affects movement speed.

For example, in this case, the entity will move for 250 units in the second:
PHP Code:
    static Float:vDirection[3];
    
// get direction somehow

    
static Float:vVelocity[3];
    
xs_vec_mul_scalar(vDirectionfSpeedvVelocity);
    
set_pev(entpev_velocityvVelocity);

    
set_pev(entpev_nextthinkget_gametime() + 0.01); 
but for 0.1 seconds delay (10 fps) the entity will move for about 224 units:
PHP Code:
    set_pev(entpev_nextthinkget_gametime() + 0.1); 
I've tried to set FL_BASEVELOCITY flag in every think, but it didn't really affect the behavior.

So for 0.1 delay velocity should be about 280 ups to cover the 250 units in 1 second.
There is no visible effect on velocity for 0.04 seconds delay.

I can't find any mention of the effect of time on velocity for entities with MOVETYPE_STEP move type in HLSDK and Xash3D engine code.
Is there any way to fix this effect?

Thanks!
I guess this script you make you need on android cs 1.6??
Maybe you can use MOVETYPE_FOLLOW

Last edited by AnimalMonster; 11-01-2020 at 11:17.
AnimalMonster is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 11-01-2020 , 16:18   Re: High entity think delay affect velocity
Reply With Quote #3

Quote:
Originally Posted by AnimalMonster View Post
I guess this script you make you need on android cs 1.6??
Maybe you can use MOVETYPE_FOLLOW
what are you talking about !@>!>!#>!$>!#@>$%@#>%>>??

and for the OP show the full code that weird for me too i don't remember hearing the entity think length effects the entity velocity.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 11-01-2020 at 16:22.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
Hedgehog Fog
Senior Member
Join Date: Jun 2010
Location: Ukraine
Old 11-01-2020 , 17:43   Re: High entity think delay affect velocity
Reply With Quote #4

Not resolved, but closed.
I'm going to change the approach and update velocity every think, but I'll move the main logic to another task which will be called less often than think handle.
__________________

❄️ CS Snow Wars - Mod based on snowballs fights
🧟 CS Zombie Panic - A port of HL Zombie Panic!
🎃 CS Halloween Mod - Completely new gamemode for Halloween Holidays
📦 AMXXPack - CLI and build system for amxx projects
🔧 Custom Entities API - API to register custom entities
Hedgehog Fog is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-04-2021 , 12:13   Re: High entity think delay affect velocity
Reply With Quote #5

i know this is an old topic the reason why this is happening because entities with MOVETYPE_STEP has a friction, so during the process they might slow down!
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 18:21.


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