SQL (Help!)

Ideas and suggestions for game mechanics and rules.
Locked
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

SQL (Help!)

Post by Teric neDhalir »

In the install instructions AL sent with the ACR release for the OAS AL said:

Step 4: Installing NWNx4 and connecting to the central SQL database. NWNx4 is a package that works with nwn2server.exe to allow it to talk to database servers, allowing us to have true crosserver persistency for nearly everything associated with the modules. An ACR-enabled module will not allow players to join if it cannot connect to an SQL database properly (they are booted as they try to join). If you want to test your module locally, you can install mySQL on your server machine, and set your files to point at the local database.

This is completely outside my experience, but I have been thrashing away at it and have got to the point where I can use NWNX4 to load the mod and log on to it as a DM. This has fixed some of the problems I was having such as spawns not working. When I try and log on as a PC, however, I do indeed get booted. I think the problem is that I am using the SQLlite dll (which works with their demo) rather than MySQL. I'm afraid I don't understand the settings in the MySQL.ini file for server name etc. and how I'm supposed to set it up to work on my machine. Any pointers would be gratefully received. (Actually I'd like idiot-proof instructions in words of one syllable, if possible).

Teric
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

Teric: are you trying to use a local SQL database for testing? You'll need to have SQLite or MySQL installed and running on your host machine in order to join a module with a PC or get persistency running properly- unless you want to try connecting to the central SQL database that Hialmar is hosting, in which case we'll have to make sure nothing conflicts with the hosted OAS2 (which is currently reading from and writing to that one).

I think getting a basic MySQL setup running locally is the best longterm solution for you, if you want to be testing persistency-requiring systems like static quests and such. I walked Wynna through such a setup via IRC a few days ago, I'd be happy to do the same for you if you have time.

If not, I'll try to get a step-by-step tutorial written up.
User avatar
Wynna
Dungeon Master
Posts: 5734
Joined: Sat Jan 03, 2004 10:09 am
Location: Seattle, WA (PST)

Post by Wynna »

Not only did he walk me through, he held my hand and wiped my tears through the ordeal...and it seems to have been a successful effort. Good luck, Teric!
Enjoy the game
User avatar
ç i p h é r
Retired
Posts: 2904
Joined: Fri Oct 21, 2005 4:12 pm
Location: US Central (GMT - 6)

Post by ç i p h é r »

A tutorial would be great to have. The only other alternative is to setup and use a test schema. The beta one can probably assume that role as I expect we'll run with a separate, clean schema for all LIVE servers.
User avatar
Aelred
Builder
Posts: 316
Joined: Mon Feb 21, 2005 5:38 am
Location: Costa Rica
Contact:

Post by Aelred »

What is SQL? Is this something I need to learn about?
User avatar
Teric neDhalir
Githyanki
Posts: 1495
Joined: Mon Jan 05, 2004 10:04 pm
Location: Manchester UK

Post by Teric neDhalir »

Thanks for the replies. So do I need to download/install any more files or is it a case of configuring NWNX4 correctly? If it's the latter I'll try and catch someone in chat this week.
TnD
User avatar
AcadiusLost
Chosen of Forumamus, God of Forums
Posts: 5061
Joined: Tue Oct 19, 2004 8:38 am
Location: Montara, CA [GMT -8]
Contact:

Post by AcadiusLost »

SQL is a language of storing and retrieving data, commonly used to pull specific information from large data-sets. (ex: of the 20,000 people who have accounts with this mobile phone company, did user X pay his bill this month?) It can be used for much more complicated questions as well: say, "in which month did the fewest users go over their alloted evening and weekend minutes?".

Since it's basically designed to have a central storehouse of information, being constantly written to and read from across a network from countless remote points (cash registers, internet browsers, etc), it makes a pretty good platform for serving up persistency data to ALFA's servers.

The folks at NWNx.org worked out how to redirect Neverwinter Nights' rudimentary campaign database functions to point over to an SQL database, and this allowed for some very innovative coding and systems. While we never fully bought into this for NWN1-ALFA, we are using it from the start with NWN2. Obsidian has even gone so far as to include optimizations for NWNx4/SQL in their functions with one of the NWN2 updates.

Now, all the hosted servers will need to maintain connections to the central SQL database in order to function properly- it holds everything from logs of significant ingame actions, to current XP and HP totals, number of deaths, current ingame location, IP addresses, which PCs belong to which player, etc.

As a builder, once the ACR is fully integrated into your module, it will need the same sort of database connection to function properly. Without it, persistency functions will fail, and any PC trying to join will be booted out. However, you should still be able to enter a module with a DM client, if you just want to check lighting, basic conversations, stores, etc. So- terrain, areas, placeables, etc can all be built without any SQL arrangement. However, to get the module properly functional, some sort of SQL database is a must.

I'm currently recommending hosting your own local database for those builders who want to run the "higher-level" building and scripting, this way it's easier to find and fix problems- the only records in the DB will be ones your module put in there, so you can work out what is going wrong, without writing to the tables 003 or the OAS2 are currently using for character and module data.

I'll see about getting a tutorial written up on how to do this later this week.
Locked