I’ve gotten my hands dirty pretty deep into world partition and I don’t think it is even possible to query for the loaded cell count ahead of time without adding some functions of your own.
For instance, I added a UWorldPartitionSubsystem::IsStreamingCompleted overload, that takes a function parameter for another purpose, but you could do similar to call back into your code with each cell where you can just count them.
bool UWorldPartitionSubsystem::IsStreamingCompleted(EWorldPartitionRuntimeCellState QueryState, const TArray<FWorldPartitionStreamingQuerySource>& QuerySources, bool bExactState, TFunctionRef<void(const UWorldPartitionRuntimeCell* Cell)> CellCallback) const
Any notion of “how many cells need to be loaded” type query will need to provide a query source anyways, so I think this would be the appropriate path to adding such a query.
Edit:
Out of the box, you can use the for each functions of the world partition. Almost forgot about those.
I’ve done some visualization of the cells for our NetImGui debugger to get more insight into the system than what is normally surfaced. There’s a lot it’s doing under the hood.
[Image Removed]This is gathered and consolidated like so
`WorldPartitionSubsystem->ForEachWorldPartition([&](UWorldPartition* WorldPartition)
{
if (IsValid(WorldPartition->RuntimeHash))
{
WorldPartition->RuntimeHash->ForEachStreamingCells([&](const UWorldPartitionRuntimeCell* Cell)
{
// count your cells or whatever
return true;
});
return true;
}
return true;
});`