suppress unchanged entities

This commit is contained in:
ZappoMan 2014-08-29 21:51:08 -07:00
parent d1a046e6ed
commit 1fa587b88a
3 changed files with 89 additions and 54 deletions

View file

@ -59,6 +59,7 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
qDebug() << "EntityTreeElement::appendElementData()"; qDebug() << "EntityTreeElement::appendElementData()";
qDebug() << " getAACube()=" << getAACube(); qDebug() << " getAACube()=" << getAACube();
qDebug() << " START OF ELEMENT packetData->uncompressed size:" << packetData->getUncompressedSize(); qDebug() << " START OF ELEMENT packetData->uncompressed size:" << packetData->getUncompressedSize();
qDebug() << " params.lastViewFrustumSent=" << params.lastViewFrustumSent;
} }
OctreeElement::AppendState appendElementState = OctreeElement::COMPLETED; // assume the best... OctreeElement::AppendState appendElementState = OctreeElement::COMPLETED; // assume the best...
@ -89,8 +90,24 @@ OctreeElement::AppendState EntityTreeElement::appendElementData(OctreePacketData
EntityItem* entity = (*_entityItems)[i]; EntityItem* entity = (*_entityItems)[i];
bool includeThisEntity = true; bool includeThisEntity = true;
if (wantDebug) {
qDebug() << "params.forceSendScene=" << params.forceSendScene;
qDebug() << "entity->getLastEdited()=" << entity->getLastEdited();
qDebug() << "entity->getLastEdited() > params.lastViewFrustumSent="
<< (entity->getLastEdited() > params.lastViewFrustumSent);
}
if (!params.forceSendScene && entity->getLastEdited() < params.lastViewFrustumSent) {
if (wantDebug) {
qDebug() << "NOT forceSendScene, and not changed since last sent SUPPRESSING this ENTITY"
<< entity->getEntityItemID();
}
includeThisEntity = false;
}
if (hadElementExtraData) { if (hadElementExtraData) {
includeThisEntity = entityTreeElementExtraEncodeData->includedItems.contains(entity->getEntityItemID()); includeThisEntity = includeThisEntity &&
entityTreeElementExtraEncodeData->includedItems.contains(entity->getEntityItemID());
if (wantDebug) { if (wantDebug) {
qDebug() << " hadElementExtraData=" << hadElementExtraData; qDebug() << " hadElementExtraData=" << hadElementExtraData;
qDebug() << " entity[" << i <<"].entityItemID=" << entity->getEntityItemID(); qDebug() << " entity[" << i <<"].entityItemID=" << entity->getEntityItemID();

View file

@ -134,73 +134,83 @@ bool MovingEntitiesOperator::PreRecursion(OctreeElement* element) {
// check against each of our search entities // check against each of our search entities
qDebug() << " --------- PROCESSING list of moving entities -----------"; if (wantDebug) {
qDebug() << " --------- PROCESSING list of moving entities -----------";
}
foreach(const EntityToMoveDetails& details, _entitiesToMove) { foreach(const EntityToMoveDetails& details, _entitiesToMove) {
qDebug() << " PROCESSING --- MOVING ENTITY"; if (wantDebug) {
qDebug() << " entity=" << details.entity; qDebug() << " PROCESSING --- MOVING ENTITY";
qDebug() << " entityItemID=" << details.entity->getEntityItemID(); qDebug() << " entity=" << details.entity;
qDebug() << " oldCube=" << details.oldCube; qDebug() << " entityItemID=" << details.entity->getEntityItemID();
qDebug() << " newCube=" << details.newCube; qDebug() << " oldCube=" << details.oldCube;
qDebug() << " newBox=" << details.newBox; qDebug() << " newCube=" << details.newCube;
qDebug() << " oldContainingElement=" << details.oldContainingElement; qDebug() << " newBox=" << details.newBox;
qDebug() << " oldFound=" << details.oldFound; qDebug() << " oldContainingElement=" << details.oldContainingElement;
qDebug() << " newFound=" << details.newFound; qDebug() << " oldFound=" << details.oldFound;
qDebug() << " newFound=" << details.newFound;
if (!details.oldFound) { if (!details.oldFound) {
qDebug() << " THIS ENTITY'S OLD LOCATION HAS NOT BEEN FOUND... "; qDebug() << " THIS ENTITY'S OLD LOCATION HAS NOT BEEN FOUND... ";
} }
if (entityTreeElement == details.oldContainingElement) {
qDebug() << " THIS ELEMENT IS THE ENTITY'S OLD LOCATION... ";
}
if (entityTreeElement == details.oldContainingElement) {
qDebug() << " THIS ELEMENT IS THE ENTITY'S OLD LOCATION... ";
} }
// If this is one of the old elements we're looking for, then ask it to remove the old entity // If this is one of the old elements we're looking for, then ask it to remove the old entity
if (!details.oldFound && entityTreeElement == details.oldContainingElement) { if (!details.oldFound && entityTreeElement == details.oldContainingElement) {
qDebug() << " PROCESSING REMOVE ENTITY FROM OLD ELEMENT <<<<<<<<<<<<<"; if (wantDebug) {
qDebug() << " PROCESSING REMOVE ENTITY FROM OLD ELEMENT <<<<<<<<<<<<<";
}
entityTreeElement->removeEntityItem(details.entity); entityTreeElement->removeEntityItem(details.entity);
qDebug() << "removing entityItem from element... "; if (wantDebug) {
qDebug() << " entity=" << details.entity; qDebug() << "removing entityItem from element... ";
qDebug() << " entityItemID=" << details.entity->getEntityItemID(); qDebug() << " entity=" << details.entity;
qDebug() << " entityTreeElement=" << entityTreeElement; qDebug() << " entityItemID=" << details.entity->getEntityItemID();
qDebug() << " element=" << element; qDebug() << " entityTreeElement=" << entityTreeElement;
qDebug() << " element->getAACube()=" << element->getAACube(); qDebug() << " element=" << element;
qDebug() << " element->getAACube()=" << element->getAACube();
}
_foundOldCount++; _foundOldCount++;
//details.oldFound = true; // TODO: would be nice to add this optimization //details.oldFound = true; // TODO: would be nice to add this optimization
} }
// If this element is the best fit for the new bounds of this entity then add the entity to the element // If this element is the best fit for the new bounds of this entity then add the entity to the element
bool bestFitCube = entityTreeElement->bestFitBounds(details.newCube); if (wantDebug) {
bool bestFitBox = entityTreeElement->bestFitBounds(details.newBox); bool bestFitCube = entityTreeElement->bestFitBounds(details.newCube);
qDebug() << " bestFitCube=" << bestFitCube; bool bestFitBox = entityTreeElement->bestFitBounds(details.newBox);
qDebug() << " bestFitBox=" << bestFitBox; qDebug() << " bestFitCube=" << bestFitCube;
if (bestFitCube != bestFitBox) { qDebug() << " bestFitBox=" << bestFitBox;
qDebug() << " WHOA!!!! bestFitCube != bestFitBox!!!!"; if (bestFitCube != bestFitBox) {
qDebug() << " WHOA!!!! bestFitCube != bestFitBox!!!!";
}
if (!details.newFound) {
qDebug() << " THIS ENTITY'S NEW LOCATION HAS NOT BEEN FOUND... ";
}
if (entityTreeElement->bestFitBounds(details.newCube)) {
qDebug() << " THIS ELEMENT IS THE ENTITY'S BEST FIT NEW LOCATION... ";
}
} }
if (!details.newFound) {
qDebug() << " THIS ENTITY'S NEW LOCATION HAS NOT BEEN FOUND... ";
}
if (entityTreeElement->bestFitBounds(details.newCube)) {
qDebug() << " THIS ELEMENT IS THE ENTITY'S BEST FIT NEW LOCATION... ";
}
if (!details.newFound && entityTreeElement->bestFitBounds(details.newCube)) { if (!details.newFound && entityTreeElement->bestFitBounds(details.newCube)) {
qDebug() << " PROCESSING ADD ENTITY TO NEW ELEMENT <<<<<<<<<<<<<";
EntityItemID entityItemID = details.entity->getEntityItemID(); EntityItemID entityItemID = details.entity->getEntityItemID();
qDebug() << "adding entityItem to element..."; if (wantDebug) {
qDebug() << " entity=" << details.entity; qDebug() << " PROCESSING ADD ENTITY TO NEW ELEMENT <<<<<<<<<<<<<";
qDebug() << " entityItemID=" << entityItemID; qDebug() << "adding entityItem to element...";
qDebug() << " entityTreeElement=" << entityTreeElement; qDebug() << " entity=" << details.entity;
qDebug() << " element=" << element; qDebug() << " entityItemID=" << entityItemID;
qDebug() << " element->getAACube()=" << element->getAACube(); qDebug() << " entityTreeElement=" << entityTreeElement;
qDebug() << " element=" << element;
qDebug() << " element->getAACube()=" << element->getAACube();
}
entityTreeElement->addEntityItem(details.entity); entityTreeElement->addEntityItem(details.entity);
_tree->setContainingElement(entityItemID, entityTreeElement); _tree->setContainingElement(entityItemID, entityTreeElement);
@ -208,7 +218,9 @@ bool MovingEntitiesOperator::PreRecursion(OctreeElement* element) {
//details.newFound = true; // TODO: would be nice to add this optimization //details.newFound = true; // TODO: would be nice to add this optimization
} }
} }
qDebug() << " --------- DONE PROCESSING list of moving entities -----------"; if (wantDebug) {
qDebug() << " --------- DONE PROCESSING list of moving entities -----------";
}
// if we haven't found all of our search for entities, then keep looking // if we haven't found all of our search for entities, then keep looking
keepSearching = (_foundOldCount < _lookingCount) || (_foundNewCount < _lookingCount); keepSearching = (_foundOldCount < _lookingCount) || (_foundNewCount < _lookingCount);

View file

@ -3,15 +3,9 @@
2) Test file save load for case where two siblings have more than MTU amount of data. I wonder if the fact that file save 2) Test file save load for case where two siblings have more than MTU amount of data. I wonder if the fact that file save
doesn't include the extra exists bits will break something. doesn't include the extra exists bits will break something.
3) Make sure LOD logic honors the LOD settings for entities in "spanners/parent" cells.
-- network - don't SEND small entities even if their spanner cell is visible
7) some jutter with moving entities 7) some jutter with moving entities
-- I think this might only happen with lots of models in an element or in view -- I think this might only happen with lots of models in an element or in view
this may be related to issue 13 below -- test lots of entities with the new suppress mode
8) Look into why non-changed octree cells are being resent when editing an entity --
this is probably because we're marking the trees as dirty -- but we probably can not send entitys that haven't changed
10) What happens if the edit properties don't fit in a single message MTU??? 10) What happens if the edit properties don't fit in a single message MTU???
@ -34,6 +28,15 @@
// NICE TO HAVE: // NICE TO HAVE:
Z) Consider using client side "on the fly" billboard of entites to handle LOD
-- have routine to shoot views of an entity for 6 faces
-- store those images in the entity on the client
-- based on camera position pick "closest" face of model
-- as LOD drops use those images instead of rendering the model
3) Make sure LOD logic honors the LOD settings for entities in "spanners/parent" cells.
-- network - don't SEND small entities even if their spanner cell is visible
-- if animation is stopped, changing frame doesn't update the simulation -- if animation is stopped, changing frame doesn't update the simulation
@ -231,6 +234,9 @@
// FIXED -- animations are on different frames -- the data suggest they are the same frame number from a simulation perspective // FIXED -- animations are on different frames -- the data suggest they are the same frame number from a simulation perspective
// SOLVED -- 50) Verify pruning logic... // SOLVED -- 50) Verify pruning logic...
// SOLVED -- 51) LOD for rendering - don't render small entities even if their spanner cell is visible // SOLVED -- 51) LOD for rendering - don't render small entities even if their spanner cell is visible
// SOLVED -- 52) Look into why non-changed octree cells are being resent when editing an entity --
// this is probably because we're marking the trees as dirty -- but we probably can not send entitys that haven't changed
// Solution -- suppress sending of entities that haven't been edited since the last view frustum sent