Official Everybody Edits Forums

Do you think I could just leave this part blank and it'd be okay? We're just going to replace the whole thing with a header image anyway, right?

You are not logged in.

Advertisement

Hello, visitor! These forums are run off of the revenue generated from these ads. If you'd like to support us, please whitelist us or consider donating:

#1 2017-03-07 22:55:01

ninjasupeatsninja
Member
From: USA (hooray!)
Registered: 2015-04-05
Posts: 1,308

Disable wait inbetween placing blocks.

If you don't know, there's a small wait inbetween placing blocks.
Bots have to Thread.Sleep(5); and wait five milliseconds before placing another block, and this is pretty helpful for preventing bot block spam and trollers trolling too much.
However, I'd like it do be disabled!

In the world options, there'd be a checkbox "Disable Block Wait". By default, this is enabled. If you uncheck it, bots no longer have to Thread.Sleep(0);, and blocks are placed instantly.

Protocol Changes:

At '38' in 'init', there'd be a boolean: InstantBlocks.

b373f161.png

There would be "instantblock", send parameters:

"instantblock"

0 - boolean, enable instant blocks is true, disable instant blocks is false

Recieve message would be the same

"instantblock"

0 - boolean, enable instant blocks is true, disable instant blocks is false

In world db objects:

"instantblocks" true or false


1 woot = 1 supporter
This would make bots able to place blocks significantly faster, as well as benefits to the player, and it is toggle-able, so that you can choose whether or not it is on.

Last edited by ninjasupeatsninja (2017-03-07 22:55:25)


Link Explorer | My Website
My First Account, boy I'm old.
Registered-December%2030,%202010-blue.png?style=flat
14392495e4a0.png

Offline

#2 2017-03-07 23:08:55

Slabdrill
Formerly 12345678908642
From: canada
Registered: 2015-08-15
Posts: 1,472
Website

Re: Disable wait inbetween placing blocks.

huh the block limit is that high? last time i heard it was 96/s

btw i thought it was there to prevent some major issue or something. if its not, support


kL6IDgb.png
made by anatoly

Offline

#3 2017-03-07 23:10:17

destroyer123
Member
From: England
Registered: 2016-06-03
Posts: 404

Re: Disable wait inbetween placing blocks.

Although this would be good, the main reason is that if there was no delay, then bots would basically be DOSing the servers, and that isnt a very good thing... (I think this is the main reason the delay was added in the first place)

Also, if you want a bot to place blocks faster, use a queue and timers instead of Thread.Sleep() because the latter isnt very accurate, and ends up as about 15+ ms per block usually, which could be improved by about 30+% if you have a good connection.

If you cant be bothered to impliment this, then I've done it in my ConnectedWorld library (a plugin for WorldSaver), Im probably going to upload the source too some time, if you dont want a whole library

Edit:

12345678908642 wrote:

huh the block limit is that high? last time i heard it was 96/s

It is 100 messages per second I think, read that^ for an explanation for why this is the case for what Ninja is doing

Last edited by destroyer123 (2017-03-07 23:11:41)

Offline

#4 2017-03-07 23:37:44

ninjasupeatsninja
Member
From: USA (hooray!)
Registered: 2015-04-05
Posts: 1,308

Re: Disable wait inbetween placing blocks.

12345678908642 wrote:

huh the block limit is that high? last time i heard it was 96/s

btw i thought it was there to prevent some major issue or something. if its not, support


5 milliseconds,

1000 / 5 = 200

200 bps

destroyer123 wrote:

Although this would be good, the main reason is that if there was no delay, then bots would basically be DOSing the servers

The servers are paid for, so they can handle quite a bit of messages. Plus, think back to when there was 1000 players, how many "m" was being sent, how many blocks were being placed, all those rooms!

destroyer123 wrote:

Also, if you want a bot to place blocks faster, use a queue and timers instead of Thread.Sleep() because the latter isnt very accurate, and ends up as about 15+ ms per block usually, which could be improved by about 30+% if you have a good connection.

That's very insteresting, I'd like to read/see more about that.


Link Explorer | My Website
My First Account, boy I'm old.
Registered-December%2030,%202010-blue.png?style=flat
14392495e4a0.png

Offline

#5 2017-03-07 23:59:03

destroyer123
Member
From: England
Registered: 2016-06-03
Posts: 404

Re: Disable wait inbetween placing blocks.

ninjasupeatsninja wrote:

That's very insteresting, I'd like to read/see more about that.

Here is a quick test to show you what im talking about:

using System;
using System.Threading;

namespace SleepTest
{
    class Program
    {
        static void Main(string[] args)
        {
            { // Control
                long oneSecond = DateTime.Now.Ticks + TimeSpan.TicksPerSecond;
                int loops = 0;
                while (DateTime.Now.Ticks < oneSecond)
                {
                    loops++;
                }

                Console.WriteLine("Control: " + loops);
            }

            while (true)
            {
                Console.Write("\nDelay: ");
                int delay;
                if(!int.TryParse(Console.ReadLine(), out delay)) break;

                Console.WriteLine("Target: " + (1000 / delay));

                { // Sleep test
                    long oneSecond = DateTime.Now.Ticks + TimeSpan.TicksPerSecond;
                    int loops = 0;
                    while (DateTime.Now.Ticks < oneSecond)
                    {
                        Thread.Sleep(delay);
                        loops++;
                    }

                    Console.WriteLine("Sleep test: " + loops);
                    Console.WriteLine("Actual sleep: " + (1000 / loops));
                }
            }
        }
    }
}

And the output:

Control: 1316387 (This shows that the loop executes very fast without the sleep, so the speed of the rest of the code doesnt significantly affect the results)

Delay: 5
Target: 200
Sleep test: 69
Actual sleep: 14

Delay: 10
Target: 100
Sleep test: 65
Actual sleep: 15

Delay: 20
Target: 50
Sleep test: 36
Actual sleep: 27

Delay: 50
Target: 20
Sleep test: 18
Actual sleep: 55

Delay: 100
Target: 10
Sleep test: 10
Actual sleep: 100

Last edited by destroyer123 (2017-03-08 00:02:36)

Offline

#6 2017-03-08 01:04:54

Tomahawk
Member
From: England
Registered: 2015-02-18
Posts: 827

Re: Disable wait inbetween placing blocks.

Spam blocks fast enough and you'll crash the world. There's a good reason why an artificial limit was introduced.

Use multiple bots if you need to draw faster.


One bot to rule them all, one bot to find them. One bot to bring them all... and with this cliché blind them.

Offline

#7 2017-03-08 02:08:49

Slabdrill
Formerly 12345678908642
From: canada
Registered: 2015-08-15
Posts: 1,472
Website

Re: Disable wait inbetween placing blocks.

Tomahawk wrote:

Spam blocks fast enough and you'll crash the world. There's a good reason why an artificial limit was introduced.

Use multiple bots if you need to draw faster.

ok lets just lower the limit then
5 in 5ms sound good?


kL6IDgb.png
made by anatoly

Offline

#8 2017-03-08 02:57:28

hummerz5
Forum Mod
From: wait I'm not a secret mod huh
Registered: 2015-08-10
Posts: 4,170

Re: Disable wait inbetween placing blocks.

many questions to address

ninjasupeatsninja wrote:

The servers are paid for, so they can handle quite a bit of messages. Plus, think back to when there was 1000 players, how many "m" was being sent, how many blocks were being placed, all those rooms!

well the idea of zero-delay is basically saying "let's compare this potentially infinite rate of blocks to this otherwise previously limited rate of blocks" which doesn't really make sense. It's an oversimplification, but I want to argue that creating a system with "but old parameters worked well, why can't our new situation be ramped up" is nonsense because we still ideally want to be able to do that previous throughput. If we use your logic, then we're liable to hit some ceiling.

Tomahawk wrote:

Spam blocks fast enough and you'll crash the world. There's a good reason why an artificial limit was introduced.

but what's the underlying cause?

Tomahawk wrote:

Use multiple bots if you need to draw faster.

so the cause is somehow not related to ... the connection? But yet, the fact that it's one connection? That says something about architecture if you feel multiple bots is a solution (as opposed to saying "ninja, your idea is entirely unnecessary because we don't need to go that fast" -- instead you say "yes you're on to something, use multiple bots)

12345678908642 wrote:

ok lets just lower the limit then
5 in 5ms sound good?

you're relenting so quickly. But again, who are we to blindly make decisions as to what the limits should be without knowing why they exist?

and finally, what if we look at this another angle?
remember this gem? -- yeah, sure, block spam is a bummer. But if whatever reason we have delays is message-related and not block-information-processing related, then we could just neatly lump it together yeah?


fT09tOL.png
?type=lastlogin&name=hummerz5
rip the creator of this sig, zoey

Offline

#9 2017-03-08 10:45:57

NVD
EE Admin
From: The Netherlands
Registered: 2015-02-15
Posts: 401
Website

Re: Disable wait inbetween placing blocks.

TRIGGER WARNING

Offline

Wooted by:

#10 2017-03-08 10:50:24

Onjit
Member
From: Batmania, Australia
Registered: 2015-02-15
Posts: 6,328
Website

Re: Disable wait inbetween placing blocks.

NVD wrote:
TRIGGER WARNING

wow great response
really helpful

i assume that it's not possible due to inevitable strains on the server?


👌

Offline

Onjit1488966624649932

Board footer

Powered by FluxBB

[ Started around 1493256331.616 - Generated in 0.089 seconds, 11 queries executed - Memory usage: 1.19 MiB (Peak: 1.34 MiB) ]