New Tool: Migrate NPC's (spells/faction/loot/spawn/move/items) from PEQ <=> Cavedude
This post supersedes the one I posted here.
There are several enhancements to this program over the old one, but here's a full feature list. You can: - Move NPC's from PEQ -> Cavedude, or Cavedude -> PEQ - It will grab all pertinent info on the NPC, including spells, faction, spawn, loot tables, loot items and movement. - You can move a single NPC, a list of NPC ID's, or a whole zone at a time. - For a zone move, you can tell it to pull just the NPC's in the "From" database that the "To" database doesn't already have. You can also tell it to grab all of them. - Output can be one file per NPC (i.e., 1001-Guard_Mezzt.sql) or one big file for all NPC's. - If you tell it to, it will adjust the key fields for all the pertinent tables so the two databases will play nicely together. This should probably be used every time you run the program. - I've done a lot of checking into what are safe values to increment key field ID's are (information is here). There is a section in the program where you can change these increments if you so desire. Prerequisites: - FIRST: THIS IS TEST CODE. BACKUP YOUR EXISTING EQ DATABASE. - This is a perl program; you need perl installed. - You will need to source both databases into mysql; this program will read from both of them. Make sure to keep them seperate (don't source them into the same database). Installing it: - Make sure you |
(bumping this thread - the old post I had got on top of this when I edited it to point to this new post)
|
The stuff I put out is probably only good if you have a new database, or are downloading my whole database.
If you already have a database you are working on and have added stuff, then there's always a chance things will get crossed and mess up your database. If you want to add my stuff to your custom database - this tool is what you need; just download my database and merge what you want to yours. This is a great tool and long-waited for. Thank you zephyr325 !!! |
Actually, you can use it with other databases as well. The key is making sure that you're incrementing your key field ID's by an amount that isn't going to step on something you already have. Once you have those values, there is a section in this program that you can edit (its towards the top of the file, and labeled) that will allow you to put those amounts in, rather than the defaults I put in.
Check out the link above as well for my listing of what I did with each table; that will be a good starting point for folks to use. The only one I've found so far that has a hard cap on it is npc_faction - make sure you don't increment your id to be more than 50000 or EQEmu won't start up. I've got a safety in the program that won't write that insert statement out if that value is too high. |
Small updates:
- Changed the -e option to not check at all for duplicate records in the target database - put double quotes around all field values to keep the insert statement from generating an error if a field value is null |
Wow, I don't know how I missed it. :p
Thanks for the program, zephyr325! |
np!
Next revision is going to work on a less verbose option both for screen and output file. Less screen time means the program will run faster, and a smaller output file means a faster load time as well as not chewing up those oh-so-expensive hard drive bytes. =) |
Zephyr, you are truly amazing. Thank you for this effort. It immediately simplifies anyone wanting to work adhoc on their own data and providing it to the whole community.
Gold star for you! |
I've put a quick little scripts out that will run the program against all the zones I know about and create a "zonename.sql" file of inserts.
You can get to it here. I run things under linux/cygwin, so if you want to use it in a DOS format you'll need to replace the "./" in front of each line with "perl " so you get a line like: Quote:
Quote:
|
to follow on to the previous thread, making items with arbitrarily high IDs like that is really not a good idea... we have a static length array to make item management fast and big gaps in item IDs waste a lot of memory (if it works at all)
|
I can vouch for FNW on this. When I made a database that was a combination of the latest PEQ, Cavedude's latest and Angelox's latest work, I saw my server memory increase by 300% the normal for running just 10 dynamic zones. Atleast, this is what I think is causing it. I'm still trying to prove it, or I was, until I just read FNW's post above...
On the other hand, it sure is nice to have a database that is almost all popped up intil Omens. |
Thanks for the input, both of 'ya.
The basic premise that I worked off of was trying to find a safe number that I could add to each of the id's that would work for both databases. There was a lot of room for optimization, which I've incorporated below (and updated the web page that shows what I do for each table here): npc_types.id: increment by 350,000 rather than 500,000 spawngroup.id: increment by 300,000 rather than 3,000,000 spawn2.id: incremebt by 125,000 rather than 500,000 npc_spells.id: increment by 300 rather than 5,000 npc_spells_entries.id: increment by 1,800 rather than 5,000 loottable.id: increment by 13,000 rather than 500,000 lootdrop.id: increment by 50,000 rather than 500,000 faction_list.id: increment by 1,000 rather than 5,000 items.id: increment by 100,000 rather than 500,000 As to the "will it work" thing, I've been doing some pretty extensive testing and its all worked so far. Thanks for the input. |
I'll give this a try. I am sure it will work, but for performance I really hope decreasing the amount of empty IDs between records will greatly reduce the server's consumption of memory.
|
Fathernitwit - is there some way to tell how much memory would be taken up by empty space between key id's vs. adding a bunch of new spawns/items/loot etc?
|
If anyone wants to see the tool results in action check out the darktides server where this is being developed. Now we are going to attempt a PEQ base with cavedude added into it.
|
the tables in which ID matters (all linear scale):
- items - loottable - lootdrop - npc_faction - doors everything else shouldent matter. |
Quote:
|
Now that I've tweaked the increments to tighten up the id ranges, and we've not had too many bug reports, I'm looking for more features to add (or maybe a new project?). Any requests?
|
Excellent! :D
What about ground spawns? There are quite a few quests and items that do spawn on the floor. Oh, and items. I'm sure people with custom servers and items would like that option. I'm not one of them, but I could imagine the pain it would be to export/import everything every single time. Um, that's all I can think of, heh. |
Quote:
Nice work, still. Very helpful scripting. |
Zephyr, one more thing. MySQL 4.1 doesn't seem to be handling this header line very well:
Code:
print FILE "-----------------------------------------------------------------------\n"; I edited my .pl and re-ran the scripts and MySQL can import the file ok. Not sure if this is everyone, or just my version (MySQL - 4.1.20-community-nt). |
Quote:
|
Quote:
I've patched the program and re-posted it. |
Excellent. Thank you again for this. This script kicks ass!
|
It's all in the numbers
Quote:
After you run zephyr325's tool, you'll have , new "groups" of high rows/numbers - with "MySql Query Browser", you can sort them so you can see all this; you can see where the original set of numbers end, and the new sets (you made with the tool) start and end. So, for example, lets say lootdrop originally has ids of 1 -10, and the tool made 10 more rows 20-30. so now you have rows 1-30, the gap being rows 10 -20 so you have to optimize and move the new ten rows to start at 11. Code:
UPDATE lootdrop SET id=id-9 WHERE (id>=20 AND id<=30); Here's some examples of what I touched when I fixed my database. Code:
UPDATE lootdrop SET id=id-14878 WHERE (id>=102100 AND id<=102200); Code:
UPDATE npc_types SET loottable_id=loottable_id-14878 WHERE (loottable_id>=102100 AND loottable_id<=102200); I haven't used zephyr325's tool yet , but I'm sure the same thing happens to him as what happened to me, when this tool is run. Also remember, just adding/merging Cavedudes' and PEQ is not the whole solution - it's just a "better start" to what needs to be done. |
I forgot to add the reason for the calculator ;
Code:
UPDATE lootdrop SET id=id-9 WHERE (id>=20 AND id<=30); Highest old number(10) subtract from lowest of new numbers(20) = 10, then subtract one from your new number(10 - 1) to get 9. You need a calculator for whan the numbers get big and ugly. |
0.5.7 database
FYI,
I tried to update a 0.57 and a 0.6.0 database and this pops up. Use of uninitialized value in concatenation (.) or string at grabnpc.pl line 740 not a clue on what that means but line 740 is this. print FILE "\"$Spawn2[$tmp]->{'Condition'}\","; guessing it has to do with spawn conditions and such. |
Quote:
A bigger question is whether or not the 0.6.0 version of the program needs that variable for something. I'm not sure about that one, but I'd just source one NPC to see how it acts. |
1npc
Quote:
last year I was able to convert it over to 0.6.0 but I added and deleted a whole slew of fields. The NPC sourced in but it's not showing up in the spawnlistand if i remember right I had to drop and add quite a bit of fields. so the conversion from 0.6.0 to 0.7.0 is what im troubleshooting atm. |
Parseing error.
this is right from the npc file that grabnpc.pl made.
After tinkering with it for a while I noticed this error, maybe it's a parseing error. mysql> INSERT INTO spawn2 (id, spawngroupID, zone, x, y, z, heading, respawntime , variance, pathgrid, timeleft, _condition, cond_value) VALUES ("350904","281356 ","nexus","0.977219","19.124527","-30.247982","139.125000","1200","0","0","0",); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 |
solved...
Quote:
but now im trying to figgure out how to mass produce that fix. |
Quote:
Code:
ALTER TABLE ground_spawns ADD temp_x float NOT NULL; If you just add "zeros" , things could get scrambled. |
I just had a thought; You must be using an old version of EqEmu? you'd have to update EqEmu binarys also
|
0.5.7 database
Quote:
I sourced those in and got less errors..but still get a few others. INSERT INTO spawngroup (id, name, spawn_limit) VALUES ("' at line 1 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1 |
Final thing...
ok basicly I tried sourceing in your values and everything still didn;t work.
the only way I was able to get it to work was by adding ,"0","0" to the end of all the spawn2 querys. yours that don't work makes this. mysql> INSERT INTO spawn2 (id, spawngroupID, zone, x, y, z, heading, respawntime, variance, pathgrid, timeleft, _condition, cond_value) VALUES ("184093","184094","tutorial","-286.071","-52.3102","33.6032","745","180","0","0","0",); mine that works mysql> INSERT INTO spawn2 (id, spawngroupID, zone, x, y, z, heading, respawntime, variance, pathgrid, timeleft, _condition, cond_value) VALUES ("184093","184094","tutorial","-286.071","-52.3102","33.6032","745","180","0","0","0","0","0" ); im not sure what fields are missing but that fixed the issue. |
Quote:
If you have 0.6.0 and those start at 0.6.3, then you have to figure out what they changed before 0.6.3. Also you could check the logs at http://www.eqemulator.net/download.php , and see if any lines got left out of what I posted for you. |
Sdabbs65 -
I just noticed something about the ouput you're getting from this post: Quote:
For example, you'd ge this kind of output if you did a "type 1001-npcname.sql" in a dos box that was 80 characters long and that's how you grabbed what you posted to us. Check out the file that it creates in some sort of text editor that will let you go longer than 80 characters in width (i.e., notepad) and see if the output from the program looks different. Also, are you sure you're using version 0.5.6 of the grabnpc.pl program? You can tell the version number by editing it and looking at the first few lines. One of the recent changes I made was to make sure to put a set of quotes around every field for every line it outputs so that a blank/null character wouldn't produce a bad insert statement. |
...
Quote:
as far as asking for help...... AH-HAH-HAHAH-HaHA... your funny when your drunk dude. I got it working thanks for the info it helped out a bit. |
I know this post is a bit old and I dislike bringing back an old thread, but does anyone have this tool still they could send me a link too as I'm not seeing it in the thread.
Thanks. |
If the purpose of this tool was to transfer data between my old db and PEQ's, then it is no longer needed. When I took over PEQ I slowly merged the two together and at this point the merger is pretty much done.
|
All times are GMT -4. The time now is 03:07 AM. |
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.