40 line record for a computer?

Started by dwalton76, September 11, 2013, 08:09:19 PM

Previous topic - Next topic

Aaron

Quote from: dwalton76How do you play NullpoMino where it plays the same tetrominos everytime?  I would be curious to see how fast my bot is on that
Go to (any) replay, and pause and rerecord it before it starts to play back.
[div align=\\\"center\\\"]
Quote from: AlexandraI don't really know much about hot dogs but I do know Aaron is the greatest moderator ever.
[/div]

dwalton76

Quote from: Integration
I don't know, if you were already introduced to the concept of DAS (Delayed Auto Shift) and DAS Delay. I used DAS Delay = 0 (Options -> GameTuning), which means: if autorepeat takes place, the piece is immediately teleported to the wall. I used DAS = 3 ( customizable when you play Line Race, alternatively Options GameTuning -> MinDAS) , which means: If you press the Left or Right movement key for 3 frames, then the piece will begin to autorepeat (in our case, it is moved immediately to the wall).

Sometimes, you can do multiple inputs in one frame, e.g. you can move (no DAS), rotate and harddrop at the same time. That's what my script aimed for (when I use the word DAS I mean 3 frames, otherwise 1 frame):


Thanks...I've been wondering what DAS stood for   So if my understanding is correct then I want DAS to be ignored when my bot is playing because the bot figures out exactly how many times the block needs to move left or right and then hits the left-arrow or right-arrow key exactly that many times.  I don't think I have a way to control how long the key is held down either which would make it tricky to try to make the bot take advantage of DAS.

In watching your video I think my current bottleneck is the perl SendKeys function.  I can't get it to send keystrokes nearly as fast as the bot in your video.  I'm going to see if I can find a different way to send the keystrokes.

XaeL

Quote from: dwalton76
Thanks...I've been wondering what DAS stood for   So if my understanding is correct then I want DAS to be ignored when my bot is playing because the bot figures out exactly how many times the block needs to move left or right and then hits the left-arrow or right-arrow key exactly that many times.  I don't think I have a way to control how long the key is held down either which would make it tricky to try to make the bot take advantage of DAS.

In watching your video I think my current bottleneck is the perl SendKeys function.  I can't get it to send keystrokes nearly as fast as the bot in your video.  I'm going to see if I can find a different way to send the keystrokes.
You do realise that nullpomino has a bot function. If you use that then the bot will have full knowledge of the field and perfect input...



QuoteLike many setups here, it is useful if your opponent doesn't move and you get 4 Ts in a row.

dwalton76

Quote from: XaeL
You do realise that nullpomino has a bot function. If you use that then the bot will have full knowledge of the field and perfect input...

I did not, but my end game is to build a lego mindstorms robot that play nullpomino so for that I'll need my standalone bot.

Quote from: Kitaru
I wouldn't limit yourself to one keystroke per frame, but you do need to limit yourself to one "packet" of input. Moreover, make sure you're not trying to do something invalid like issue the same rotation on consecutive frames or something -- it's no different than leaving the input held.

What do you mean here by a "packet" of input?  The reason I ask is when I crank the SendKeys delay below 20ms NullpoMino starts missing keystrokes if I send the same keystroke multiple times in a row.  So if I need to move to the right four times and my bot presses RRRR it will only move the block two or three spaces.  

Also, it turns out there isn't a slowness issue with the perl SendKeys function.  I tested by sending a list of tetris commands to notepad and it does that just fine even with a 1ms delay.

Integration

Quote from: dwalton76How do you play NullpoMino where it plays the same tetrominos everytime?  I would be curious to see how fast my bot is on that
There's another way to predefine a piece sequence. First, you have to make a rule with FixedSequence randomizer (via ruleditor.bat, e.g. change the randomizer of StandardZero.rul and save). Then, you have to create a textfile in your NullpoMino folder called "sequence.txt". There you put in the sequence. Each letter (JIZLOTS) represents a piece. For example the content could look like: JIZLOTSITOITOITOITOITOITOITOITO.

Quote from: dwalton76In watching your video I think my current bottleneck is the perl SendKeys function.  I can't get it to send keystrokes nearly as fast as the bot in your video.  I'm going to see if I can find a different way to send the keystrokes.
My keystrokes weren't sent that fast either. If I send a Keydown event I wait 22 ms until I send the corresponding Keyup event (resp. 70 ms if I want to DAS). I also wait 22 ms after each drop and before executing a double-tap.

Quote from: dwalton76What do you mean here by a "packet" of input?  The reason I ask is when I crank the SendKeys delay below 20ms NullpoMino starts missing keystrokes if I send the same keystroke multiple times in a row.  So if I need to move to the right four times and my bot presses RRRR it will only move the block two or three spaces.
You can't go below 20 ms because it's the nature of NullpoMino and any other frame based game. Let's say the computer checks your input at the times: 0, 17, 34, 51 and so on. Let's say you simulate keystrokes which last 14 ms and wait 14 ms between them. You can't know NullpoMino's internal timing, so different things can happen, if you execute a double-tap sequence:

Example 1: First key is pressed down at 2 ms in the timeline.
02-15 Left
16-29 Wait
30-43 Left
Result: First Left key stroke is ignored.

Example 2: First key is pressed down at 5 ms in the timeline.
05-18 Left
19-32 Wait
33-46 Left
Result: Both Left key strokes are interpreted as 1 keystroke.

Example 3: First key is pressed down at 8 ms in the timeline.
08-21 Left
22-35 Wait
36-49 Left
Result:Second Left key stroke is ignored.

I can't really tell you an event based game, that uses bag randomizer. I have noticed, that N-Blox is event based (wow N-Blox is better programmed than Tetris Friends). You might want to try this one. It's not bag randomizer, but very forgiving, so your bot shouldn't have problems.

Kitaru

Quote from: dwalton76What do you mean here by a "packet" of input?
I meant a frame. I was trying to put it in different terms. The point is that you're not limited to a keystroke per frame, but a constituent set of all unique inputs (movement, rotation, drop) per frame.

Quote from: dwalton76So if I need to move to the right four times and my bot presses RRRR it will only move the block two or three spaces.
You need to send R_R_R_R. Tapping every time the game polls for input is equivalent to holding the input. RRRR is just "Right was pressed and held for 4 frames."

Quote from: Integration(wow N-Blox is better programmed than Tetris Friends)
Are we playing the same game? I can't fathom how you've arrived at that conclusion, lol.
<a href=http://backloggery.com/kitaru><img src="http://backloggery.com/kitaru/sig.gif" border='0' alt="My Backloggery" /></a>

dwalton76

Ah, ok, I see what you guys mean now.  Thank you for all of the help