Posts for partyboy1a

1 2 3
15 16
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
Yes, that's the reason why I tried the Lua script in first place.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
Well, no, I don't think I am in the mood to start a TAS for this great game, mainly for the following reasons - The game is really long, it would be about three hours - All the movements (even running in a straight line!) have to be done frame-by-frame - There is a lot to test, and some of these require planning about two hours in advance weapons, grinding, death warps, potion and crystal collecting, maybe even glitch abuse
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
the RNG script you linked didn't work, so i fixed the bugs. if it didn't introduce new bugs, get the update here. I derived a small damage test from it, and here are some of my thoughts (which need to be proven right or wrong) A good RN is necessary for critical hits. These do only appear if you attack the "right" spot. If you hit, but just barely, they do not appear. However, it makes a huge difference which speed you have during an attack and how long you have been running in a certain direction. For the same RN and attack but different speeds and positions, my damage varied between 8 and 10 for the blue enemies and doubled for critical hits.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
okay, thanks. both bugs are not present on the interim build.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
I get two kinds of errors in the latest build Navigating to Tools -> External Tools triggers a non-fatal exception from BizHawk.Client.ApiHawk.ExternalToolmanager (type initializer), but this message reappears very often afterwards. I can reliably crash BizHawk in the following way - load some game - open TAStudio - press INSERT - get a fatal out-of-bounds exception
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
Great achievement. I guess it will become the TAS of the year. Do you think it's possible to setup an overflow jump at the first set of elevators at 330 instead of shortly before the final pipe? Next challenge coming up open the moat door without visiting the vanish cap course first.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
I found a minor mistake at 14834 you are caught by Team Rocket, instead of going one step left and talking to them. It's only two extra steps, and you told us that up to three would be faster, so that wastes potentially about a fraction of a second. Or would they turn around and still catch you? More than 200 000 000 rerecords, that's really a lot.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
This somehow reminds me of a TAS where it was enough to press start once to win the game. I don't remember exactly, Teletubbies or something like that. Well, at least it was a challenge which took about 75 minutes for this game (read submission + be lucky that you have the game + create the movie + upload the userfile) and the solution wasn't that obvious. But isn't it about two months too early for such a run?
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
My solver, SAT approach, WIP2, + the required framework. You also need minisat.exe or picosat, for example here: http://minisat.se/downloads/MiniSat_v1.14_cygwin (rename the file after the download). It works, but only for very small puzzles.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
many things already done, but not functional at the moment. When I tried it with the full puzzle, my machine was quite close to a system crash. The small test puzzle uses 16242 clauses, the real one requires about 4 million clauses to describe the game and all the intermediate states... I am not that sure if I continue this one. I somehow got the impression that brute-forcing might still be faster than this solver.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
I said it might be possible to use a SAT solver for this game. I took some time to think about it how that game can be modeled. I try to write down ALL rules which decide which block can be moved to the right side on the first turn. It shouldn't be any problem to do the same for left, up, down. If everything works well, all what needs to be done in the next step is to write these rules for each move. We need a few variables.
1 <= i <= total rows
1 <= j <= total columns
1 <= c <= number of different colors
1 <= d <= 4, d = direction, 1 = right, 2 = left, 3 = up, 4 = down (for example)

M_{i,j,d} <=> The tile which is located in row i, column j can be !M!oved in direction d
C_{i,j,c} <=> The tile at {i,j} has the !C!olor c. 
F_{i,j} <=> There is no tile at {i,j} (!F!ree)

RSC_{i,j} <=> tiles {i,j} and {i,j+1} (one !R!ight) have the !S!ame !C!olor
DSC_{i,j} <=> tiles {i,j} and {i+1,j} (one !D!own) have the !S!ame !C!olor
Some of these are obvious, some are not. Let's start with the more obvious.
RSC_{i,j} <=> (not F_{i,j} AND (not F_{i,j+1}) AND (forall c: C_{i,j,c} == C_{i,j+1,c})
DSC_{i,j} <=> (not F_{i,j}) AND (not F_{i+1,j}) AND (forall c: C_{i,j,c} == C_{i+1,j,c})
if there is a non-movable tile at {x,y} then all the following boolean values must be false:
M_{x,y,1}, M_{x,y,2}, M_{x,y,3}, M_{x,y,4}
M_{x,y-1,1}
M_{x,y+1,2}
M_{x+1,y,3}
M_{x-1,y,4}
The real difficulty is to determine the correct value of M_{i,j} in all the other cases. If X is a non-movable tile, the following cases are easy:
_ _ 1 _ X _ _
..............
_ _ 1 X _ _ _
but we also need to make sure that it works well in the following cases:
1 1 1 _ _ _ _
_ _ 1 _ _ _ _
_ 1 1 1 1 1 _
_ 1 2 1 _ _ _
_ 1 1 1 _ _ _
..............
1 1 1 _ _ _ _
_ _ 1 _ _ _ _
_ 1 1 1 1 1 _
_ 1 2 1 _ _ _
_ 1 1 1 X _ _
..............
1 1 1 _ _ _ _
_ _ 3 _ _ _ _
_ 1 1 1 1 1 _
_ 1 2 1 _ _ _
_ 1 1 1 _ _ _
I'm not sure how to code that in such a way that every movable thing gets moved. I take the following guess:
M_{i,j,1} if (and only if???) ALL of the following conditions are met:

1) either F_{i,j+1} or M_{i,j+1}
2) if RSC_{i,j} then M_{i,j+1,1}
3) if RSC_{i,j-1} then M_{i,j-1,1}
4) if DSC_{i,j} then M_{i+1,j,1}
5) if DSC_{i-1,j} then M_{i-1,j,1}
If the above works for every case you can think of, I can go on and encode the winning condition, which will be quite hard. I hope you have a good idea for that, my idea would require N*R*C variables per turn, where N is the number of tiles which must become connected. And with 200 tiles on a 32*32 field, and a solution of 100 turns, this would need 20.480.000 variables and many clauses just for the winning condition. Improving that in some way might be necessary for a usable solver. -------------------------- From the mathematical point of view, I guess it would be sufficient to only encode "movable to the right", because all other cases can be done in other ways: move left: flip the playing field horizontal move up/down: flip diagonal Both ways of encoding work, I'm not sure which one works better
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
qqwref wrote:
The idea of SAT solving is very interesting, and I'd love to hear more.
I don't want to go off-topic here too much, so here are a few links: To know what the boolean satisfiability problem is all about, read this part from Wikipedia: https://en.wikipedia.org/wiki/Boolean_satisfiability_problem My solver uses the conjunctive normal form, which is described here. I posted the solver in the following thread: Thread #8509: Polarium I also created a framework, which allows you to use a more natural language, in Lua, which can be found in this thread. You may probably need to know a way to encode an at-most-k-constraint, which is described either here, or you may have a look at my source code, where i use a way to encode at-most-k to count the "touched" tiles. And the biggest problem of all: You need to model every single (even totally obvious) rule in the language of a boolean satisfiability problem, and the model must be optimized in a "nice" way. "nice" is what makes the solver fast, and is very hard to predict....
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
Is this game purely deterministic, even the Joker tiles? In that case, it should be possible to use a SAT solver to find the optimal solutions, like I did it for Polarium. That would be a difficult but doable task, as it requires you to describe the game and the solution as a set of non-changeable boolean variables (whenever a variable would possibly change its value in the usual context, you need to invent a new variable at that moment). The good thing is that you wouldn't have to worry that much about optimizations and memory usage, as these are all done by the highly optimized SAT solver in that case. I haven't seen your solver. Most of the solutions look very good, and I'm sure you put a lot of effort into making these movies. Definitely good enough for Vault, maybe good enough for Moons.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
I created something similar for creating my Plok movie, which was also used for the 100% Super Mario World 2 movie, but instead of only displaying RAM differences it also supports delta-copy-and-paste for the input. It's for Snes9x but it shouldn't be too difficult to adjust it for other emulators. I used a small file which can read and write Lua tables from files, then you could avoid the hassle of parsing your custom text files by hand.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
No, I'm not talking about that... There is a small animation each time after the lines get cleared. If you clear the bottom lines, all lines above must wander down. In the NES version, this is done instantly. In the DS version, there is a small animation which shows the progress how the field changes. The field won't be changed if the top four lines are cleared. This should make the animation unnecessary because the field is already in the right state. I think this could save about one third or one half of a second for each four lines cleared. I think there must not be even a single block above the cleared lines to get this to work.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
If you only clear the top four lines, it wouldn't be necessary for the other pieces to drop down, so this should save quite a fair amount of time.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
Wow. First submission, and it improves a starred movie. I'll watch it later. And welcome here! We have TASers all over the world, you might find one of your language in the non-english forum. What's your first language anyway?
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
p-solver-v3.1.0 now has a --challenge_mode option. There might exist puzzles in challenge mode that could not be solved beforehand. The following puzzle is unsolvable in normal mode, but is solvable in challenge mode thanks to 2 empty lines on the top:
8 17
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0
0 1 1 1 1 1 0 1 1 1 0 1 1 1 1 1 0
0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0
1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0
0 1 0 0 0 1 0 1 0 0 0 0 1 1 1 0 0
1 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0
0 0 0 0 0 1 0 1 0 0 0 0 1 0 1 0 0
(It will also display a warning that the generated solution is possibly suboptimal for this one, but the game doesn't support that large puzzles. I'm not going to implement the mixed strategy for that reason.)
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
As both versions are good, I'd go with the submitted version. (It may also save some encoding work.) Then this movie would be beatable by one that shows the "CLEAR" message after all puzzles are done on an earlier frame than my movie does. If one just goes for shortest input time, he or she would have to beat the shorter version. It won't be easy to beat this one though.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
OK, I uploaded the shorter version to my user files, here: http://tasvideos.org/userfiles/info/9019948908770913. It reaches the end after the same amount of time. Feel free to use this one if you dislike the somewhat complicated original goal. This would just be shortest input until ending is reached without further input.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
Bobo the King wrote:
Easily worthy of publication to the Vault. With that said, I'd like to know two things: 1) What is the basic idea behind the bot? Surely there are some basic concepts in there. What was your strategy in writing it? (Also, are these puzzles NP-complete, as I suspect?) 2) Why does it look like you trace twice over every path? I realize this may be an automatic process by the game, but I found it kind of distracting. What's going on here?
1) I think the problem "is the puzzle solvable?" is NP-complete. Well, the bot isn't easy to explain, you'll need to read the source code. I'm sorry, I don't have that much time right now to explain it. 2) I let the solver draw every path twice because otherwise you wouldn't have any time to see the solution that was used. I also do that after puzzle 100 for consistency. Not doing that would save 45 frames of input, but the ending wouldn't appear faster.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
AzureLazuline wrote:
Of course, the main interest of this TAS was the bot used to make it, and the various redesigns it went through. Perhaps you should talk more about that in the description
That was a good advice, I updated the description once more. Thanks for the votes
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
OK, I updated the submission text to explain the basic idea of the game.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
At first, my solver used a start point and went on step by step on the path. The solver from ais523 used a different design: It mainly held some data which tiles are connected. That was a huge speedup for the final solver that was used. The most interesting part of this is how the fastest solution was found: The "problem" was converted into a set of boolean variables (more than 10000 for each puzzle and each solving attempt!), and a lot of clauses in the so-called conjunctive normal form. Then another computer program was used to find one out of the potentially 2^10000 combinations of the boolean variables. Such solvers are extremely well programmed pieces of software, they can find one solution in a reasonable amount of time. Writing a specialized program to brute-force all paths would take extremely long, especially if there are many different paths to try (as it is the case for stage 21 for example). As long as you don't find any method for faster input, you shouldn't be able to find a faster path. Challenge mode should be more interesting, it's a bit more like Tetris.
feos wrote:
Didn't understand a thing, voted No.
Oh, I should have included a few words about the concept of this game: You do see a field with black and white tiles, surrounded by gray tiles. Your task is to draw a path (the yellow thing). If your path hits a black or white tile, this tile is flipped. If this causes all tiles in the row to become black, or all tiles become white, then this row is deleted. The gray tiles always stay gray, they don't matter for that. Sometimes, it's necessary to use those gray tiles too. Your task is to draw a path so that all lines get deleted at once. The movie itself is still not very exciting to watch. It was an interesting project nevertheless.
Experienced Forum User, Published Author, Player (136)
Joined: 9/18/2007
Posts: 389
There are some functions missing for challenge mode right now. The solver will only work correctly if there is either 1 or 0 empty lines on the top part of the puzzle. And if there is no empty line on the top, you need the --no_top_border option, tell the solver about all 10 rows, and ignore the top row of the solution. The solver uses a 10x9 field with 1 tile of border on all sides internally, but then forbids using any field of the top row. If there are two or more empty lines, this won't be handled correctly right now. The solver will use at most one line from the top border. And: It's a pity your assumption that the input between the puzzles can be botted entirely is wrong. Up from the fifth puzzle on, 4 more waiting frames are required, and some even need 8 waiting frames. I tested it up to the first 50 puzzles. Pressing start too early will result in the puzzle counting as not being solved... HERE is a Lua script which generates a movie file which solves the first 50 puzzles. It's somewhat optimized, but some fine-tuning can still be done. (You can skip the first ~370 lines, they contain the TASed start before the first puzzle.) It requires luabot_fastest_puzzle_xxx for all 100 puzzles to be in the same directory. -------------- For strategy: We should test if it's faster to let the blocks stack up so high that it almost triggers a game over before we start to delete any rows. This would decrease the falling distance for the topmost tiles by quite a large amount.
1 2 3
15 16