Game Development Community

Storing inventory...

by Daniel Brown · in Torque Game Engine · 07/22/2004 (4:26 am) · 3 replies

What is the best way to store inventory details on the server for about 50 - 100 objects? I need a way to store the item id and quantity thats all, but im not sure of the best way to do it. Linked List? a database? write to a file? or something else.

Thanks

#1
07/22/2004 (6:22 am)
I'm assuming by "store" you mean something more persistant than just RAM. Given the simplicity of what you have a file would be just fine. My weapon of choice for more complicated data is MySQL. That is especially true if I might want to have some "admin" type scripts written in Perl or something for maintanence or reporting or what-have-you.
#2
07/23/2004 (8:15 am)
50 items... array may be a little faster than linked list... but not significantly so.
#3
07/23/2004 (3:43 pm)
If you are storing data server-side, if you have access to a database server I'd recommend that first off.

Beyond that if you don't have access to a DB server or you are going to save the data client-side I'd recommend using XML and getting the pickle/unpickle code from the Resources section. It saves whole datablocks and reads them in as same.

Good stuff for plug-and-play persistance.