Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

View Poll Results: Best way to store item data
SQLite 5 55.56%
Files 2 22.22%
DBNPC 2 22.22%
Voters: 9. You may not vote on this poll

Reply
 
Thread Tools Search this Thread Display Modes
  #16  
Old 12-23-2009, 07:57 PM
SKJF91 SKJF91 is offline
Registered User
Join Date: Dec 2009
Location: United States of America
Posts: 89
SKJF91 will become famous soon enough
Quote:
Originally Posted by xXziroXx View Post
Care to show examples? Only time I've experienced that is when I used SQLite queries in a very bad way (I've learned how to properly work with it since) or excessive use of VACUUM (which obviously gives high CPU usage).
Just simple queries, inserting, selecting etc.. - and I know how to use proper queries such as JOIN etc although i'm unsure if sqlite supports all of that like mysql does.
Reply With Quote
  #17  
Old 12-23-2009, 08:21 PM
salesman salesman is offline
Finger lickin' good.
salesman's Avatar
Join Date: Nov 2008
Location: Colorado
Posts: 1,865
salesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud ofsalesman has much to be proud of
Quote:
Originally Posted by SKJF91 View Post
Just simple queries, inserting, selecting etc.. - and I know how to use proper queries such as JOIN etc although i'm unsure if sqlite supports all of that like mysql does.

I'm not convinced that the CPU usage for SQL queries is entirely accurate.
Reply With Quote
  #18  
Old 12-23-2009, 08:50 PM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
I find files to be much easier than SQL, especially ini files.

From experiencing both, I think I'd have to go with Jerrets suggestion though, I'd use ini files for item data, and SQL for individual player data.

I personally think SQL is being way over estimated by everyone lately. It surely is very useful, especially with nice tools like Chris Vimes SQL Explorer, but it's not the perfect, beat all solution.
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #19  
Old 12-23-2009, 08:55 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Quote:
Originally Posted by coreys View Post
but it's not the perfect, beat all solution.
I'd actually say it is.
__________________
Reply With Quote
  #20  
Old 12-23-2009, 08:57 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
On Era Dev we're using files for storing item data (items/weapons/guns/ak47.txt, for example), and then using SQL to store individual player data, e.g. the items the player has and the quantity of the item they have. If you index it properly, it's pretty fast.

It seems to be working quite well, though we hope to find out just how well with the iPhone server.

EDIT: I should mention that we're caching the items into a DB NPC to prevent tons of file I/O and slowdowns.
__________________
Reply With Quote
  #21  
Old 12-24-2009, 03:33 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by Immolate View Post
It would be really handy if you could provide tips and examples on how to properly work with it, since all I know is the basic syntax.
Quote:
Originally Posted by SKJF91 View Post
Just simple queries, inserting, selecting etc.. - and I know how to use proper queries such as JOIN etc although i'm unsure if sqlite supports all of that like mysql does.
http://www.sqlite.org/lang.html
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #22  
Old 12-24-2009, 05:17 AM
SKJF91 SKJF91 is offline
Registered User
Join Date: Dec 2009
Location: United States of America
Posts: 89
SKJF91 will become famous soon enough
Quote:
Originally Posted by Switch View Post
And why are you sending this to me..?
Reply With Quote
  #23  
Old 12-24-2009, 07:26 AM
Switch Switch is offline
o.o
Switch's Avatar
Join Date: Jan 2007
Location: Philadelphia
Posts: 3,038
Switch has a spectacular aura about
Send a message via MSN to Switch
Quote:
Originally Posted by SKJF91 View Post
And why are you sending this to me..?
Hmm...
Quote:
Originally Posted by SKJF91 View Post
although i'm unsure if sqlite supports all of that like mysql does.
__________________
Oh squiggly line in my eye fluid. I see you lurking there on the peripheral of my vision.
But when I try to look at you, you scurry away.
Are you shy, squiggly line?
Why only when I ignore you, do you return to the center of my eye?
Oh, squiggly line, it's alright, you are forgiven.
Reply With Quote
  #24  
Old 12-24-2009, 01:28 PM
Immolate Immolate is offline
Indigo
Join Date: Dec 2009
Posts: 322
Immolate is on a distinguished road
Quote:
Originally Posted by SKJF91 View Post
And why are you sending this to me..?
I'm thinking the same thing. I did say I knew the syntax but what I was asking for was tips on optimization from scripters who know how to use it properly.
Reply With Quote
  #25  
Old 12-24-2009, 06:49 PM
SKJF91 SKJF91 is offline
Registered User
Join Date: Dec 2009
Location: United States of America
Posts: 89
SKJF91 will become famous soon enough
Quote:
Originally Posted by Immolate View Post
I'm thinking the same thing. I did say I knew the syntax but what I was asking for was tips on optimization from scripters who know how to use it properly.
Well I see why he was sending me it, so I retract my statement .
Reply With Quote
  #26  
Old 12-24-2009, 06:53 PM
Immolate Immolate is offline
Indigo
Join Date: Dec 2009
Posts: 322
Immolate is on a distinguished road
Quote:
Originally Posted by SKJF91 View Post
Well I see why he was sending me it, so I retract my statement .
I get the feeling he was trying to be a smart arse.
Reply With Quote
  #27  
Old 12-24-2009, 07:56 PM
SKJF91 SKJF91 is offline
Registered User
Join Date: Dec 2009
Location: United States of America
Posts: 89
SKJF91 will become famous soon enough
Quote:
Originally Posted by Immolate View Post
I get the feeling he was trying to be a smart arse.
Possibly.
Reply With Quote
  #28  
Old 12-25-2009, 12:55 AM
coreys coreys is offline
N-Pulse Assistant Manager
coreys's Avatar
Join Date: Mar 2005
Posts: 2,180
coreys has a spectacular aura about
Send a message via AIM to coreys Send a message via MSN to coreys Send a message via Yahoo to coreys
Quote:
Originally Posted by Immolate View Post
I get the feeling he was trying to be a smart arse.
No, he would have been if he send you this:
http://lmgtfy.com/?q=sqlite
__________________

Quote:
*SlikRick: so should I even ask about your aim status?
*Xor: well if you want to
*Xor: but i am LARPING
*SlikRick: While on a computer?
*Xor: yes
*Xor: in my living room
*SlikRick: ahh
*Xor: i have a fort setup to hide from beasts
Reply With Quote
  #29  
Old 12-25-2009, 01:03 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
Quote:
Originally Posted by coreys View Post
No, he would have been if he send you this:
http://lmgtfy.com/?q=sqlite
Aha, that's awesome.
__________________
Reply With Quote
  #30  
Old 12-25-2009, 01:40 AM
cyan3 cyan3 is offline
Registered User
cyan3's Avatar
Join Date: Nov 2005
Location: England
Posts: 2,919
cyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant futurecyan3 has a brilliant future
Quote:
Originally Posted by coreys View Post
No, he would have been if he send you this:
http://lmgtfy.com/?q=sqlite
I've been looking for that link for a while
thanks.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 +2. The time now is 08:43 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.