|
|
|
 |
 |
 |
 |
|
 |
 |
|
 |
 |
|
 |
|
| Development::Feature Requests Post suggestions/feature requests here. |
 |
|
 |

10-02-2008, 05:52 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Maybe if there was a way to adjust how far away the regular movement updates get sent. I use MQ which helps a ton with developing content and standing in the main part of Dreadspire, I can see probably 50 mobs in the entire main section all moving very accurately and seemingly sending multiple updates per second. It seems to be somewhere around 800 distance away. I can only ever see a max of 400 distance in the entire zone since it is all indoors. So, if I could somehow set that range on a per zone basis, that might help a bit. Also, if it was possible, I wouldn't mind the option to completely disable the zonewide 1 minute updates on a per zone basis. I don't see why my client even needs to be aware of mobs outside of my visual range other than for MQ purposes, which really has no part in actual game play.
I know that the rule for it could be adjusted, but for some zones, the location information might be more important than others. And I know for a fact that those updates are pretty heavy on the server or bandwidth. At one point, I tried setting those zonewide updates in the rules to be every 1 second, because I didn't know what it was doing exactly. With it set that way, my server was so insanely laggy that it was unplayable after a few people logged on. Even 1 time per minute, if you multiply that times 60 clients on the entire server, you are averaging a zone wide update to 1 client per second. Double the players to 120, which is about the max my server can handle and it goes up to an average of 2 zonewide updates per second.
Then, once you start factoring in combat spam that has to go out to each client, a big raid can cause a significant hit to bandwidth and performance. If all of those players were all fighting in separate areas, they would only be receiving their own combat spam, but all in a tight area, everyone gets everyone's combat spam, so it multiplies what needs to be sent by how many characters are there.
I think the AE issue with rampage is more of a server resource issue than it is on bandwidth, since AndMetal brought it up. The main reason to think this is because it is one of the few things that can an will crash a zone if you have too many mobs in the rampage pull. I don't think bandwidth can cause a zone crash, just cause lag and LDs. Only high running processes or bugs can cause crashes, or at least that is my guess. I think a rampage pull of 30+ mobs is just too much combat spam all hitting at the exact same time for the server to handle at once.
I am sure there are some solutions to help this stuff considerably. Even a 20% decrease in bandwidth could make a considerable difference on home run servers that don't have practically unlimited upload speeds. Right now, I think players seem to average about 5k per player on normal use. Though, that probably spikes up a lot during large raids.
|
 |
|
 |
 |
|
 |

10-02-2008, 07:45 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Woot! I think I found part of what KLS is talking about :
zone/updatemgr.cpp
Code:
//squared distances for each level
//these values are pulled out of my ass, should be tuned some day
const float UpdateManager::level_distances2[UPDATE_LEVELS]
= { 50*50, 250*250, 500*500, 800*800 };
//delay between sending packets in each level, in ms
//its best if they are all multiples of UPDATE_RESOLUTION
//these values are pulled out of my ass, should be tuned some day
const int32 UpdateManager::level_timers[UPDATE_LEVELS+1]
= { UPDATE_RESOLUTION, //.3s
2*UPDATE_RESOLUTION, //.6s
3*UPDATE_RESOLUTION, //.9s
9*UPDATE_RESOLUTION, //~2s
34*UPDATE_RESOLUTION //~10s
};
I like how he says they are pulled out of his ass and need to be tuned lol. If there was a way to set these on a per zone basis, I think that would be amazing. If that would be too complex, I think these could each easily just have rules tied to them so you can adjust them all manually to find which is the best combination.
I think more could definitely be done, but I will have to look into finding other parts that could possibly be tweaked further.
|
 |
|
 |
 |
|
 |

10-02-2008, 08:10 AM
|
|
Dragon
|
|
Join Date: May 2006
Location: Cincinnati, OH
Posts: 689
|
|
Quote:
|
We have already been testing a quest system to depopall() on all trash mobs when a boss mob or named is being killed. It seems to completely stop all lag as compared to previously people would go LD and lag extremely bad in some cases.
|
Just a quick note on that. We used to have trouble on our server before we had our DS3 line installed. We'd have too many players whacking on things in heavily NPC-populated zones. Killing Yelinak in particular comes to mind. Now, for Skyshrine, our trash mobs were already all set to a 30 minute repop. We'd do a #depopzone and then manually spawn him so we'd have a chance at killing him without us all getting bugged out. That worked out fine, unless we were slow and the zone repopped before then. At that point, the zone is completely overwhelmed, and everything will freeze for a good long while. 500+ NPCs in Skyshrine =X
Anyway, just my thoughts. I'm sure that if you're doing this, you've already thought of it, but wanted to suggest that if you use quest::depopzone that you make sure to disable the respawn timers until the boss has died, and then re-enable them. Though that only sounds useful for fights that aren't intended to have the added difficulty of add control =)
Just my thoughts, this sounds like a really good suggestion if a reasonable way to implement it can be found.
|
 |
|
 |
 |
|
 |

10-02-2008, 12:19 PM
|
|
Sarnak
|
|
Join Date: Dec 2007
Posts: 50
|
|
Working with Trev on this,
We have as system set up atm that if an event is engaged, we do a zone wide depop of all trash mobs using quest::depopall(npcid) for each trash, then pop some KOS guard mobs in specific locations so people can't just run around the zone with a few others things built in to avoid abuse. When event is over zone repops all the trash with quest. This works fine. But obviously the flaws are there which is it really affects any other group in the zone forcing a 8-10 minutes of down time. Plus if you want to do an event with smaller force it could take even longer, and then if your moving from event to event quickly you could basically have the zone locked up for a while making it unplayable by others. Is that worth it so everyone doesn't have a 70% chance to lock up/crash when fighting the event, probably but its not the ideal solution.
There are other ways around it which are better, but just require more advanced planning and coding useing standard scripts, set up certain areas of the zone with only certain NPCid's then have quest mobs spawn and check aggro if any players are in that area and if its clear then depop it, otherwise leave it up and hope by the time they are done in the area the event is over.
But really all these solutions are cumbersome and were praying we can get something more solid.
|
 |
|
 |

10-02-2008, 07:16 PM
|
|
Demi-God
|
|
Join Date: May 2007
Posts: 1,032
|
|
anoher thing: you think turning OFF Npc buff friends would help with the lag?
Since npc needs to not only buff all their friends but also keep a watch when their buffs expire etc
|

10-02-2008, 11:50 PM
|
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Mob::SendPosUpdate(int8 iSendToSelf) is where you would want to look. We have it hardcoded to 800 dist but it wouldn't be too hard to load that from the zone table and use a custom value instead. Turning off more advanced ai like spell casting and buffing when people aren't close to npcs and npcs aren't engaged is probably a good idea too.
|
 |
|
 |

10-03-2008, 02:38 AM
|
|
Hill Giant
|
|
Join Date: Sep 2007
Posts: 117
|
|
Quote:
Originally Posted by KLS
Mob::SendPosUpdate(int8 iSendToSelf) is where you would want to look. We have it hardcoded to 800 dist but it wouldn't be too hard to load that from the zone table and use a custom value instead. Turning off more advanced ai like spell casting and buffing when people aren't close to npcs and npcs aren't engaged is probably a good idea too.
|
I wrote some code that replaces the 800 found in Mob::SendPosUpdate(int8 iSendToSelf) with a distance pulled from the zone database. But I have aquestion that is probably dumb but Which would be better...
Query the database everytime the Mob::SendPosUpdate(int8 iSendToSelf) is called? I assume this would be a lot.
OR
Set a variable's value when the zone boots up based on a database query. Then get that variables value whenever Mob::SendPosUpdate(int8 iSendToSelf) is called?
Like I said probably dumb questions but I am not sure how often this would be hitting the database.
|
 |
|
 |

10-03-2008, 04:03 AM
|
|
Hill Giant
|
|
Join Date: Feb 2006
Posts: 179
|
|
Quote:
Originally Posted by Rocker8956
I wrote some code that replaces the 800 found in Mob::SendPosUpdate(int8 iSendToSelf) with a distance pulled from the zone database. But I have aquestion that is probably dumb but Which would be better...
Query the database everytime the Mob::SendPosUpdate(int8 iSendToSelf) is called? I assume this would be a lot.
OR
Set a variable's value when the zone boots up based on a database query. Then get that variables value whenever Mob::SendPosUpdate(int8 iSendToSelf) is called?
Like I said probably dumb questions but I am not sure how often this would be hitting the database.
|
Do it the way I posted above. 
|

10-03-2008, 04:27 AM
|
|
Developer
|
|
Join Date: Feb 2004
Location: UK
Posts: 1,540
|
|
Quote:
Originally Posted by Rocker8956
Query the database everytime the Mob::SendPosUpdate(int8 iSendToSelf) is called? I assume this would be a lot.
|
That's the last thing you want to do. I just compiled zone with profiling enabled and stood in Dreadlands by Karnor's Castle for 60 seconds and there were around 4500 calls to that method.
|
 |
|
 |

10-03-2008, 05:56 AM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
I would almost certainly say to set the variables on zone bootup. Seems to be the obvious choice. Anything that reduces the number of database hits is good, and setting that at zone bootup shouldn't cause any performance differences at all.
But, even though KLS says the 800 is hard coded, I can say that just by looking at what the MQ map shows, it seems pretty clear that the code I posted above is the code used for sending position updates. Within a range of 50ish, the movements on the map are almost perfectly smooth (.3 second timer), then from 50 to about 250, they are slightly less smooth (.6 second timer), and from 250 to 500 even slightly less smooth (.9 second timer), And anything from 500 to 800 is kinda choppy (2 second timer), and after that it uses the zonewide update setting, which by default is 1 minute, but if you set the rule it can be much higher.
So, I am not completely convinced that the 800 setting KLS mentioned is what is being used all of the time.
Here is the code that I think is handling those updates:
mob.cpp
Code:
void Mob::SendPosUpdate(int8 iSendToSelf) {
EQApplicationPacket* app = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)app->pBuffer;
MakeSpawnUpdate(spu);
if (iSendToSelf == 2) {
if (this->IsClient())
this->CastToClient()->FastQueuePacket(&app,false);
}
else
#ifdef PACKET_UPDATE_MANAGER
entity_list.QueueManaged(this, app, (iSendToSelf==0),false);
#else
entity_list.QueueCloseClients(this, app, (iSendToSelf==0), 800, NULL, false);
#endif
safe_delete(app);
}
entity.cpp
Code:
void EntityList::QueueManaged(Mob* sender, const EQApplicationPacket* app, bool ignore_sender, bool ackreq) {
LinkedListIterator<Client*> iterator(client_list);
#ifdef PACKET_UPDATE_MANAGER
EQApplicationPacket* tmp_app = app->Copy();
#endif
iterator.Reset();
while(iterator.MoreElements())
{
Client* ent = iterator.GetData();
if ((!ignore_sender || ent != sender))
{
#ifdef PACKET_UPDATE_MANAGER
ent->GetUpdateManager()->QueuePacket(tmp_app, ackreq, sender, ent->DistNoRoot(*sender));
#else
ent->QueuePacket(app, ackreq, Client::CLIENT_CONNECTED);
#endif
}
iterator.Advance();
}
#ifdef PACKET_UPDATE_MANAGER
EQApplicationPacket::PacketUsed(&tmp_app);
#endif
}
void EntityList::QueueClientsStatus(Mob* sender, const EQApplicationPacket* app, bool ignore_sender, int8 minstatus, int8 maxstatus)
{
LinkedListIterator<Client*> iterator(client_list);
iterator.Reset();
while(iterator.MoreElements())
{
if ((!ignore_sender || iterator.GetData() != sender) && (iterator.GetData()->Admin() >= minstatus && iterator.GetData()->Admin() <= maxstatus))
{
iterator.GetData()->QueuePacket(app);
}
iterator.Advance();
}
}
updatemgr.cpp
Code:
void UpdateManager::QueuePacket(EQApplicationPacket *app, bool ack_req, Mob *from, float range2) {
int r = UPDATE_LEVELS;
UMMap *cur = levels;
const float *cur_d = level_distances2;
cur += UPDATE_LEVELS; //move to the end.
cur_d += UPDATE_LEVELS - 1;
//work backwards since mobs are more likely to be further away
for(r = UPDATE_LEVELS; r >= 0; r--, cur--, cur_d--) {
if(range2 < *cur_d)
continue;
//this packet falls into this queue...
uint32 id = MakeUpdateID(from, app);
// if(r < 2)
// net->QueuePacket(app, ack_req);
//LogFile->write(EQEMuLog::Debug, "Queueing packet from %s (0x%.4x) id=0x%x at level %d\n", from->GetName(), app->GetOpcode(), id, r);
app->PacketReferenced();
//reference decrementing is taken care of my UMType destructor
//if anything is overwritten
(*cur)[id] = UMType(app, ack_req);
// (*cur)[id] = UMType(app->Copy(), ack_req);
return;
}
//if we get here, were in trouble...
}
|
 |
|
 |
 |
|
 |

10-06-2008, 11:28 AM
|
|
Discordant
|
|
Join Date: Apr 2006
Posts: 374
|
|
This sounds interesting but I have a few questions to think about.
1. If this despawns mobs that are not in a certian radius of the player then couldn't this approach be used as an exploit? If a player is trying to camp a named mob and the mob is not up, couldn't the player just venture out of the place holder's radius to despawn it? Triggering a respawn when they come back into it's radius, essentialy cycling the camp without killing anything? What about named mobs like CT that are only supposed to spawn on a schedual?
Or will the "despawned mob" basically be "cached" until it is revealed again, killed, or cycled by spawn timer?
2. What about respawn times in general? Could this be used to get around respawn times?
3. Also in comparison to WoW, I think that the spawn radius would have to be quite larger than what they impliment. It is quite annoying to be able to see a few hundred yards away but not see any mobs in that area until you are almost right on top of them.
|
 |
|
 |

10-06-2008, 12:29 PM
|
|
Hill Giant
|
|
Join Date: Sep 2007
Posts: 117
|
|
This does not effect if the mob is spawned. Basically the mob is still there but the player does not get updates on the mob's position unless the player is within so many feet of the mob.
One question I have though, does this effect track?
|

10-06-2008, 12:33 PM
|
|
Discordant
|
|
Join Date: Apr 2006
Posts: 374
|
|
Ahh that makes more sense then.
|
 |
|
 |

10-06-2008, 04:41 PM
|
 |
Developer
|
|
Join Date: Aug 2006
Location: USA
Posts: 5,946
|
|
Cubber, the original suggestion to actually depop mobs that were out of range would have worked perfectly fine for everything accept Track. The spawn timers would still be checked before a mob would be spawned if a player entered the spawn radius. The only thing you would need to take into account to avoid possible exploits would be to remember that you don't want to depop and repop named or anything with particularly nice loot tables, especially if they are set to equip the items. As long as they don't equip the items, the players would still have no way to tell what loot was or wasn't on the mob, so even named could potentially be depopped. The main thing is that there would be a per NPCID setting to allow you to enable the spawn to use the system or just to stay up like mobs currently do.
But, it looks like this change may not even be needed anyway as there seems to be a much better way to accomplish what I was originally wanting to do just by adjusting values in the source for setting the radius that the updates are sent.
The last code changes I posted in this thread show how to adjust the source to help reduce bandwidth. As far as I can tell and have heard so far, even just making the changes I posted has made a HUGE impact (in a positive way) on the amount of lag and performance problems on the server. The only time my players have seen noticeable lag since the change was when my server broke 100+ players this weekend, which hasn't happened in a while. So, I am fairly confident that if we can make some code that allows each of these settings to be tweaked in the source, I think we can potentially make a great reduction in bandwidth utilization and allow more players on servers with lower upload speeds and with less lag.
I think we should have settings added to the zones table to set the QueueCloseClients settings for both warping to location and for walking animations. I also think we should have the options to be able to adjust all 4 of the level_distances2 settings individually as well as all 5 of the UPDATE_RESOLUTION settings. Of course there should be defaults set if the fields are left at 0, which would be default for the new fields. But, by giving this option, I really think high traffic zones could be tweaked enough to really make a big difference on any server.
Also, I have set zone wide updates to 10 minutes and so far I haven't noticed any different at all in game other than less lag from when it was set to the default of 1 minute. I will have to try running around in an open zone at GM speed to see if I notice anything weird. But, unless I am wrong, maybe we should allow the globalpositionupdate rule to have a setting that will completely disable zone wide updates. Maybe setting it to something like 0 or so could make it disabled.
Either way, I think we are on the way to increasing server performance for servers with limited bandwidth. I would love to see home servers able to reach the 200 or 250+ player counts that are seen on PEQ or the CEQ Dragon Soul server. I know PEQ is/was hosted in a Data Center which essentially gave it unlimited upload speeds and I assume Dragon Soul is as well.
|
 |
|
 |

10-06-2008, 05:49 PM
|
|
Administrator
|
|
Join Date: Sep 2006
Posts: 1,348
|
|
Yes, you need zonewide updates.
But we can make the zone wide update smarter, it's only really a problem for mobs that move a significant distance in their roam path. Think large zones like plane of growth or temple of veeshan.
The problem is this:
Player is at point A and receives basic mob initial positions.
Player sees mob at point B 1000 units away but because it's out of update range and mob is a roamer it wont update.
Player moves to point B but mob is at point C 1000 units away because it roamed and now sees the ghosted mob because point C is out of update range too and point B was initial position.
We can make it smarter by sending updates to all players if a npc moves a certain distance threshold I think, then we wont have to send a global update for all npcs.
|
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 05:49 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |