Author Topic: Item Database vs Campaign for Multiplayer  (Read 638 times)

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« on: October 03, 2013, 09:21:47 am »


               Back when I used to run my PW Evernight, I used item databasing exclusively. It was simple enough, and gave me the persistance I needed. How would an item database compare to a campaign database in this scenario?

I know most server admins have NWNX setup with MYSQL databases, and that makes sense to me for the large servers that have been up for years. With player counts the way they are now though, would a new server really need a MYSQL database? At what point do item and campaign databases reach their limits, and what happens when they do?

The module I'm working on currently is geared for singplayer, however I'm thinking of adapting it to have multiplayer support for a server and I'm curious if a campaign database would be supportive of that?
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #1 on: October 03, 2013, 03:29:52 pm »


               NWNX offers much more than persistence which is a major reason why it is used. I am working with a team that is using it for a project we will release soon and I am amazed at the things I can do now that I could not before.

However for persistence the Campaign Database in combination with storing data on items (I use the player skin) is adequate.

You should use Knat's database extender with the campaign database to improve performance.
And for using the player skin I suggest using Krit's skin override script.
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #2 on: October 04, 2013, 07:21:59 pm »


               To follow up on this a bit...

PC skin gets destroyed by the engine on loading the character if ELC is set. I've been fighting with that for a couple of days now and finally found a comment in the Omnibus record of the old forums. Been pulling my hair out over this...

I don't have a pointer to the online omnibus handy, but the thread I found it in was "x3_inc_skin and sequels"

the Krit (of skin override fame mentioned above and other nice things) said :
"Yeah, well that comment was written based on theory, and was never updated to reflect what happens in practice. In theory, storing variables on the skin item is a way to have persistence. However, this is actually only true for multiplayer, as local variables get wiped from items in single player (well, any local vault game if I recall correctly). Furthermore, this idea fails when ELC or ILR is enabled, as enabling either of those will cause the skin item to be destroyed upon entering the module.
So basically, skin variables are only useful in server vault games with both ILR and ELC off."

NWNX is great. I'm just scratching the surface, but even just the mysql support is worth it.

- meaglyn
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #3 on: October 04, 2013, 10:07:47 pm »


               

meaglyn wrote...

PC skin gets destroyed by the engine on
loading the character if ELC is set. I've been fighting with that for a
couple of days now and finally found a comment in the Omnibus record of
the old forums. Been pulling my hair out over this...


That was addressed by henesua already.

henesua wrote...
You should use Knat's database extender with the campaign database to improve performance.


Knat stores an item on a database keeping all local variables persistently through module changes/ server reboots.  Essentially you get the benefits of local storage merged into the persistence of database storage,  at the cost of a server crash destroying the item data before it can make it to the database.
               
               

               
            

Legacy_Shadooow

  • Hero Member
  • *****
  • Posts: 7698
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #4 on: October 04, 2013, 10:15:26 pm »


               

WhiZard wrote...

meaglyn wrote...

PC skin gets destroyed by the engine on
loading the character if ELC is set. I've been fighting with that for a
couple of days now and finally found a comment in the Omnibus record of
the old forums. Been pulling my hair out over this...


That was addressed by henesua already.

how? i havent noticed that The Krit's override handles this neither that henesua mentioned this issue

its a problem and due to this it is not recommended to use skin for storing variables

it is solveable but its quite trickery to set up and affect many module events so rather stay away from skin '^_^'
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #5 on: October 04, 2013, 10:21:18 pm »


               

WhiZard wrote...

That was addressed by henesua already.

henesua wrote...
You should use Knat's database extender with the campaign database to improve performance.


Knat stores an item on a database keeping all local variables persistently through module changes/ server reboots.  Essentially you get the benefits of local storage merged into the persistence of database storage,  at the cost of a server crash destroying the item data before it can make it to the database.



No, actually it wasn't at all... read it again.

Using Knat's ndbe has nothing to do with persistence using PC skin.

Henesua talked about improved performance for storing campaign variables. But he also said he used both and pointed to The Krit's skin update.

Storing things on the PC skin is a different, unrelated, way to do persistence. And should
work as long as you don't use ELC on the server and use the servervault.

Cheers,
meaglyn
               
               

               
            

Legacy_WhiZard

  • Hero Member
  • *****
  • Posts: 2149
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #6 on: October 04, 2013, 11:12:30 pm »


               

meaglyn wrote...

Using Knat's ndbe has nothing to do with persistence using PC skin.


You are aware that with Knat's system, an item like a skin can be a "vault".
               
               

               
            

Legacy_The Amethyst Dragon

  • Hero Member
  • *****
  • Posts: 2981
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #7 on: October 04, 2013, 11:26:59 pm »


               I use individual PC-held items as data storage, rather than the bioware or other database.  Instead of the "skin", I give each PC a tiny 1 square  misc. item, set to plot, non-droppable.

I used to use NBDE, but found that after a while it started to sometimes lose data, probably because I store a lot of variables for each PC.

Going the individual data item route has proved to be fast and I haven't had PCs lose any data to date (and it's been several years).

I do use NWNX with my server, just not for database functionality.
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #8 on: October 04, 2013, 11:56:59 pm »


               

WhiZard wrote...

meaglyn wrote...

Using Knat's ndbe has nothing to do with persistence using PC skin.


You are aware that with Knat's system, an item like a skin can be a "vault".


Sure, but that was not the point '<img'>

The x3_inc_skin mechanism of persistence (original or Krit's rewrite) relies on  the skin item being present when the player comes back. You could save it off as an object in the campaign DB (with or without NBDE), but that would be using Bioware DB for persistence not PC skin.  Henesua's post does not, to me, imply doing it that way.

Btw, I was not being critical of Henesua but pointing out for other server noobs like myself that using the skin as written does not work if you use ELC.  This was not obvious to me and cost me a lot of time.
               
               

               
            

Legacy_henesua

  • Hero Member
  • *****
  • Posts: 6519
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #9 on: October 05, 2013, 02:28:16 am »


               

meaglyn wrote...

WhiZard wrote...

meaglyn wrote...

Using Knat's ndbe has nothing to do with persistence using PC skin.


You are aware that with Knat's system, an item like a skin can be a "vault".


Sure, but that was not the point '<img'>

The x3_inc_skin mechanism of persistence (original or Krit's rewrite) relies on  the skin item being present when the player comes back. You could save it off as an object in the campaign DB (with or without NBDE), but that would be using Bioware DB for persistence not PC skin.  Henesua's post does not, to me, imply doing it that way.

Btw, I was not being critical of Henesua but pointing out for other server noobs like myself that using the skin as written does not work if you use ELC.  This was not obvious to me and cost me a lot of time.




I am sorry for the confusion about my post. I simply wanted to point out two possibilities for persistence - the campaign database, and the PC skin. I use the two separately, but that wasn't necessarily true from my post.

I appreciate the discussiont hat came out of this though, because I learned something new. I did not realize that ELC and ILR can lead to the destruction of PC Skins. That is very interesting. I didn't notice this because I've always turned these off on my own servers.

I'll have to update my work on Innocuous Familiars to take this into account because the persistence in that system uses the PC skin.
               
               

               
            

Legacy_meaglyn

  • Hero Member
  • *****
  • Posts: 1451
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #10 on: October 05, 2013, 03:18:00 am »


               

henesua wrote...

I am sorry for the confusion about my post. I simply wanted to point out two possibilities for persistence - the campaign database, and the PC skin. I use the two separately, but that wasn't necessarily true from my post.


I did not mean to imply that your post caused me issues, if I did.  I took it as two separate possibilities. I was already developing a system using mysql for module and NPC data and skin for PC specific things. And was fighting with it not working. Debugging eventually led me to notice the skin not being there on client enter, even though it was in the bic file.

As I said, I thought the information was apropos and might be useful to others...
               
               

               
            

Legacy_EzRemake

  • Full Member
  • ***
  • Posts: 220
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #11 on: October 05, 2013, 04:19:01 am »


               I'm curious, if I only use local variable storage on items what are the limits? If I store a few hundred variables on a player's "storage" item will that really bog down anything in the grand scheme of things?

No one has really discussed what happens if you don't use MYSQL. Do things eventually just get so out of hand that the server loads slowly / crashes?
               
               

               
            

Legacy_GhostOfGod

  • Hero Member
  • *****
  • Posts: 1490
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #12 on: October 05, 2013, 10:01:42 am »


               I wish that I could remember precisely the thread that discussed the limits of variables on items but it's been too many years. From memory it was determined that you can hold a few thousand variables on an item before you run into any issues.
               
               

               
            

Legacy_FunkySwerve

  • Hero Member
  • *****
  • Posts: 2325
  • Karma: +0/-0
Item Database vs Campaign for Multiplayer
« Reply #13 on: October 05, 2013, 07:43:29 pm »


               The number was about 5k, and that was before running into any significant increase in Get times, if it's the thread I think you're talking about. I wouldn't really say 'any issues', though, since all those vars are going to bloat the size of your bicfile. Of course, the alternative is just having them bloat some alternate file/s, when it comes down to it.

Funky