Raised This Month: $ Target: $400
 0% 

AddEntityHasValue mod func


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-12-2014 , 11:56   Re: AddEntityHasValue mod func
Reply With Quote #2

Yeah, you're right, each new entity created, you see a hash is created from its class name, for performance reason.
About the entity creation, I'm talking about pfnCreateNamedEntity, but in the mod, it basically uses a custom function, which calls pfnCreateNamedEntity and AddEntityHashValue, that's why, using AMXX it doesn't work because it calls directly the engine function.

Also, the game is using a custom function UTIL_FindEntityByString to find an entity, which basically loops over the hash table.
Right now it supports only the classname. "hash_types_e" is just an enum (has only one item defined for classname and it's 0 as value), so you can replace by "int". The same.

You can actually see the actual hash map using the server command print_ent.
And you can see the difference in performance using without and with hash using this command : perf_test

You can use arg_int for last param for okapi.
You could also use CREATE_NAMED_ENTITY() from the mod, the custom function I'm talking about.

This could be a good idea to add it to cstrike module since specific to CS, maybe either cs_create_entity or natives to add/remove hash item, don't know.
__________________

Last edited by Arkshine; 11-12-2014 at 12:05.
Arkshine is offline
 



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 17:34.


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