Raised This Month: $ Target: $400
 0% 

question about performance


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 10-01-2009 , 23:02   question about performance
Reply With Quote #1

what's better?

Case 1:
  • Create entity
  • Use entity
  • Remove entity
  • ....
  • Create another entity
  • Use entity
  • Remove entity
  • ....
  • Create another entity
  • Use entity
  • Remove entity

Case 2:
  • Create entity
  • Use entity
  • Hide entity (because now it's unused)
  • ....
  • Reuses old entity
  • Hide entity
  • ....
  • Reuses old entity
  • Hide entity
  • Remove entity

I think the second case it's better.

Another question.
What's the best method to hide that entity? Set origin to some location outside the map?

Thanks
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 10-02-2009 , 00:49   Re: question about performance
Reply With Quote #2

How often (approximately) is this process?

Hiding can be achieved several different ways, origin somewhere weird, changing render values, setting a blank model, and more. Just choose whatever you want.
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-02-2009 , 04:41   Re: question about performance
Reply With Quote #3

Even if it's not called often, if you can reuse the same entity, go for that. Is it possible to see an example of what you want to do, what entity you want to use etc.
__________________
Arkshine is offline
joropito
AlliedModders Donor
Join Date: Mar 2009
Location: pfnAddToFullPack
Old 10-02-2009 , 09:10   Re: question about performance
Reply With Quote #4

Quote:
Originally Posted by Arkshine View Post
Even if it's not called often, if you can reuse the same entity, go for that. Is it possible to see an example of what you want to do, what entity you want to use etc.
I'm going to manage weapon health using func_breakable (on-hand, on-ground)

I need to choose the method to manage the quantity of weapons on map.

For example, if I'm going to create one breakable for each weapon in a map, for a 32 slots server, i would have around 64 entities but if you have unlimited buytime could be more.

So one way is to create one entity for each weapon but I'm not sure if it's the best way (the advantage with this is to store health and relations to real weapons on each entity).

When reusing entities, I need to store damage and relations in arrays.

I don't have this implemented yet so I don't have code to show.
__________________

Divide et vinces
approved plugins | steam account

I don't accept PM for support. Just ask on forums.
If you're looking for private work, PM me.
joropito is offline
Send a message via MSN to joropito
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-02-2009 , 09:36   Re: question about performance
Reply With Quote #5

Not sure if it's worth to do it. Even if I would prefer to reuse. Well do the both and profile them.
__________________
Arkshine 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 22:37.


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