Cuberite Forum

Full Version: It takes a long time to download all terrain
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I run a home server, and the upload speed is not all that good so it can take up to 20 seconds before all initial terrain has been downloaded and I can finally play.

By changing this function, players can enter the world much sooner (cClientHandle.cpp line 1776)
Code:
void cClientHandle::CheckIfWorldDownloaded(void)
{
    if (m_State != csDownloadingWorld)
    {
        return;
    }
    cCSLock Lock(m_CSChunkLists);
    if (m_ChunksToSend.empty())
    {
        SendConfirmPosition();
    }
}
Code:
void cClientHandle::CheckIfWorldDownloaded(void)
{
    if (m_State != csDownloadingWorld)
    {
        return;
    }
    cCSLock Lock(m_CSChunkLists);
    if (m_ChunksToSend.size() < ((m_ViewDistance*2) * (m_ViewDistance*2)) - (4*4) )
    {
        SendConfirmPosition();
    }
}

It's kinda ugly, and it requires the first couple of chunks in the list to be around the player. Luckily for us this is trueTongue

I think the essence of this change NEEDS to be in MCServer, however it could be a tiny bit neater
Do you think it's reasonable, spawning the player so early? The client becomes really jerky if it processes too many new chunks while playing.

I suppose I could implement that properly in the new cChunkSender, perhaps even the distance configurable (globally for the server, in the ini file)
I think the client is able to process chunks faster than that it can receive them. I believe the java server does the same thing, because I can join that server pretty quickly.
Definitely not. When I connect, the chunks are transferred within seconds, but the client builds its displaylists for about a minute. I can see new parts of the map appearing in the game, while no more chunks are sent from the server.
Okay, so what's the problem then?Tongue

When chunks are received instantaneous, the client needs to process them and when received with delay the client also needs to process them...
when the client receives chunks without being spawned, it can prepare the displaylists without the user seeing through the terrain. That's more or less the only point.