Author Topic: Persistent world database?  (Read 563 times)

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent world database?
« on: April 03, 2015, 07:29:45 am »


               

Okay, anyone using the NDBE system of KNAT? http://nwn.wikia.com...Persistence_API


 


Can anyone tell me what your opinion/experience with this is? And if it is actually viable for me to use it?


 


(also a bit foggy on how to actually install it, since I tried but it does not work.....apparently....) 


 


in any case thank you for your help!



               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Persistent world database?
« Reply #1 on: April 03, 2015, 02:28:22 pm »


               

Yes, we've been using it on Thay for 7+ years now. Other than a strange problem with a rather large player housing furniture database -which I can't say definitively was due in any part to how the NBDE system works- it's worked very well.


 


Whether or not it will work for you depends on what you plan to use the databases for. Flushing the databases (actually writing the files to the disk) is what is the slowest and most resource intense, which is probably the main reason there is such a low opinion of Bioware DBs across most the community. So I'd recommend making sure you are only flushing/saving the databases when you really need them.


 


Just as an example of how we try to limit usage of NBDE and Bioware databases - persistent info that needs to possibly be recalled across players or PCs is stored in the database (such as who and how many people are in a faction, or in what areas player-owned merchants need to be recreated when the module loads, or where a player-owned house is located and all the furniture that needs to go into it if someone enters it, etc). Whereas almost anything that is PC-specific is stored on a non-droppable item in the PC's inventory (such as the amount of gold in their vault, or how various NPCs feel about the PC, their mount/horse info, and so on).



               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Persistent world database?
« Reply #2 on: April 03, 2015, 03:08:21 pm »


               

I have tried it in the past and had no problem. Still, if you're at the stage of planning/building your DB system, you should seriously consider using MySQL right from the start, talk about flexibility.


 


 


Kato 



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent world database?
« Reply #3 on: April 03, 2015, 03:52:45 pm »


               

@ Thayan Ah, thank you. My plans for the database are mainly for storing character data (preferably periodically). Right now not planning so much for it. So it will remember a character has died when he/she/it has not respawned before server resets. And saving faction reputation of the character.


 


@Kato Hmm, I never worked with MySQL  before.... but yes I am still very much in the process with building and scripting. '<img'> 



               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Persistent world database?
« Reply #4 on: April 03, 2015, 04:07:45 pm »


               

Ah, well, considering you need to store only a few infos(without any special manipulation), the Bio DB could indeed do the job. If you anticipate your needs to grow, though, MySQL is unbeatable.


 


 


Kato



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent world database?
« Reply #5 on: April 03, 2015, 08:25:38 pm »


               

the problem I am having with this system is that I am a bit fuzzy on how to actually get this to work. I followed the instructions but it does not seem to do what it should. Also was not entirely sure into what files I had to add the #include "something something" in the script since I was not sure which actually were required to make the system running (also does not help that English is not my native language and that I at times struggle with the meaning of a sentence.....yay for challenge....) 



               
               

               
            

Legacy_Terrorble

  • Sr. Member
  • ****
  • Posts: 370
  • Karma: +0/-0
Persistent world database?
« Reply #6 on: April 04, 2015, 06:42:50 am »


               

I never could get MySQL setup either.


 


Refering back to what Thayan said about storing data.  If you have information that is potentially needed by all players and it needs to persist between resets, then you need the DB.  If the information is specific to the player about their stats, quest progress, faction reputation, etc then the non-droppable inventory item is very good for that.



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent world database?
« Reply #7 on: April 04, 2015, 08:09:27 am »


               


I never could get MySQL setup either.


 


Refering back to what Thayan said about storing data.  If you have information that is potentially needed by all players and it needs to persist between resets, then you need the DB.  If the information is specific to the player about their stats, quest progress, faction reputation, etc then the non-droppable inventory item is very good for that.




Yup! I am aware of this! However I am not entirely sure how to implement that system (The bio extender DB of KNAT) into my module. Seeing that it said that I have to add a certain line to specific DB-required scripts (or better said scripts that the DB needs to get its info from) 


 


So I am a bit puzzled how to do this, sure there is a tutorial on how to do it but.....it is not very clear in my honest opinion.


 


anyway thanks in advance people '<img'> 


               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Persistent world database?
« Reply #8 on: April 04, 2015, 04:03:12 pm »


               

Tell you what, if you use nwnx and you ever choose to use MySQL and need help with the DB setup/design, send me a PM and we'll get through this at light speed.


 


 


Kato 



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent world database?
« Reply #9 on: April 05, 2015, 03:47:47 pm »


               


Tell you what, if you use nwnx and you ever choose to use MySQL and need help with the DB setup/design, send me a PM and we'll get through this at light speed.


 


 


Kato 




well, if you could that would be simply awesome! '<img'> 


               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Persistent world database?
« Reply #10 on: April 05, 2015, 04:10:10 pm »


               

NBDE is not too difficult to use. Probably easier to figure out than installing and learning a bend new DB system if you've already been using the built-in DB functions. But do what you like, obviously. If you want to try and stick with NBDE, once you import the NBDE package into your module, there are three main steps -


 


1. Place the NBDE Database container (placeable container) somewhere in the module that players cannot get to so they cannot open it.


 


2. Do a find across all the scripts in your module for the Get or SetCampaign functions. At the top of all those scripts, add the NBDE library by putting this at the top of the script:


#include "nbde_inc"


 


3. Finally, you replace all the regular Get/SetCampaign functions with the NBDE_ wrapper version of them. Or basically, just put NBDE_ in front of all those functions. For any of the SetCampaign functions, you will all need to place the FlushCampaignDatabase("DB_NAME") function after them at some point to physically save them from where they are temporarily store in that NBDE container to the actual database file.


 


As with everything, there are various things that might pop up or problems you might encounter. But if you read the instructions at the top of the nbde_inc, Kant did a very good job documenting the system and it should explain, in much more detail than this, the details of that system.



               
               

               
            

Legacy_Kato -

  • Hero Member
  • *****
  • Posts: 747
  • Karma: +0/-0
Persistent world database?
« Reply #11 on: April 05, 2015, 04:21:40 pm »


               

Okay, I'll need to send you a few files and technical infos and you'll be ready to go. If you don't mind, I prefer to team work via email instead of PM, so, when you're ready, email me: yoda2157@gmail.com.


 


 


EDIT: Beaten by the punch, choose as you wish '<img'>


 


 


Kato



               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent world database?
« Reply #12 on: April 05, 2015, 04:34:01 pm »


               


NBDE is not too difficult to use. Probably easier to figure out than installing and learning a bend new DB system if you've already been using the built-in DB functions. But do what you like, obviously. If you want to try and stick with NBDE, once you import the NBDE package into your module, there are three main steps -


 


1. Place the NBDE Database container (placeable container) somewhere in the module that players cannot get to so they cannot open it.


 


2. Do a find across all the scripts in your module for the Get or SetCampaign functions. At the top of all those scripts, add the NBDE library by putting this at the top of the script:


#include "nbde_inc"


 


3. Finally, you replace all the regular Get/SetCampaign functions with the NBDE_ wrapper version of them. Or basically, just put NBDE_ in front of all those functions. For any of the SetCampaign functions, you will all need to place the FlushCampaignDatabase("DB_NAME") function after them at some point to physically save them from where they are temporarily store in that NBDE container to the actual database file.


 


As with everything, there are various things that might pop up or problems you might encounter. But if you read the instructions at the top of the nbde_inc, Kant did a very good job documenting the system and it should explain, in much more detail than this, the details of that system.




Hmm sounds like it might be a bit of a brainer that one, seeing that on my module I do not really have scripts with campaign stuff in it (hell I build it all from scratch so most are still empty slots honestly)  


 


Only managed to fill up the respawn slot since I wrote my rather basic but nifty (even if I say so myself) respawn script.


 


but will let you know which one I will end up on using '<img'> 


               
               

               
            

Legacy_Who said that I

  • Hero Member
  • *****
  • Posts: 931
  • Karma: +0/-0
Persistent world database?
« Reply #13 on: July 14, 2015, 10:51:29 am »


               Hello again! So i have taken a little break from like....everything and now i am back and with renewed energy to keep building on my module. Now the db is STILL not setup (i know shame on me) so I would like to have some help with what I should have  and with the implementation of it (preferably on a step by step basis since i am rather slow on this subject xD)


What I currently am trying to work on the module which will probably requires a db to store it all is the following:


- player storage

- persistant housing

- rp reward system


Though not entirely sure if ilthe last one needs the db but just adding it for the just in case scenario.


Currently have the knat system half installed (meaning i imported the erf.)


Any help on this part would be grand obviously '<img'> (i apologie if i seem slow since english is not my first language so it will be a bit of a vhallenge for me)
               
               

               
            

Legacy_Thayan

  • Sr. Member
  • ****
  • Posts: 435
  • Karma: +0/-0
Persistent world database?
« Reply #14 on: July 14, 2015, 05:35:56 pm »


               

The first two are pretty big requests for one thread to really address it all. I'd suggest searching the new vault for Hunter's Housing and the storage system by Ophidios for persistent storage - I think it was called Secure Persistent Chest System. Although that storage system needs modifications to avoid certain exploits where unscrupulous players could duplicate items placed in storage containers, so maybe there are better ones than that. I know there are a number available so look through them and take your pick of which one might work best for you.


 


For your reward system, you might want to lay out in more detail what you want to accomplish with it and any limitations or guidelines you want to impose.