Page 1 of 1

Dev Diary

Posted: Sun Oct 16, 2016 4:23 pm
by Control
Since I've started out about a month ago, I've had a few people ask how I did certain things. That seems a little crazy to me since it's pretty much the blind leading the blind, but hey, if it helps anyone, then great! Anyone running a server today is building on such an insane pile of work done by others over the last decade or two that it's hard to even imagine.

A couple of weeks on NL was my first real experience with eqemu's, so when I say I'm a noob, I mean it. It was enough to give me the bug though, so when it shut down, I set up VoG the next day. Now I can't believe it took me this long to even be aware of what was possible and how much of a community is built up around it, but also how easy it actually is to get started. Especially that last part. Anyone that still loves EQ is probably too old to care, but running an emu server of your favorite game might be the best way to get into the game industry. What better way to prove that you can do a job than by actually doing it and dealing with player issues on a day to day basis? I've spent my time in the industry and won't be going back (at least not working for anyone else), but I REALLY wish that had occurred to me in my prime-eq-playing days. It would have saved me a LOT of time and money, one way or another.

So here's some stuff based on my experience, one month in. Maybe it'll be useful to someone. Maybe someone will pop in and tell me that something is a really stupid way of doing things, which is great since then maybe we'll all learn the right way :)

CAVEAT: DO NOT copy/paste any sql/code I ever post! And don't treat anything I say as the correct way to do anything! I just kick the server down the stairs over and over until the thing I want falls out. There are surely better ways to develop, but you won't learn them here! :) But having said that:



Starting out:
I basically followed this guide: http://wiki.eqemulator.org/p?EQEmu_on_D ... Virtualbox (Note, the text descriptions here diverge from the videos a little, I assume due to updates. I ignored the videos at first, then I had some issues. Some of these were fixed by following the videos instead.)
Except that I used a linux dedicated server instead of a virtual box. You can get one of those without spending too much if you shop around or an even cheaper VPS. Lots of the server advice seems geared towards windows since I think most people tend to start on their local machines. Digging through threads though, it sounds like people have had issues with Windows server stability, though that may not be the case with recent releases. Either way, I don't think I've had any stability problems at all with the remote linux server, except for things I've directly caused myself by doing something I shouldn't.

Note that most problems that I've solved have been by googling eqemu problemname so I haven't focused on things that were easily solved that way since they didn't cause me enough trouble to bother keeping track of. So always start there. However, one issue with trying to fix things is that googling a problem might give you a few hits that span back over the last decade. It can be tricky sometimes to find what's still relevant today.

Re: Dev Diary

Posted: Sun Oct 16, 2016 4:24 pm
by Control
Tools:
I installed PEQ and MySQL Workbench as described in the above tutorial.

PEQ is great and you should definitely do that, but it isn't perfect. It mostly works and looks deceptively safe, but always take care to back up before editing anything significant. I've ran into some problems with it. The first time I tried to create a new item with it, there was an error that basically broke the db. Luckily I had a recent backup. Also, I've ran into issues when duplicating spells since an addition needs to fall into an acceptable id range which it doesn't always take into account. It also doesn't update everything needed to make changes in some cases (specifically aa's). Note: if you have problems getting it to work initially, check your file paths. The one used in the tutorial was slightly different than what I had.

MySQL Workbench was sort of ok at first, but then it got terrible. Constant, constant crashing. Google brings up lots of similar complains with basically no suggestions for fixing it. I changed to Navicat and it's been great. It does make it pretty easy to accidentally change something though. backup backup backup...

I later installed EOC, which seemed oddly tricky to get working. Apparently running through the above setup tutorial doesn't set up your db for remote access, so you have to do that and then go back and change your previously set up connections to support it. This got me started. http://www.cyberciti.biz/tips/how-do-i- ... erver.html
However, as it turns out, I haven't really used EOC much yet. For the changes I've been making, PEQ and directly poking the db has seemed more straightforward. It looks like EOC may shine when it comes to custom content though, but I haven't really gotten there yet.

Text editing: Fuck editing text on the server with nano or vi or whatever. Use notepad++. (anyone who disagrees probably isn't coming here for server advice hehe) Linux complains about windows-edited text, but npp has a setting that fixes it: http://stackoverflow.com/questions/1623 ... in-notepad



Initial issues:
You probably want a server start/shutdown script: http://www.eqemulator.org/forums/showthread.php?t=37460
If you're not familiar with running scripts: http://stackoverflow.com/questions/8779 ... h-commands
(You probably want a similar script to call your backup command quickly too)

Misplaced folders: Not sure if I missed it or if that part was clipped, but on my initial install, some folders ended up in the wrong spots.
You should copy the following folders (and their contents) from your eqemu source directory to the Server directory if they aren't there:
-quests
-plugins
-Maps (tutorial says this will be automatically downloaded, but I had to download it myself)
-lua_modules (this is in the quests folder, but lua quests won't work until it's moved to the server directory)

I also had a problem in the beginning where the characters would start with no gear, and anything you picked up wouldn't be saved after zoning. That comes from installing MySQL in strict mode. This fixes it: https://support.kayako.com/article/472- ... the-server



Backups/Deployment:
Once your server is up and running, set up an automated backup system before you do anything else (ideally to a separate drive).
Then make sure you can actually restore from the backups that you're taking.
Then set up a system to push those backups offsite so you still have them if your server or drive dies.
I'm a linux noob too so I had some trouble here. This link finally fixed me: http://chriskottom.com/blog/2014/03/pra ... s-or-less/
You should probably also look into replication and make/restore your backups from a slave db, but I haven't done that yet. (possibly the cause of some of the lag people occasionally mention)

Also realize that if you're making changes to any non-db files (quest files, config files, etc.), they need backups (and probably version control) too.
And before you let anyone else play, you should also set up a separate dev server so you can break stuff without worry.
Then get a good system in place to restore your server (dev or production) quickly from a clean slate.
Here's a link for imaging your entire server: https://ubuntuforums.org/showthread.php?t=35087

Re: Dev Diary

Posted: Sun Oct 16, 2016 5:09 pm
by Control
Ok, so on to changing stuff once your all set up:

Generally, get really familiar with http://wiki.eqemulator.org

First, it's good to read through all the commands
http://wiki.eqemulator.org/p?Command_Reference

Some handy commands:
#repop - repops the zone (but doesn't respawn mobs that are waiting on their respawn timers)
#repop force - repops everything in the zone and resets all respawn timers
#reloadallrules - reloads the values in the rule_values table
#reloadworld - reloads quest files
#zone zonename
#summon playername

Note that for some changes to take effect, reloading the quest files or the rules is enough. For some, you need to zone or reload the zone (or exiting the zone until it times out on its own). For changes to things like items and spells, you can run ./shared_memory on the server (though sometimes I see people caution against doing that while your server is live, I've seen others say it's ok. It's been ok for me thusfar /crossesfingers), sometimes also then requiring a zone or zone reset. Sometimes the entire server needs a reset.

and all the server rule settings:
http://wiki.eqemulator.org/p?Server_Rules&frm=Main
These are tweaked in the rule_values table, and can really solve a lot of the early issues.

Also, go through the support forums for both linux and windows servers no matter which one you use: http://www.eqemulator.org/forums/
Other than the install, they work pretty much the same way, so many questions/answers apply to both.

The following covers some questions I've been asked as well as just general things that I thought might be handy to list:


Changing mob difficulty:

Tweaking the values of the npc_types table will do it. Mob id's are generally ordered by expansion, so if you want to tweak them separately, you can just track down where one expansion starts and the other stops. 1001-199000 run from vanilla through luclin, so the following would cut some value in half of all mobs pre-pop:
(again, NEVER copy/paste queries, especially from here. one slipup and your db is fucked!)
update npc_types set x = x *.5 where id > 1001 and id < 199000;
199000 - 224000 = PoP

Relevant fields that you might want to change:
hp, mana, mindmg, maxdmg, spellscale, MR, DR, PR, CR, FR

Note that cutting all these in half (as with VoG) pretty dramatically reduces a mob's power. If the mob does half the damage and has half the hp, it's effectively 1/4 as strong.



Changing respawn times:

Respawn times are listed in the "spawn2" table. The respawntime field is the number of seconds it takes for the mob to respawn, and the variance field is how much that time can vary in seconds. (7200 = 2 hours for example) You'd have to crossreference if you wanted to check the mobname, but you can usually tell the raid targets since everything else will have a relatively tiny spawntime. You can look through the list manually, but that's a lot of spawns. I usually pull the list by zone and change the values manually unless it's a lot of mobs that need updating.

SELECT * FROM spawn2 WHERE zone = zonename;

or if you're sure of what you want to change, you can do something like this which changes everything greater than 2 hours to 2 hours:

UPDATE spawn2 SET respawntime = 7200 WHERE respawntime > 7200 and zone = 'zonename';



Getting rid of drops you don't want

You could do this a bit more easily, but I try to keep any changes I make as reversible as possible. In the lootdrop_entries tables, there's both a chance and a disabled_chance field. The idea is that you can copy the chance field to the disabled_chance field, then change the chance field to zero. That way, you basically turn the item off but retain it's original value in case you want to turn it back on. If it's just a couple of items, its easy enough to do with PEQ, but if you want to kill a bunch of things at once, queries are the only way to go. So, if you want to nuke Ornate Defiant or some other loot set from your loot tables, figure out which item id ranges are relevant. The sets are usually grouped together in batches. So the following does what I just described for a batch of defiant:

SELECT * FROM lootdrop_entries WHERE item_id >= 50500 AND item_id <= 50553;
UPDATE lootdrop_entries SET disabled_chance = chance WHERE item_id >= 50500 AND item_id <= 50553;
UPDATE lootdrop_entries SET chance = 0 WHERE item_id > 50500 AND item_id <= 50553;

Re: Dev Diary

Posted: Sun Oct 16, 2016 6:07 pm
by Control
Increasing XP:
There are a few ways to do this.
Note that there are multiple entries of each of these to enable different settings per expansion. However, it's not always clear which expansion's ruleset is working, so I change all the values just to be safe.

In rule_values, there are these values which are :
-Character:ExpMultiplier
-Character:AAExpMultiplier
-Character:GroupExpMultiplier
-Character:RaidExpMultiplier
-AA:ExpPerPoint
-Zone:HotZoneBonus
-Character:UseXPConScaling - true if you want to use the following to scale xp based on mob con
-Character:RedModifier
-Character:WhiteModifier
-Character:BlueModifier
-Character:LightBlueModifier
-Character:KillsPerGroupLeadershipAA
-Character:KillsPerRaidLeadershipAA
-Zone:LevelBasedEXPMods - enables the values in the level_exp_mods table, which lets you change the xp and the aa xp rate per level.

Also, in the zone table:
-there's zone_exp_modifier for changing xp on a zone by zone basis
-there's also hotzone for turning on the hotzone bonus



Increasing faction rates:

To change faction all faction hits for killing npcs, change the value field in the npc_faction_entries table. Something like:
update npc_faction_entries set value = value * 2;



Unlocking doors

In the doors table, there's a keyitem field. Change it to zero to get rid of the key. You may also have to change the lockpick field to zero, not sure.



Unlocking zones

Some zones need a "door" clicked to enter, so doing the above will let you click the door. However, some zone have a flag defined in the zones tables under the flag_needed field. Delete this one too, if you want free entry.

Re: Dev Diary

Posted: Sun Oct 16, 2016 6:11 pm
by Control
Getting rid of placeholders:

There's probably a faster way with sql wizardry, but I just go to PEQ, go to spawns, choose the named you want to eliminate the placeholders for, the either change the spawn values or delete the other spawns from the list.



Removing annoying mob abilities:

In PEQ, go to spells, then edit spell sets. If you want to choose a specific mob, then you can just choose the zone and mob as normal. If you want get rid of the spells from the general class spell sets (like if you want to remove all charms from enchanter mobs), then go to Select a Spellset and click on Default Enchanter list. The fast but destructive way is to click x on the spells you want to get rid of. The slower but more reversible way is to edit the entries for the spells you don't want in the spellset and change the minlevel to something higher than the mob will ever be, like 200. Note that this is NOT editing the actual spell, just it's entry in the spellset. You can do this for all of the spellsets that you want to change. Note that lots of mobs have their own specific spellsets too, so the safe way is to just go down the list going through all the relevant spellsets.

Also, sometimes a spell is ok but it's duration is stupid or you want to otherwise change something about it. You can grab its id number and go to spells-edit spells, and edit it directly. Note that this will affect everything that casts the spell (including players), so be really sure you want to do it. I've only tended to do this for debuffs which seem ok for a bossfight but which have incredibly long durations.



Changing droprates

EQ being EQ, some drop rates are really low, especially considering some rares' spawn rates. So you might want to change that. Also, much to some people's sadness, we found out that some fableds don't default to 100% droprate on their fabled item, so they needed to be upped.
PEQ-Loot-choose zone/mob - the chance is pretty self-explanatory, so change it if you want. you can click x to get rid of things you don't want on that loot table. If mindrop is 0, then it only drops an item if it makes the change roll, so set it to 1 if you always want a drop. droplimit is the max number of things that can drop. So if there are 2 10% drop items with a mindrop of 0 and a droplimit of 2, then there are 2 individual rolls, each having a chance of success, so you might get 2 items, but most often, you'll get no items at all.

Re: Dev Diary

Posted: Sun Oct 16, 2016 7:20 pm
by Control
Out of combat regen rate:

-Character:RestRegenPercent - value is the % per tick that you regen once sitting and out of combat. so 25 would be 25% resting regen per tick
-Character:RestRegenTimeToActivate - how many seconds it takes to be considered out of combat after the last mob dies



Spell reagent requirements eliminated

spells_new table, fields: components1, components2, components3, components4
Change them to -1 to remove the reagent requirement. Note, you don't want to do this to 'every' spell, only the ones you're sure that you want to remove reagents from. Spells that take EE's for example might not be good to eliminate, and there are also lots of crafting-ish combines in the list even though we don't think of them as spells.



Enabling pets to tank

Mobs normally ignore pets is a PC is in melee range, but that can be changed. Special attack 41 needs to be added to the pets to have them treated like players.
UPDATE npc_types SET special_abilities = CONCAT(special_abilities, '^41,1') WHERE id < 1000;



Locking out certain expansions

There are flags for this, but they didn't really behave as expected. I wasn't concerned about things like getting rid of frogs/berzerkers/whatevers, so I didn't dig into that. I mostly just wanted levels capped and zones locked out and certain things shut off.
-There are flags in rule_values to turn certain features on/off, like mercs.
-There's are also Character:MaxExpLevel and Character:MaxLevel - which you can use to lock level gain universally
-Character:PerCharacterQglobalMaxLevel -which you can use to lock level gain behind quests

For zone access, you can set the min_status field in the zone table to 200 or something if you don't want players to enter, then change it back to 0 when you're ready to let people in.



Disabling XP loss

In the rule_value table:
-Character:DeathExpLossLevel - level at which you start losing xp
-Character:DeathExpLossMaxLevel - level at which you stop losing xp
-Character:DeathItemLossLevel - level at which you start leaving items on your corpse

Re: Dev Diary

Posted: Sun Oct 16, 2016 7:47 pm
by Control
Quests:

So you should get familiar poking around in the quest files. There are quite a few that are broken or a little wonky. For any mob with a quest, there should be a file with the same name as the npc in that zone's folder inside the quest directory. I've found a few of these in the wrong folder. Notepad++'s "find in file" feature will let you run a search for a mob name on the entire quest folder, so you can easily find something that's misplaced.

There are currently both perl and lua, and I think the lua takes precedence if there are two with the same name. There are great links on the main eqemu wiki linked above that have syntax and examples. However, I find that if I want to do something, the quickest way is to find an npc with a quest that does something similar, then just look at its quest file to see how it works.

There's also a global folder, which affects things globally (obviously), but it's important to know exists. It escaped me for a long time since there's a lot of zone folders, and I never knew to look for it.

When you change a quest file, you can use the command #repopworld to reload all mob quest files.



Autoscribe/skill/etc.

First find global_player.pl in the global folder. The lua version is also there, but i renamed it to work on the .pl version instead.
The lua version auto-grants all the veteran aa by default, so it got rid of that as well.

My global_player calls an AutoTrain function with every level up:

sub EVENT_LEVEL_UP {

AutoTrain();

}

but this doesn't train your level 1 spells, so you're stuck with no spells meleeing with 0 skill for a level until you ding. To fix that, we want it to fire when you connect too. However, we don't want it to call autotrain every time you connect, so we check against a language skill that no one starts with so that once you've learned it once, this will never call autotrain again:

sub EVENT_CONNECT {
my $lanSkill = $client->GetLanguageSkill(15);
if ($lanSkill < 100){
AutoTrain();
}
}

Then under the autotrain function, there are a few parts:

This trains all skills except for craft skills:

foreach my $skill ( 0 .. 42, 48 .. 54, 70 .. 74 ) {
next unless $client->CanHaveSkill($skill);
my $maxSkill = $client->MaxSkill( $skill, $client->GetClass(), $ulevel );
next unless $maxSkill > $client->GetRawSkill($skill);
$client->SetSkill( $skill, $maxSkill );
}

These train your spells and discs:
quest::scribespells( $ulevel, $ulevel - 1 );
quest::traindiscs( $ulevel, $ulevel - 1 );

This trains your languages, but only once:
my $lanSkill = $client->GetLanguageSkill(15);
if ($lanSkill < 100){
quest::setlanguage(0, 100);
quest::setlanguage(1, 100);
quest::setlanguage(2, 100);
quest::setlanguage(3, 100);
quest::setlanguage(4, 100);
quest::setlanguage(5, 100);
quest::setlanguage(6, 100);
quest::setlanguage(7, 100);
quest::setlanguage(8, 100);
quest::setlanguage(9, 100);
quest::setlanguage(10, 100);
quest::setlanguage(11, 100);
quest::setlanguage(12, 100);
quest::setlanguage(13, 100);
quest::setlanguage(14, 100);
quest::setlanguage(15, 100);
}

You can also give people aa's here. I autotrain origin for everyone:
$client->GrantAlternateAdvancementAbility(331, 1);

and also award aa's as soon as they're available if you want. Here I give pallys and sks a new rank of their harm touch or lay on hands each time it's possible until level 50:

if($client->GetLevel() < 50 ){
$client->IncrementAA(7800);
$client->IncrementAA(7850);
}



Autoscribe and the mage epic

So one issue with autoscribing is that the mage's epic is a spell, so by default, mages get a free epic at 45, Summon Orb (that can clickly the epic pet at 50 or 51). In addition, at 59, they get an instacast version of the pet summoning spell, Manifest Elements. It's great fun, but if you think it's a little overpowered, you can disable it by editing both of those spells to be level 0 spells. Autoscribe will never scribe it if it's only scribing spells of your current level, but you can still scribe the scroll when you get it via the epic quest.

Re: Dev Diary

Posted: Sun Oct 16, 2016 9:24 pm
by Control
Editing AA's

This one tripped me up for a long time. Going through PEQ to edit aa's wouldn't work to change recast times, aa costs, and level requirements. None of the "customize your aa" guides and google searches helped. I got stuck on this an embarrassingly long time. The trick is that you've got to change the corresponding values in the aa_ranks table too. Not sure if the values in the other tables even have to match, haven't tried it. The aa_ranks table seems authoritative when you don't change it though.



Dynamic zones, resetting, etc.

Dynamic/static zones don't seem to be explained terribly well in any one spot. The gist is, dynamic zones are loaded up whenever someone enters and persist until everyone has left. Static zones are always loaded to some degree. Dynamic zones take fewer resources when no one is in them but can take a bit longer to load. They also enable people to pop in and out of the zone to shuffle the mobs for nameds (which most people like, of course). The downside to that is if you die to a named, he won't be there when you get back, and if you die after killing something, the corpse with all your loot won't be there either. However, you can compromise a bit by changing the shutdowndelay field in the zone table. If you want to change every zone to the same thing, you can use something like: UPDATE `zone` SET `shutdowndelay` = '1800000'; It's in milliseconds, so changing it to 1800000 causes the zone to stay up for 30 minutes.



Changing starting zones

Similar to the aa issue, I followed the guides on the wiki and googled and googled and still didn't get this to work. Spent a very embarrassingly long time. I tried pretty much everything, so I'm not even sure what, if any, combination of stuff mattered before I made the last change, but here's what finally flipped the switch. In the start_zones table, there needs to be an entry for every race/class/diety/startcity. Ok, so that much is pretty clear, though you may be missing some of the combinations which you'll have to add. However, the problem was that the wiki says that the zone_id and the start_zone should be the same, so I changed them both to where I wanted the player to start. Apparently the zone_id needs to stay at its default values or it breaks the whole thing. After I repopulated that table from a backup and just changed the start_zone (well, and the x,y,z,heading too), it worked!



Mystery spell problems

If you're having problems with spells that you can't explain, make sure that the spell file you're using actually agrees with the info on the server. If your spellfile says something costs 2000 mana but the server thinks it costs 200, the server is authoritative of course, but the client won't even let you try to cast the spell unless you have 2000 mana. I ran into this on a noob spell, so I'm not sure what would have happened if it has actually been cast. Similarly, there was a disc that the client thought lasted much longer than the server, so it appeared very broken from the client-side. This can be really tricky because depending on the reasons that someone's spellfile is different, 99.9% of things can work just fine, never causing you to suspect a problem.

Ok, that's all for now, feel free to ask questions if you'd like.

Re: Dev Diary

Posted: Mon Oct 17, 2016 6:01 am
by Control
peqzone

PEQzone is enabled by default, so if you don't want people being able to zone at will, set the peqzone field to zero in the zone table.

Re: Dev Diary

Posted: Sun Oct 23, 2016 7:53 pm
by Methus
I liked reading your dev diary. Cool insight into what its like deving a server :D

Re: Dev Diary

Posted: Thu Dec 29, 2016 1:40 am
by GaryRivers
Curious about the removing placeholders business....which table are you using exactly to do this? ive been poking around PEQ database on my own server using mySQL however I am fuzzy on how you did this.

Actually same thing about spell editing of npc's, like removing charm for example if you wouldnt mind being a little more specific of your method.

Thanks for the guide btw.

Re: Dev Diary

Posted: Thu Dec 29, 2016 3:13 am
by Control
Here's a copy/paste of my answer in Discord:

use the php editor from this tutorial http://wiki.eqemulator.org/p?EQEmu_on_D ... x&frm=Main
gives you a web interface to fix most of the stuff you need to fix
you still need a db editor/sql for some things, but for what you mentioned, the web editor is much easier

for spells, check the default spellsets for the various classes. you can just delete the spells you don't want from the spellsets or set the min level to something really high or you can adjust the recast or priority weighting there too
some mobs have spells specific to them, for those, select the npc from the npc tab, then click on spells, and it will show you it's spells, which you could then change in the same way you can alter specific spells, but careful that you don't do that to any player-castable spells hehe
also, for direct spell tweaks, you may have to export a new spell-file for the spell to work

for placeholders, just find the mob you want, click spawns and it will show you all of its spawn groups (often only one) with the other mobs in its group. you can edit that to change the spawn chance or add/delete mobs from the list