Astera-org / minetest

Minetest is an open source voxel game engine with easy modding and game creation
https://www.minetest.net/
Other
0 stars 0 forks source link

Pull in upstream changes #60

Open jedmccaleb opened 4 days ago

jedmccaleb commented 4 days ago

There have been a lot of commits upstream. We should pull in if not a major pain.

mickvangelderen commented 2 days ago

The only large merge conflict on the CPP side I see is, unfortunately, in src/network/connection.cpp. They added a bunch of code there (~1200 lines) which suggests that there has been a large change in how the client/server communication is being done, which may affect our client wait for all peers mechanic and lock-step client server simulation in general.

mickvangelderen commented 2 days ago

Some of the newly added code

void Server::yieldToOtherThreads(float dtime)
{
    /*
     * Problem: the server thread and emerge thread compete for the envlock.
     * While the emerge thread needs it just once or twice for every processed item
     * the server thread uses it much more generously.
     * This is usually not a problem as the server sleeps between steps, which leaves
     * enough chance. But if the server is overloaded it's busy all the time and
     * - even with a fair envlock - the emerge thread can't get up to speed.
     * This generally has a much worse impact on gameplay than server lag itself
     * ever would.
     *
     * Workaround: If we detect that the server is overloaded, introduce some careful
     * artificial sleeps to leave the emerge threads enough chance to do their job.
     *
     * In the future the emerge code should be reworked to exclusively use a result
     * queue, thereby avoiding this problem (and terrible workaround).
     */
mickvangelderen commented 2 days ago

Server startup was moved to another thread, trying to figure out if the server and client still run in the same thread in the end https://github.com/minetest/minetest/pull/14512/files