Raised This Month: $ Target: $400
 0% 

Most efficient way of storing spawn data?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
nicatronTg
Member
Join Date: Jun 2009
Old 12-20-2009 , 02:28   Most efficient way of storing spawn data?
Reply With Quote #1

I'm working on a plugin that will allow players to spawn entities and interact with them, but I have the problem that I need to store who owns what(sort of like prop protection for Garry's Mod), and I'm not sure the most effective way of doing it. The only way I can think of would be via key values and storing ent IDs and associated steam ids in there, but that's a huge amount of work for data that should be cleaned on map change. Any suggestions would be great!

Mod: Half Life 2 Deathmatch
__________________
nicatronTg is offline
FaTony
Veteran Member
Join Date: Aug 2008
Old 12-20-2009 , 05:32   Re: Most efficient way of storing spawn data?
Reply With Quote #2

Tagged arrays.
http://forums.alliedmods.net/showthread.php?t=109510
FaTony is offline
rhelgeby
Veteran Member
Join Date: Oct 2008
Location: 0x4E6F72776179
Old 12-20-2009 , 08:19   Re: Most efficient way of storing spawn data?
Reply With Quote #3

You should link client indexes to entity indexes.

Maybe like this:
PHP Code:
#define MAX_PROPS 64
new props[MAXPLAYERS 1][MAX_PROPS]; 
There's a limit on maximum props that can be linked. And you might want to initialize it with -1 on all entity indexes. Otherwise I can't think of a more efficient way of storing and parsing these indexes. Arrays like these are very fast, much faster than keyvalues and such.
__________________
Richard Helgeby

Zombie:Reloaded | PawnUnit | Object Library
(Please don't send private messages for support, they will be ignored. Use the forum.)
rhelgeby is offline
Send a message via MSN to rhelgeby
nicatronTg
Member
Join Date: Jun 2009
Old 12-21-2009 , 14:23   Re: Most efficient way of storing spawn data?
Reply With Quote #4

Hmm, I was looking into the latter example, but I'm not sure of an easy way to add data to that. Any advice/examples?

Edit: I also have to store a spawn list with around 2000 items in it in some way as well.
__________________

Last edited by nicatronTg; 12-21-2009 at 14:36.
nicatronTg is offline
phogillug
New Member
Join Date: Dec 2009
Old 12-21-2009 , 14:55   Re: Most efficient way of storing spawn data?
Reply With Quote #5

wamly welcome

Sure all pro gamer are most welcome... if you can reach out to them it would be great!! Thanks a lot
__________________
phogillug 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 16:25.


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