Cuberite Forum
It takes a long time to download all terrain - Printable Version

+- Cuberite Forum (https://forum.cuberite.org)
+-- Forum: Cuberite (https://forum.cuberite.org/forum-4.html)
+--- Forum: Development (https://forum.cuberite.org/forum-13.html)
+--- Thread: It takes a long time to download all terrain (/thread-372.html)



It takes a long time to download all terrain - FakeTruth - 03-01-2012

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


RE: It takes a long time to download all terrain - xoft - 03-01-2012

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)


RE: It takes a long time to download all terrain - FakeTruth - 03-01-2012

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.


RE: It takes a long time to download all terrain - xoft - 03-01-2012

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.


RE: It takes a long time to download all terrain - FakeTruth - 03-01-2012

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...


RE: It takes a long time to download all terrain - xoft - 03-01-2012

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.