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

Solved Can I store information in player entity?


Post New Thread Reply   
 
Thread Tools Display Modes
XSlayer
Member
Join Date: Dec 2021
Old 07-25-2022 , 23:06   Re: Can I store information in player entity?
Reply With Quote #11

Quote:
Originally Posted by damage220 View Post
It is good to explain why you think so.
https://forums.alliedmods.net/showthread.php?t=88792

here it explains the differences between engine vs fakemeta in terms of memory and its differences
XSlayer is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-25-2022 , 23:30   Re: Can I store information in player entity?
Reply With Quote #12

Quote:
Originally Posted by XSlayer View Post
https://forums.alliedmods.net/showthread.php?t=88792

here it explains the differences between engine vs fakemeta in terms of memory and its differences
The point he's trying to make is the FakeMeta Utility functions are not ideal as they use multiple natives to accomplish something that Engine/CStrike can do with a single native. You will not see a valid difference between pev()/entity_get_int() or set_pev()/entity_set_int().
__________________

Last edited by Bugsy; 07-25-2022 at 23:33.
Bugsy is offline
XSlayer
Member
Join Date: Dec 2021
Old 07-25-2022 , 23:33   Re: Can I store information in player entity?
Reply With Quote #13

Quote:
Originally Posted by Bugsy View Post
He compares Fakemeta Utility (an include file) functions versus Engine/Cstrike (module) natives. This is not apples to apples as Fakemeta Utility uses multiple natives to accomplish something that a single Engine or CStrike native can do, in which case the Fakemeta Utility variant is not ideal to use.

In this case, pev()/set_pev() versus entity_get_int()/entity_set_int(), the difference, if any, is negligible.
what you say first is only part of the efficiency of using native against utilities(natives vs utilities), below the difference of using pev instead of entity_set is perfectly detailed, in terms of memory ( native against native )

PHP Code:
type |                             name |      calls time min max
-------------------------------------------------------------------

|                              pev |      30000 0.067148 0.000001 0.000086
|                entity_set_origin |      10000 0.035055 0.000002 0.000082 
for example if i want to set an origin

Last edited by XSlayer; 07-25-2022 at 23:36.
XSlayer is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-25-2022 , 23:37   Re: Can I store information in player entity?
Reply With Quote #14

pev() is not what you use to set an origin.
__________________
Bugsy is offline
XSlayer
Member
Join Date: Dec 2021
Old 07-25-2022 , 23:39   Re: Can I store information in player entity?
Reply With Quote #15

Quote:
Originally Posted by Bugsy View Post
pev() is not what you use to set an origin.
PHP Code:
|                          set_pev |      50064 0.110391 0.000001 0.000077 
sorry my bad, is 2 times more of memory than pev and 5 times more than entity_set_origin
XSlayer is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-25-2022 , 23:45   Re: Can I store information in player entity?
Reply With Quote #16

We're talking peanuts here, and I'm am not an advocate of fakemeta or anything like that. Someone should not avoid using fakemeta due to it not being efficient.
__________________
Bugsy is offline
XSlayer
Member
Join Date: Dec 2021
Old 07-25-2022 , 23:49   Re: Can I store information in player entity?
Reply With Quote #17

Quote:
Originally Posted by Bugsy View Post
We're talking peanuts here, and I'm am not an advocate of fakemeta or anything like that. Someone should not avoid using fakemeta due to it not being efficient.
well if we are talking about making an efficient plugin (to make a plugin you need to use natives) you should use the most efficient tools, if you don't, maybe the plugin is not as efficient in memory issues, and I think that everyone aspires to make a plugin or code more than anything efficiently and optimally
I only reinforce my theory that the engine is better than fakemeta, and the arguments are plenty, and I have not said that they should not use fakemeta, but maybe it is not the most correct way to make an efficient plugin

Last edited by XSlayer; 07-25-2022 at 23:51.
XSlayer is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-26-2022 , 07:34   Re: Can I store information in player entity?
Reply With Quote #18

That's fair, but recommending someone switch set_pev() to entity_set_int() for something miniscule as this isn't helping much.

If they have something repeating 100x a frame, then it's a different story
__________________
Bugsy is offline
wilian159
Member
Join Date: Dec 2013
Old 07-26-2022 , 09:54   Re: Can I store information in player entity?
Reply With Quote #19

it's 2022, this won't make any difference on current machines, if it was 1980 I would be in agreement
__________________
wilian159 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 07-26-2022 , 10:28   Re: Can I store information in player entity?
Reply With Quote #20

I hear where he's coming from and usually push the same mindset, more efficient is always better. But we're talking about setting some attribute/value to an iuser field, which would take a large number of executions back to back to make engine provide a noticeable difference. Not worthy of a statement like "nope, engine>>>>>fakemeta"
__________________
Bugsy is offline
Reply


Thread Tools
Display Modes

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 03:15.


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