Dev Blog 20200616 - psychobilli/TrinityCoreIssues GitHub Wiki

June 16, 2020

Several months ago I decided I wanted to start working on a Cataclysm World of Warcraft server. There are plenty of Wrath of the Lich King servers around that are functional, and I've been playing the TrinityCore 335 server for some time. However, I'm getting tired of Wrath and i wanted some of the redone content found in Cataclysm. I know there really aren't any functioning Cataclsym servers, and given the small size of the emulation community I figured the only way I was going to get a functioning Cataclysm server was to build it myself.

I began shopping around for various servers and started with ArkCore. I compiled it, ran it, and tested my first zone make notes of everything that appeared to be wrong. At first I had intended to stop with every bug I found so I could fix it then and there. In the first 10 minutes of play I found my first bug - the Tauren Paladin trainer wasn't working. I spent 3 days researching how trainers worked. I found some trainers who worked, and compared the data models to the broken trainer. After learning, in detail, about how character_template, gossip_menu, gossip_menu_option and conditions worked I managed to get the trainer working. I started playing the game again and ran into another bug a few minutes later. I decided to finish the zone and make note of every problem before fixing anything.

After that I got a new computer that I planned to install Ubuntu Server on. I spent a couple of months playing with that and working on other projects. Then I returned to WOW emulation and began installing my WOW servers on them. I quickly found a problem with installing ArkCore on it. Apparently the ACE plugin requires some deprecated files which are no longer installed on Linux systems. I spent a little time trying to fix the issue, but I gave up. I had to change to a new server. So I moved on to the TrinityCore 434 project.

I went to the trouble to migrate my character from ArkCore to TrinityCore, partly because it gave me a sense of how the character database worked, and partly because I already had a character ready to start testing the Barrens. Once that was done, I began testing Durotar, Dun Moroh and Elwynn Forest. Then I learned that the Trinitycore 434 server in git lab was deprecated. I should have realized as much by the disclaimer at the top of the repository. Regardless, I found the TrinityCore Cataclysm Preservation Project and proceeded to compile that.

After another character migration, and a few days of headaches getting the client to connect to the bnet server, I began testing again. I completed testing each and every start zone making notes along the way. I even went through the start zones I had done in ArkCore and Trinitycore 434 again to make sure I had notes covering the Cata Preservation Project. I found that TC 434 was probably in a slightly better condition than the CPP, but CPP is currently being maintained.

Regardless, I was able to sit down and try to fix some of the issues I found. I started by breaking the problems up into similar things. I broke it up into 1. broken trainers, 2. incorrect/missing/duplicated spawns, 3. broken quests which can be handled by smart scripts and 4. broken quests which may require C++ scripts. I decided I would tackle the broken trainers first. I already fixed that in ArkCore, how hard could it be to fix here.

Harder than I expected, actually. I reviewed my changes for ArkCore, which I had done over a month before getting this far, and quickly found the same tables in TC. However, I couldn't get my first test trainer working correctly. After much struggle, and trying my best to make sense of the code in the core, I found TC had a new table - gossip_menu_option_trainer - which I needed to set to correctly link an NPC with the correct spell list. I'm not sure I liked this new table - it had 2 fields from gossip_menu_option, which means duplicated data - and added a third. In addition, there's probably a left join or an additional query in the application that makes this work. Overall, it seems like a lot of additional overhead just to break out one field. It would probably be better - performance wise - to keep it a nullable field in the gossip_menu_option table. However, it's probably not worth fixing. Trainers probably aren't so in demand that the performance boost would be noticed.

I fixed that test trainer, then I decided to track down all of the broken trainers in the start zones. To do this, I began creating a character for each race and class combination - except Death Knights. I tested Archerus - it's doing fine. At this point, I need to start logging in and check each trainer. Don't judge me, I'm having fun, and I'm still pleased with myself for figuring out how to configure trainers.