Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Item System Storage (https://forums.graalonline.com/forums/showthread.php?t=134257424)

Immolate 12-23-2009 12:51 PM

Item System Storage
 
My task is to create an item system. I was just wondering what everybody's opinions are on the storage of data. I'm not too worried about your caching opinions but if you want to make them known, I'm more than happy to take advise.

Twinny 12-23-2009 01:22 PM

For me, both files and SQL works since I load them into a DBNPC. Both ways work since it's a one off read. SQL seemed pretty slow when dealing with alot of requests for me (which was really weird) so I wouldn't recommend storing and reading items out of it constantly.... works really well for logs though =D

For ease of use (and the fact I don't use the files live) I recommend file based

Immolate 12-23-2009 01:36 PM

Quote:

Originally Posted by Twinny (Post 1546501)
For me, both files and SQL works since I load them into a DBNPC. Both ways work since it's a one off read. SQL seemed pretty slow when dealing with alot of requests for me (which was really weird) so I wouldn't recommend storing and reading items out of it constantly.... works really well for logs though =D

For ease of use (and the fact I don't use the files live) I recommend file based

I guess that could work pretty well :)

Twinny 12-23-2009 01:41 PM

Quote:

Originally Posted by Immolate (Post 1546503)
I guess that could work pretty well :)

Truth be told, could just skip the loading part and code it straight into the dbnpc >_<

Immolate 12-23-2009 01:59 PM

Quote:

Originally Posted by Twinny (Post 1546504)
Truth be told, could just skip the loading part and code it straight into the dbnpc >_<

That's what I used to do when I only needed to create and manipulate items. I'm thinking loading from text-files into a DBNPC cache would make things easier when people want to manipulate items in the event I'm not around.

Though, it'd still be nice to hear what other people have to say on the matter.

Chompy 12-23-2009 02:05 PM

I have to say files. Easier to manage and work with if you are offline (You can write up items and all that stuff when you're missing an internet connection. Just upload them when you get internet back.)
I usually just store all the information in files, and then cache them for faster access.

It's just so much easier doing object.loadvars(filepath), instead of having to hazzle with requests and such with SQL..

It's personal preference to a certain degree though.

Immolate 12-23-2009 02:08 PM

Quote:

Originally Posted by Chompy (Post 1546509)
I have to say files. Easier to manage and work with if you are offline (You can write up items and all that stuff when you're missing an internet connection. Just upload them when you get internet back.)
I usually just store all the information in files, and then cache them for faster access.

It's just so much easier doing object.loadvars(filepath), instead of having to hazzle with requests and such with SQL..

It's personal preference to a certain degree though.

Thanks for your input :)

fowlplay4 12-23-2009 05:45 PM

Files + DB Cache for Base Arc Data, and SQLite for storing player's item info (quantity, custom modifiers, etc.).

It's so much easier to do trades with SQLite, since you can just make the updates in one transaction, then have them both reload their items. Plus it makes the backing up of player data a simple one file backup.

xXziroXx 12-23-2009 05:46 PM

SQLite is by far the easiest and most powerful way of doing it.

Chompy 12-23-2009 06:41 PM

Quote:

Originally Posted by xXziroXx (Post 1546537)
SQLite is by far the easiest and most powerful way of doing it.

Could you elaborate on that?

xXziroXx 12-23-2009 06:46 PM

Quote:

Originally Posted by Chompy (Post 1546544)
Could you elaborate on that?

Not too much to elaborate on. SQLite database is a huge total filesize decrease comparing to plain files, it's faster loading/altering of data, it's *A LOT* easier to find specific data across the entire table then searching through all files. And the biggest pro of them all: save one, that's right - ONE, file on your computer and your entire servers database is backed up.

I could most probably list a lot more reasons why SQLite is superior, but the above ones are the ones that convinced me.

Chompy 12-23-2009 06:49 PM

Quote:

Originally Posted by xXziroXx (Post 1546546)
Not too much to elaborate on. SQLite database is a huge total filesize decrease comparing to plain files, it's faster loading/altering of data, it's *A LOT* easier to find specific data across the entire table then searching through all files. And the biggest pro of them all: save one, that's right - ONE, file on your computer and your entire servers database is backed up.

I could most probably list a lot more reasons why SQLite is superior, but the above ones are the ones that convinced me.

So you would store all information that is important or used by all of your systems in one SQL database?

Do you only use SQL or some combo as Jerret described in his post?

Edit; What if you have a player that had it's player data glitched, and you need to restore their old values from the old SQL backup, what would you do then? Install a third party software to view the table wanted and then manually query a change in the current SQL DB with the old backup data? (Seeing as requestsql2() isn't working as far as I've seen)

SKJF91 12-23-2009 06:50 PM

For some reason, SQLite seems to have a high cpu usage on a few queries with graal though :/

xXziroXx 12-23-2009 06:57 PM

Quote:

Originally Posted by Chompy (Post 1546547)
So you would store all information that is important or used by all of your systems in one SQL database?

I so far store items, items owned by players, skills, quests, spells and recipes in my SQLite database. So yes, I guess you could say I store all important information in it.

Quote:

Originally Posted by SKJF91 (Post 1546549)
For some reason, SQLite seems to have a high cpu usage on a few queries with graal though :/

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).

Immolate 12-23-2009 07:13 PM

Quote:

Originally Posted by xXziroXx (Post 1546554)
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).

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.


All times are GMT +2. The time now is 08:39 AM.

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