logo logo

 Back to main page

The NWNX Community Forum

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
MySQL connectivity from Toolset makes its debut.

 
Post new topic   Reply to topic    nwnx.org Forum Index -> Development
View previous topic :: View next topic  
Author Message
chris421



Joined: 07 Apr 2005
Posts: 53

PostPosted: Sat May 26, 2007 7:59    Post subject: MySQL connectivity from Toolset makes its debut. Reply with quote

Oh the possibilities...

Wanted to bring up something else important.

My C skills are unfortunately pretty weak. For about a week now I've been trying to rewrite the current NWNX4 MySQL plug-in in which instead of writing dumb BLOBs of object GFFs to the database, I'd actually parse them out to XML and dump those as unique tables (not rows) themselves. Storing BLOBs = bad in a database, or so I'm told.

Got the bright idea to also create variant MySQL DLLs for every game OBJECT_TYPE, establishing a unique listener keyword in NWNX to direct storage of each object type to multiple logical databases (via multiple .INIs), i.e., if objecttype = PC, parse and store in "NWNX_PC" db…If objecttype=ITEM, parse and store in "NWNX_ITEM" db…etc. That would eliminate potential table name collisions/clutter and could open up distributed databases, not necessarily running on the same MySQL server.

BLOB objects in db makes retrieving everyday, mundane values a big pain and creates a terrible hit to the db since the whole unindexed BLOB gets read to find them.

If a NWNX4 GFFStream-to-XML-to-MySQL (and vice versa) parser became a reality, commonly tracked PW values like player gold, health, spells/feats, and loc would be readily available. So it would cut down on duplicate writes to the databases for the anti-cheat type values. Also by having PCs written to their own databases, the MySQL server could have a recurring job on that specific database to reBLOB and export as .BIC to disk, hence eliminating the duplicate write from the module heartbeat EXPORT players function.
Back to top
View user's profile Send private message
nosfe



Joined: 25 Apr 2007
Posts: 22

PostPosted: Sat May 26, 2007 9:11    Post subject: Reply with quote

greeting chris,

Good I also thought several days of this problem of file [.BIC <-> XML <-> MySQL]; Knowing that I immediately eliminated the possibility of: [.BIC <-> MySQL (Blob] bus really too heavy.

On the other hand to use MySQL to store the name of file .BIC, its version, and dates it from the last modification, for then managing files .BIC in command line out from the play (example: backup with Cobian Backup).
For the important information storage that one wants in MySQL for a use out from the play, it is enough to pass from [.BIC <-> XML <-> MySQL] from important information;

The ideal it would be a library of functions NWNX which launches the serialisation/deserialisation of GFFStream towards or since MySQL, but not of all the fields which is in .BIC bus too much much are without utility.
Back to top
View user's profile Send private message
chris421



Joined: 07 Apr 2005
Posts: 53

PostPosted: Sat May 26, 2007 18:07    Post subject: Reply with quote

Very true. A lot of extraneous info would end up being deBLOB'd and stored in MySQL for a player BIC that you might never have a use. Also there's the problem of the item objects on players--do you parse/store those too--in another db?

Still though, I have to believe disk IO is handled better by writes performed to MySQL vs. the in-game EXPORT char function. In fact you could make the default table creation type "MEMORY" and only commit to BIC when you needed (like when a player disconnects).

From a DBA point of view, the more intelligible info available on the players/items/objects, the easier they'd be to modify outside of the game mechanics via direct SQL queries. You could clean up inventories, fix skin properties, etc. without ever touching an 'onenter' script.
Back to top
View user's profile Send private message
nosfe



Joined: 25 Apr 2007
Posts: 22

PostPosted: Sun May 27, 2007 16:23    Post subject: Reply with quote

chris421 wrote:
Very true. A lot of extraneous info would end up being deBLOB'd and stored in MySQL for a player BIC that you might never have a use. Also there's the problem of the item objects on players--do you parse/store those too--in another db?


The true problem is which are the paramount data (fields) by not taking the parasitic data, of the inventory (or other) which when saved in MySQL, can be reintegrated in file .BIC without modifying the good format of the file and recreating the entirety of the object in the case of the inventory.

i.e., capacity to export a sword with the minimal data in mySQL and if one wishes to give a sword of this type there has another character apart from the play, capacity to do it with minimal information towards file .BIC;
in fact I do not know if I am clear: -)

What would make it possible to pass from BIC1-->MySQL with few important information but to be able to reinject it MySQL-->BIC2, which would give total libertée unconstrained.

Quote:

Still though, I have to believe disk IO is handled better by writes performed to MySQL vs. the in-game EXPORT char function. In fact you could make the default table creation type "MEMORY" and only commit to BIC when you needed (like when a player disconnects).


I am as convinced as in the long term it is to better store as much as possible in a data base such as MySQL;
But not superfluity, bare minimum for by overloading it for nothing, but suffisement to remake anything from this stored information

Quote:

From a DBA point of view, the more intelligible info available on the players/items/objects, the easier they'd be to modify outside of the game mechanics via direct SQL queries. You could clean up inventories, fix skin properties, etc. without ever touching an 'onenter' script.


yes, but the modifications made apart from the play, are very limited in the direction or one did not can remake all the rules of “checking”, “of follow-up” that the engine of never made for us. For example it is impossible to do one to level up, this is an exaggerated example I did it purposely.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    nwnx.org Forum Index -> Development All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group