News:

NEW! Get all Tourneybot Results from the new Board here: http://www.fibsboard.com/tourneybot-results/

Main Menu

Only one command per second?

Started by Chris, March 09, 2005, 11:05:58 PM

Previous topic - Next topic

Chris

Hi all,

I'm writing a new bot for fibs and would like to know whether the amount of commands is restricted by fibs.

I've heard that only one command per second is allowed.
Is this really true? And does it happen to all kind of commands or only to tells/shouts/whatever?

Is there anything written about it? In the CLIP Specification nothing is mentioned.
How do other bots or clients as JavaFibs handle this issue?

Thanks in advance, Chris

MadMatt

#1
Unfortunately, it seems to be more complicated than that.

One connection can only be executing one command at any given time. If FIBS receives any additional input from that same connection before the execution of the previous command is completed, it simply discards the new input.

This "feature" makes it a lot more difficult to code FIBS improvements, especially bots. (Graphical clients are not that much of a problem, because users cannot usually input commands that quickly, although I can see there might be cases when a client might want to send multiple commands quickly).

The way TourneyBot gets around this problem is that it waits for the response from the previous command before sending a new one. This works because TourneyBot uses a very small subset of FIBS commands, mainly just rawwho, whois, shout, tell and message. Whenever it sends a command, it waits for all possible responses (for whois, for example, it's the whois lines or the error message if there is no such player) and only then proceeds with sending the next command to FIBS. It would be a real pain to check for every possible response if TourneyBot  had to use more commands and check for every possible response from those. Fortunately, Evan McLean did a wonderful job detailing the CLIP protocol.
MadMatt
----------

TourneyBot Website

amarganth

I remarked the problem, if I send some "tell"'s in a row. If i do not wait at least 0.8 seconds, sometimes, some commands weren't execuded. If I wait 1.0 seconds between them, no lines get lost.

In normal bot playing commands: roll, move xx, ... I never lost commands. May be, because I'm not sending two of them in a second.

If i startup my bot, i send some initial commands to fibs:
- boardstyle
- toggle moves
- show saved
- ...

These commands will be stacked. I've never lost a command.

May be there is an anti-flooding mechanism active? (shout, tell, ...)

I'm also interested, to know the exact handling.
To be is to do
          Sokrates
To do is to be
          Sartre
Do be do be do
          Sinatra

Chris

#3
Hm, that are bad news - at least some additional work ...

MadMatt, by the way - how do you deal with commands, which don't reach fibs for some reason, so that you don't get an answer? Do you wait some time and send that command again?

Quote
In normal bot playing commands: roll, move xx, ... I never lost commands. May be, because I'm not sending two of them in a second.

Perhaps that's just coincidence, that one second is between them. For example if you move, then fibs has answered your roll with a new board ... that's what MadMatt described.

Quote
If i startup my bot, i send some initial commands to fibs:
- boardstyle
- toggle moves
- show saved
- ...

These commands will be stacked. I've never lost a command.

Hm, this is a bit contradictory to MadMatt, perhaps it's an exception ... who knows.

amarganth

#4
This is the log of NiceRollerBot from the beginning of the conversation:

2005.03.10 21:03:03[***] Start log
2005.03.10 21:03:22[<-1]WELCOME TO THE
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  Ã, _______ Ã,  _ Ã,  Ã,  Ã,  Ã,  Ã, ______ Ã,  Ã,  Ã,  Ã,  Ã,  Ã, _____
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  | Ã, _____| | | Ã,  Ã,  Ã,  Ã, | Ã, __ Ã, \ Ã,  Ã,  Ã,  Ã,  Ã, / ____|
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  | |___ Ã,  Ã, | | Ã,  Ã,  Ã,  Ã, | |__| Ã, | Ã,  Ã,  Ã,  Ã, | |____
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  | Ã, ___| Ã,  | | Ã,  Ã,  Ã,  Ã, | Ã, __ Ã, < Ã,  Ã,  Ã,  Ã,  Ã, \____ \
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  | | Ã,  Ã,  Ã,  | | Ã,  Ã,  Ã,  Ã, | |__| Ã, | Ã,  Ã,  Ã,  Ã,  Ã, ____| |
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  |_|irst Ã,  |_|nternet |______/ackgammon |_____/erver
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  If something unexpected happens please send mail to:
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  marvin@fibs.com (Andreas Schneider)
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, Bug reports are welcome.
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  This server is on the net to meet people from all countries.
2005.03.10 21:03:22[<-1] Ã,  Ã,  All sorts of racists and fascists are not allowed to login here!
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã, Rude language will not be tolerated on this server. Be nice.
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, LOGIN AS guest IF YOU ARE NEW TO THIS SERVER!
2005.03.10 21:03:22[<-1] Ã,  Ã,  Ã,  One account per person only!
2005.03.10 21:03:23[<-1]Thursday, March 10 21:01:32 MET Ã,  ( Thu Mar 10 20:01:32 2005 UTC )
2005.03.10 21:03:23[<19]login:
2005.03.10 21:03:24[F>>]login =CHNiceRoller_V0.99$ 1008 NiceRollerBot ********
2005.03.10 21:03:25[F>>]set boardstyle 3
2005.03.10 21:03:26[F>>]set redoubles 4
2005.03.10 21:03:27[F>>]toggle
2005.03.10 21:03:28[F>>]show saved
2005.03.10 21:03:29[< 0]1 NiceRollerBot 1110136878 65.228.203.62.cust.bluewin.ch
2005.03.10 21:03:29[< 1]2 NiceRollerBot 1 1 0 1 0 0 1 1 5150 0 1 0 1 2097.01 1 0 0 1 0 UTC
2005.03.10 21:03:29[< 2]3
2005.03.10 21:03:29[<-1]+--------------------------------------------------------------------+
2005.03.10 21:03:29[<-1]| Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, |
2005.03.10 21:03:29[<-1]| Ã, AAARRRRGGGGGHHH! Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, |
2005.03.10 21:03:29[<-1]| Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, |
2005.03.10 21:03:29[<-1]| Ã, We have a new moron this week. Ã, If you send mail and expect an Ã,  Ã, |
2005.03.10 21:03:29[<-1]| Ã, answer, make sure that you've whitelisted me in your challenge- Ã,  |
2005.03.10 21:03:29[<-1]| Ã, response system. Ã, I will not jump through your hoops. Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  |
2005.03.10 21:03:29[<-1]| Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, |
2005.03.10 21:03:29[<-1]| Ã, If you want to know why challenge-response is a bad idea, I will Ã, |
2005.03.10 21:03:29[<-1]| Ã, explain it to you. Ã, Short answer: it turns you into a spammer. Ã,  Ã, |
2005.03.10 21:03:29[<-1]| Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, |
2005.03.10 21:03:29[<-1]+--------------------------------------------------------------------+
2005.03.10 21:03:29[< 3]4
2005.03.10 21:03:29[<-1]Value of 'boardstyle' set to 3.
2005.03.10 21:03:29[<-1]Value of 'redoubles' set to 4.
2005.03.10 21:03:29[<-1]The current settings are:
2005.03.10 21:03:29[<-1]allowpip Ã,  Ã,  Ã,  Ã, YES
2005.03.10 21:03:29[<-1]autoboard Ã,  Ã,  Ã,  YES
2005.03.10 21:03:29[<-1]autodouble Ã,  Ã,  Ã, NO
2005.03.10 21:03:29[<-1]automove Ã,  Ã,  Ã,  Ã, YES
2005.03.10 21:03:29[<-1]bell Ã,  Ã,  Ã,  Ã,  Ã,  Ã, NO
2005.03.10 21:03:29[<-1]crawford Ã,  Ã,  Ã,  Ã, YES
2005.03.10 21:03:29[<-1]double Ã,  Ã,  Ã,  Ã,  Ã, YES
2005.03.10 21:03:29[<-1]greedy Ã,  Ã,  Ã,  Ã,  Ã, NO
2005.03.10 21:03:29[<-1]moreboards Ã,  Ã,  Ã, YES
2005.03.10 21:03:29[<75]moves Ã,  Ã,  Ã,  Ã,  Ã,  NO
2005.03.10 21:03:29[F>>]toggle moves
2005.03.10 21:03:29[<-1]notify Ã,  Ã,  Ã,  Ã,  Ã, YES
2005.03.10 21:03:29[<-1]ratings Ã,  Ã,  Ã,  Ã,  YES
2005.03.10 21:03:29[<-1]ready Ã,  Ã,  Ã,  Ã,  Ã,  NO
2005.03.10 21:03:29[<-1]report Ã,  Ã,  Ã,  Ã,  Ã, YES
2005.03.10 21:03:29[<-1]silent Ã,  Ã,  Ã,  Ã,  Ã, NO
2005.03.10 21:03:29[<-1]telnet Ã,  Ã,  Ã,  Ã,  Ã, YES
2005.03.10 21:03:29[<-1]wrap Ã,  Ã,  Ã,  Ã,  Ã,  Ã, NO
2005.03.10 21:03:29[<-1] Ã, opponent Ã,  Ã,  Ã,  Ã,  Ã, matchlength Ã,  score (your points first)
2005.03.10 21:03:29[<77] Ã, Robocop Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  1 Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 0 - Ã, 0
2005.03.10 21:03:29[<77] Ã, wildwoman Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  1 Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 0 - Ã, 0
2005.03.10 21:03:29[<77] Ã, maxilex Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  1 Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 0 - Ã, 0
2005.03.10 21:03:29[<77] Ã, spielberg Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  1 Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 0 - Ã, 0
2005.03.10 21:03:29[<77] Ã, rkent Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  1 Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 0 - Ã, 0
2005.03.10 21:03:29[<77] Ã, Jojo Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 1 Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã,  Ã, 0 - Ã, 0
2005.03.10 21:03:29[<-1]** You want a list of moves after this game.

Commands marked with [F>>] were sent to FIBS, commands with [<##] I got back from FIBS. I always wait 1 second between sending commands.

You can see, that commands (at least at the beginning) were stacked.

Greetings

amarganth
To be is to do
          Sokrates
To do is to be
          Sartre
Do be do be do
          Sinatra

MadMatt

QuoteHm, that are bad news - at least some additional work ...

What kind of improvement are you making? A new playing bot?

Quote
MadMatt, by the way - how do you deal with commands, which don't reach fibs for some reason, so that you don't get an answer? Do you wait some time and send that command again?

Well, since TourneyBot always waits for confirmation of the previous command before sending a new one, this never happens. In theory. In practice, TourneyBot only waits 5 seconds for confirmation, then proceeds onto the next command in its queue, discarding the first one. I believe RepBot handles that in exactly the same way. A better implementation would perhaps be to retry the unsuccessful command, but in reality, that's not really necessary because it never happens, unless in cases of extreme lag that I've never experienced with FIBS yet. Plus, the only bad thing that can happen if a command does not get through is that a player does not get a tell and/or message, which is not a big deal, since they can always query the bot to get the information.



Quote
Quote
In normal bot playing commands: roll, move xx, ... I never lost commands. May be, because I'm not sending two of them in a second.

Perhaps that's just coincidence, that one second is between them. For example if you move, then fibs has answered your roll with a new board ... that's what MadMatt described.

I do not think you can rely on the one second rule. First of all, I think it works the way I described it. It seems that RepBot creators agree as well. Secondly, there is simply no way you can guarantee a delivery one second apart, even if it the one second rule holds. If there's lag anywhere between your server and FIBS, FIBS might not receive a command for a few seconds, then receive two at approximately the same time. They might be one second apart or more, but they might be only a few milliseconds apart, too. I think the only way to get a stable bot that doesn't swallow commands is to do it the hard way with confirming commands.

Quote
These commands will be stacked. I've never lost a command.

Of this I am not sure. It is possible that only tell, shout and other communication commands get swallowed. I do remember noticing this feature with tell first. Perhaps further testing should be done to clear up the matter. TourneyBot, however, makes the effort to confirm all the commands  it sends.
MadMatt
----------

TourneyBot Website

cthulhu

FIBS only handles one command from any user. If you send another one before the first has been executed it will be helplessly lost. However, waiting one second between commands sent will work most of the time. Unless the lag monster is awake, of course.
I think that's about the time I wait in JavaFIBS between commands and it works very well in normal times.

amarganth

Sorry, cthulhu, but this is definitively not true. See my log above:

I send "set boardstyle", "set redoubles", "toggle" and "show saved" at 21:03:25, 26, 27, 28. The answers are coming in sequence all at 21:03:29. No command get's lost.

To be is to do
          Sokrates
To do is to be
          Sartre
Do be do be do
          Sinatra

aram

I guess it is a sort of 'antispamming' feature, so I would expect it to work only on tells, shouts, kibitzes & C.

That could be the explanation for amarganth being able to send more than 1 command/second.

Control commands category : > 1 cmd/sec allowed
Chat (and maybe other) commands category : approx 1 cmd/sec allowed.

cthulhu

QuoteCommands marked with [F>>] were sent to FIBS, commands with [<##] I got back from FIBS. I always wait 1 second between sending commands.


Sorry, cthulhu, but this is definitively not true. See my log above:

I send "set boardstyle", "set redoubles", "toggle" and "show saved" at 21:03:25, 26, 27, 28. The answers are coming in sequence all at 21:03:29. No command get's lost.
Didn't you just say that you waited one second between your commands?

amarganth

:blink:
I ment this:
QuoteIf you send another one before the first has been executed it will be helplessly lost.

I send 3 commands, waiting 1 second between them. And *after* this, I got all answers from all three commands. So I think, FIBS stacks these commands.

To be is to do
          Sokrates
To do is to be
          Sartre
Do be do be do
          Sinatra

MadMatt

Quote:blink:
I ment this:
QuoteIf you send another one before the first has been executed it will be helplessly lost.

I send 3 commands, waiting 1 second between them. And *after* this, I got all answers from all three commands. So I think, FIBS stacks these commands.
Um, that doesn't actually prove anything. All this shows is that each of these commands takes less than one second to complete. All commands should go through with the one second delay (that's a very long time)  unless there is lag. Try sending them without delay like a few hundred times in a row and then we'll maybe see if they get swallowed or not.
MadMatt
----------

TourneyBot Website