So working on my multiplayer mod and I am wondering if there is any advantage to having more than one database in the mod.
I was thinking that I might have DB’s that are character or user specific. So one for each character, one for persistent housing, one for event flags, etc. The thought was to, more or less, use them as one might tables in a proper database.
Anyone know if that has any sort of performance benefit / hit?
It looks like you want one of the NWN forums.
Yes, it can be. If you use the Campaign functions or one table for all data then it might after thousands data stored in db starting to be slow. By using different db name for each task you can avoid this.
However do not use special db per player if this is a multiplayer server. You don’t want thousands of database files to be created .
I use just one database, but a custom table for each task. That however requires some experiences to set it up and there are no hints in toolset how to do it.
Dang it sorry about that I will move it to the NWN 1 forums
It will be multplayer but a closed world not a persistent one as such. There might be, at most, half a dozen players who hopefully only create one or two characters each.
I am going to experiment a little and see how it works out. Anyone have a good idea on how to avoid a Player have 2 characters with the same name? I don’t expect it to happen but if it did I’d rather not have the DB from one show up in the other.
Use an unique identifier for each player and store it under that variable name. But for that you need to make your own database table or use a direct SQL call, Campaign functions will always store under the “charname+account” variable. Theoretically though, you could create a placeable in system area when player logs in and give this placeable his unique id as a tag. Then store the campaign variable under this placeable istead of player character. That should work and avoid the need to create table or use the SQL functions.
Makes sense and I was kind of thinking that as well. I will see what I can come up with to perhaps generate a unique variable automatically from the character data.
Honestly it’s a small group of friends that will be playing this so I am probably WAY overthinking things here but that’s also how my brain works. I expect 70% of what I have built either won’t get found/seen or won’t really be noticed
I know you can edit your “story” when you create the character and the player can’t edit it afterwards in game. Is there a scripting command that will let me do that I wonder. I could assign an identifier there (and look for it of course). That would stick with the player regardless of what they do and so long as it increments could not be duplicated.
Does anyone know if GetDescription and SetDescription work with PC objects? If so I could get it then add something like (ID:cXXXX) with XXXX just being a counter starting and 0001 and moving up with each newly created Character.
SetDescription/GetDescription works with PCs.
You can now use SetTag in NWN:EE. Or just give them a 1x1 undroppable/cursed item into inventory. I know it is not as professional, however this option has additional benefit of allowing to store variables on it which can act as player-related persistent database. For anything you want persistent and doesn’t need to be accessible without player being present in server it is a perfect solution that preserves resources.