View Single Post
  #29  
Old 10-04-2008, 03:17 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

Hmm, I haven't turned update manager on myself. But, after checking into it more, it seems like both are actually being used. Both update manager and the hard setting at the same time. It seems like the hard setting is the cutoff to where it will only use the zonewide update timer. But, within the hard setting it uses the settings from the update manager.

What I have done so far is to change the hard settings from 800 down to 400 like this:

mob.cpp
Code:
// this one just warps the mob to the current location
void Mob::SendPosition() {
	EQApplicationPacket* app = new EQApplicationPacket(OP_ClientUpdate, sizeof(PlayerPositionUpdateServer_Struct));
	PlayerPositionUpdateServer_Struct* spu = (PlayerPositionUpdateServer_Struct*)app->pBuffer;	
	MakeSpawnUpdateNoDelta(spu);
//?	spu->heading *= 8;
#ifdef PACKET_UPDATE_MANAGER
	entity_list.QueueManaged(this, app, true);
#else
	entity_list.QueueCloseClients(this, app, true, 400);
#endif
	safe_delete(app);
}
Code:
// this one is for mobs on the move, with deltas - this makes them walk
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), 400, NULL, false);
#endif
	safe_delete(app);
}
I also slightly tweaked the update manager settings to be a little smaller and less frequent for mid range distances:

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, 400*400, 600*600 };
	
//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
		12*UPDATE_RESOLUTION,	//~2s
		48*UPDATE_RESOLUTION	//~10s
	  };
And finally, I set my rule for the zonewide updates from 1 minute to 10 minutes. I really don't even know if we need zone wide updates at all. After these changes, so far the raids in Dreadspire which I was using as a reference for the lag issues have said that the lag is now completely gone. I still need to do more testing, but so far this is looking promising. We may not want these same settings across the board or anything, but certainly smaller closed in zones like dungeons should have the option to lower these settings.

I posted the code changes with colors because this isn't any sort of a final code submission. If I come up with anything that seems final, I will try to get it in the format that KLS is wanting. But, the code currently posted should help make it easier to discuss further steps.

Oh, an one idea I had that could potentially save me a TON of bandwidth was if I could disable position updates completely maybe by setting them to 0 for my server base zone which is Nexus. I only have 1 roaming NPC in there anyway, so if I stopped it from roaming, they wouldn't need position updates. And since that zone is almost always occupied by many AFK players, it would potentially save me a TON of bandwidth. Also, if we ever get the bazaar working, I think we should have similar options to help reduce bandwidth in there.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!

Last edited by trevius; 10-04-2008 at 11:21 PM..
Reply With Quote