PDA

View Full Version : Possible Work-Around Quest Idea for PC Ghosting


trevius
01-28-2008, 04:14 PM
After reading the thread posted here (http://www.eqemulator.net/forums/showthread.php?t=24122&highlight=zone+reset), it gave me an idea for a quest NPC that can possibly help with the issue of player ghosting.

The idea is to have an NPC that uses the EVENT_TIMER section in quests to check for the time of day, and then reset the zone multiple times per day or whatever amounts of time the admin defines in the quest.

Is there a current command or plans to implement one to allow the $zonetime identifier to work? Even better would be one that uses real time, so it goes off of a system clock, since game days are only a little over an hour or so. The max time in between possibly intervals in $zonetime would only be the amount of time in 1 game day. If you could use real time, then you could have the intervals be every 4 hours or even up to 24 hours.

Once that command is working, you can set the NPC to shout warnings well ahead of time to tell the players when the zone reset will happen. So, the code would look something like the following, assuming 100 = 01:00AM, and 2300 = 11:00PM:

#initialize the zone reset warning every 8 hours
EVENT_TIMER {
if ($realtime == 100 || $realtime == 900 || $realtime == 1700 ) {
quest::shout("Nexus will be restarting in 30 minutes. Please zone out before that time.");
}
#continue countdown to zone reset
if ($realtime == 110 || $realtime == 910 || $realtime == 1710 ) {
quest::shout("Nexus will be restarting in 20 minutes. Please zone out before that time.");
}
if ($realtime == 120 || $realtime == 920 || $realtime == 1720 ) {
quest::shout("Nexus will be restarting in 10 minutes. Please zone out before that time.");
}
if ($realtime == 125 || $realtime == 925 || $realtime == 1725 ) {
quest::shout("Nexus will be restarting in 5 minutes. Please zone out before that time.");
}
if ($realtime == 126 || $realtime == 926 || $realtime == 1726 ) {
quest::shout("Nexus will be restarting in 4 minutes. Please zone out before that time.");
}
if ($realtime == 127 || $realtime == 927 || $realtime == 1727 ) {
quest::shout("Nexus will be restarting in 3 minutes. Please zone out before that time.");
}
if ($realtime == 128 || $realtime == 928 || $realtime == 1728 ) {
quest::shout("Nexus will be restarting in 2 minutes. Please zone out before that time.");
}
if ($realtime == 129 || $realtime == 929 || $realtime == 1729 ) {
quest::shout("Nexus will be restarting in 1 minutes. Please zone out NOW!");
}
#reset the zone
if ($realtime == 130 || $realtime == 930 || $realtime == 1730 ) {
quest::shout("Nexus is being restarted right now! It will be back immediately, so you can log back in right away.");
quest::($commandtoresetthezone);
}

I am pretty sure there isn't a command that NPCs can issue to directly reset a zone, but my guess is that there are some out there that will cause the zone to crash, which is effectively about the same thing. Maybe setting them to cast a spell ID that doesn't exist or something to that effect.

Also, I think it would be nice if the $realtime identifier could go all of the way down to seconds where $realtime == 123456 would be 12:34:56PM.

I think this would best be used in base areas for servers like Nexus or PoK. I find that probably 50% of all ghosts on my server are in Nexus where my base is. Using a script like this to reset the zone 3 times a day would have low impact on the players, but still increase performance. It could also be used for any other zones that get high traffic. I would suggest setting high traffic zones to be reset 1 time per day during the off-peak hours, and maybe give at least 1 hour of warning beforehand for raid zones.

Using a script like this properly could potentially rid 90% or even 100% of all ghosting on any server. That would mean lower maintenance from admins, and higher performance for players with minimal impact.

I realize that since these commands or any similar ones aren't exactly built into the Emu yet (as far as I know), that this may have been better posted to one of the Development Sections. I wanted to post it here incase anyone can think of a way to do something similar with current commands.

Of course, if a Dev would like to run with the idea, it would be awesome to see something to allow this be implemented. It would be cool to see an identifier that let NPCs run a command similar to #worldshutdown. So, you could set something like ($zonereset == 10, 5) and that would start making announcements every 2 minutes for 10 minutes and then reset the zone similar to the #worldshutdown announcements settings. I think it would be awesome if there was a way for npcs to use any GM command, but I should save that idea for another post, lol. If they could, maybe the #zoneshutdown command would do the trick.

If someone knows of a way to get rid of ghosts without having to bother with this quest idea at all, please let me know! I have done some searching and haven't found anything yet. Oh, and if crashing or resetting the zone just isn't an option, how about the NPC casts a zone-wide spell to evac everyone to another zone?

trevius
01-31-2008, 09:08 PM
After thinking about it more, maybe it would be possible just to use some kind of pause timer for the NPCs to start giving zone reset warnings. I still don't know of the best way to reset a zone.

Maybe using a trigger spawn that starts the pause timers as soon as someone enters the zone. Then the zone will reset maybe 8 hours later or up to 24 hours or something.

I wanted to note that there is a thread here (http://www.eqemulator.net/forums/showthread.php?t=24267) asking for a feature to allow npcs to use GM commands. I think that could open up a fair amount of possibilities for quests.

I don't know if there is some way other servers are dealing with the ghosting issues other than daily reboots, but it would be nice to hear if someone else has found a way to fix it, or good work around for it.

trevius
02-24-2008, 02:25 PM
I am still looking into a way to make this happen with the current quest options. I am currently trying to use timers to give the warnings and initiate the actual reset. So far the timers I have aren't working at all. Maybe I am missing something. I haven't tried setting up timers before, so I am not exactly sure how they are supposed to work.

Here is what I have so far:

#Fast Zone Reset Test


my $counter;

sub EVENT_SPAWN {

quest::settimer("reset",61);
quest::settimer("warning1",1);
quest::settimer("warning2",31);
quest::settimer("warning3",41);
quest::settimer("warning4",51);
quest::settimer("warning5",56);
quest::settimer("warning6",60);

$counter = 0;
}

sub EVENT_TIMER{
if ($timername == "warning1"){
quest::stoptimer("warning1");
quest::shout("NEXUS will be restarting in 60 seconds. Please zone out before that time.");
}

if ($timername == "warning2"){
quest::stoptimer("warning2");
quest::shout("NEXUS will be restarting in 30 seconds. Please zone out before that time.");
}

if ($timername == "warning3"){
quest::stoptimer("warning3");
quest::shout("NEXUS will be restarting in 20 seconds. Please zone out before that time.");
}

if ($timername == "warning4"){
quest::stoptimer("warning4");
quest::shout("NEXUS will be restarting in 10 seconds. Please zone out before that time.");
}

if ($timername == "warning5"){
quest::stoptimer("warning5");
quest::shout("NEXUS will be restarting in 5 seconds. Please zone out before that time.");
}

if ($timername == "warning6"){
quest::stoptimer("warning6");
quest::shout("NEXUS will be restarting in 1 seconds. Please zone out NOW!");
}

if ($timername == "reset"){
quest::stoptimer("reset");
quest::shout2("Nexus is being restarted right now! It will be back immediately, so you can zone back in right away.");
quest::echo("#zoneshutdown nexus");
quest::castspell(186107,35);
}
}


Don't worry about the end of the script. That is where the actual reset or zone crash will happen. I don't have a sure way to make that part happen yet either, but I need to get the timers working properly first and then I will worry about the actual reset.

If anyone can tell me what is wrong with this script, please do! I am at work right now, but I added this in quickly when I had a chance to go home for a few minutes. If there are no replies, I will mess with it more when I get home.

I would really like to get this thing working. I know of at least a few servers with decent size populations that would most likely use a script like this if it works. As soon as I get one working, I will post it in the quest submissions forum to share it with everyone else.

In case you can't tell what this script is supposed to do, it is supposed to give warnings in /shout (will be shout2 after I get it working). Then after the warning count down, it is supposed to reset or crash the zone to clear out all ghosts/connections and anyone else in the zone. The zone should then automatically recover and restart.

One idea I have to crash the zone is to give the NPC a weapon that they will equip that has an unknown focus effect and then have them cast a spell to crash the zone. Or possible give the NPC a weapon with an unknown proc and have them attack another NPC to crash the zone when the proc goes off. If anyone has an easier way to crash a zone or reset it, I would be very glad to hear it!

Thanks

So_1337
02-24-2008, 05:47 PM
Try this:
#Fast Zone Reset Test


my $counter;

sub EVENT_SPAWN {

quest::settimer("reset",61);
quest::settimer("warning1",1);
quest::settimer("warning2",31);
quest::settimer("warning3",41);
quest::settimer("warning4",51);
quest::settimer("warning5",56);
quest::settimer("warning6",60);


$counter = 0;
}

sub EVENT_TIMER{
if ($timer eq "warning1"){
quest::stoptimer("warning1");
quest::shout("NEXUS will be restarting in 60 seconds. Please zone out before that time.");
}

if ($timer eq "warning2"){
quest::stoptimer("warning2");
quest::shout("NEXUS will be restarting in 30 seconds. Please zone out before that time.");
}

if ($timer eq "warning3"){
quest::stoptimer("warning3");
quest::shout("NEXUS will be restarting in 20 seconds. Please zone out before that time.");
}

if ($timer eq "warning4"){
quest::stoptimer("warning4");
quest::shout("NEXUS will be restarting in 10 seconds. Please zone out before that time.");
}

if ($timer eq "warning5"){
quest::stoptimer("warning5");
quest::shout("NEXUS will be restarting in 5 seconds. Please zone out before that time.");
}

if ($timer eq "warning6"){
quest::stoptimer("warning6");
quest::shout("NEXUS will be restarting in 1 seconds. Please zone out NOW!");
}

if ($timer eq "reset"){
quest::stoptimer("reset");
quest::shout2("Nexus is being restarted right now! It will be back immediately, so you can zone back in right away.");
quest::echo("#zoneshutdown nexus");
quest::castspell(186107,35);
}
}
I've never used $timername, just $timer, and it's always worked fine for me. Also, "==" may work just as well as "eq", but I felt safer taking it from quest files that I have working right now. Without a good chance to test yours, I figured I'd go only with what I know to work 100%. Only test one variable at a time, and such :)

Anyway, give that a shot. I like the idea, to be sure.

trevius
02-24-2008, 06:27 PM
Woot, that works! Now I just need to figure out how to crash the zone lol. Might have this up and running tonight (I hope).

trevius
02-24-2008, 11:11 PM
Getting an NPC to crash a zone is apparently much harder than I suspected it would be. Seems like the devs made the emu too stable :P

So far I have tried:
quest::castspell(12011,0000) - to cast a spell on itself that doesn't exist.
quest::castspell(12011,13) - To have the NPC cast a spell on itself that does exist while it is wearing an item with an "unknown spell" for the focus type.
quest::selfcast(0000) - Does nothing without a target.
quest::depop(1111111111) - to depop a mob that doesn't exist.
quest::spawn(19011,0,0,0,0,-20) to spawn a mob I made that has a buff spell list I created which the spells in the list don't exist. The mob spawns, but doesn't cast anything.
quest::echo(#zoneshutdown) - Wouldn't it be awesome if that actually worked?
quest::shout("spam spam spam spam etc for about 10 lines worth") - Does the shout, but just truncates it.


I have been working on this for hours and can't figure out a way to do it. If anyone knows of a sure way to crash a zone without lagging the entire server, please let me know! Or if someone knows how to make a perl call that will let an NPC run the GM command for #zoneshutdown, that would be ideal!

Once I get this crash or shutdown working, this script will be ready to start using. I really think it will help clear up server lag enough to allow quite a few more players on a server at once, as well as less intervention from admins to reset the server daily. My events log on my PC reports 800 connections sometimes, even though I only get a max of 60ish on at once... I have a feeling that a lot of those connections are just left overs that can be cleared up with a zone reset or crash.

So_1337
02-25-2008, 02:15 AM
Wish I could help you there, but the only sure-fire zone crash I've found is to have my girlfriend's bard try to zone in (http://www.eqemulator.net/forums/showthread.php?t=24285) =P

trevius
02-25-2008, 09:50 AM
Derail:
LOL. Looks like a client issue to me. Did the fresh install of Titanium fix the problem? I would suspect that the problem was a bad copy of titanium (most likely illegal).

Back to the current issue, I am still looking for a way to reset or crash a zone via NPC script/quest.

More failed crash attempts:
quest::addloot(111111111); - bogus item ID, but it had no effect.
quest::settimer("reset",1); - restarted the same timer over and over without stopping it. The timer restarted and the shout went out every second, but no crash...

Derision
02-25-2008, 10:15 AM
Derail:

Back to the current issue, I am still looking for a way to reset or crash a zone via NPC script/quest.



Try putting CORE::Dump(); in your script. Crashes my zone under Linux.


sub EVENT_SAY {
if($text =~ /Hail/i) {
quest::say('Hello. I am the guild master.');
CORE::dump()

}
}


Edit: I just tried it in Windows ... says it's not supported there.

trevius
02-25-2008, 11:12 AM
Edit: I just tried it in Windows ... says it's not supported there.

Awwe! I was getting excited lol. Keep em coming guys. I can't wait to get this working and start using it on my server. I will post the exact scripts I use for it and will report any performance changes as a result of using them.

Derision
02-25-2008, 11:40 AM
Another one to try, which will kill the current process is:

kill SEGV => $$;

Again, this causes a zone crash on Linux. I have Perl (but not EQEmu) installed on Windows and there it will cause the Perl script to stop. You'll have to try it to see if it kills the zone process on windows.

trevius
02-25-2008, 06:38 PM
YES! It works wonderfully. Seems like it just stops the zone and then the zone restarts and everyone gets booted which is what I need. I still get the windows explorer window popup like a normal crash, but it doesn't actually popup the zone crash message.

I will set up my zones with this quest and test it a little further and then post the scripts and any info I find.

Thanks Derision and So_1337! I will make sure to credit you guys when I submit the quest :D I am almost positive this will help with server lag building up on Windows after about 1 day of running.

trevius
02-26-2008, 11:17 AM
Ok, I posted the completed working scripts in quest submissions here (http://www.eqemulator.net/forums/showthread.php?t=24485).

Please reply there if you notice any issues or have feedback about the quest. Or you can always post on my forums or PM me there if there are any questions.

I will post updates there on how well the scripts are working and what I find with further testing. I will also post there on how server performance is affected.