Does anyone know if pieces are cleared AS SOON AS another piece lands on them or does it wait until all pieces have stopped falling before it re-evaluates the board state?
I'm doing the latter (only look for new 3 in a rows once all pieces have stopped falling) which is of course much better for performance reasons but even so I am interested in what Columns actually did. If pieces can clear during the physics phase I may at least try and support it I guess.
I know pieces are not cleared until they land on something (so a piece in midair cannot form a 3 in a row until it lands on another piece, so I'm not asking about that. I'll try and produce a gif of the situation arising in this game but it doesn't happen very often EDIT: The situation does happen in that GIF but you have to slow it right down using a viewer such as this https://onlinetools.com/image/gif-player - the situation happens in the middle of the cascade where a line of 3 waves is made while another column is still falling, the waves are not removed until the physics settles. If you slow it right down you can see I am not beating the raster at all times when scrolling columns down, but as long as it doesn't flicker and it happens so fast you don't notice I am ok with that - it's a lot less flickery than SJOE physics was anyway Also the collision minimap will not appear in the finished game so may speed things up a bit.
Video evidence would of course be the best proof, but most columns videos I have seen online are very long and cascading clears seem to be rare (and a piece forming a 3 in a row when another piece is still falling is quite a rare thing to happen).
Does anyone know if there are any online position solvers as well? I was thinking of adding challenge mode where you are given a set board position and number of tiles, know the order you will get given them, and the challenge is to remove all tiles using the pieces you are given? I can think of a way to brute force a solution using minimax (an algorithm which I've never implemented but isn't hard to do) but generating solvable initial layouts will also be a challenge. The only way I can think of doing that is generating all boards which can be cleared in 1 move then reversing time and adding some more tiles which leads to the position being solvable with 2 tiles, etc. Most likely up to a maximum of 8 or 10 tiles in the tile pool. I imagine implementing that algorithm is going to be slooooow though (I would of course use a PC to search for solvable positions). It seems similar to how chess engine endgame databases are generated (again something I know not much about but there's a lot of resources online about them).
Anyone got any better ideas for how to generate solvable positions and tile order to solve them?
I may also post that in programming if no one knows in "games" forum.
Here's an example of a board clearable in 1, so they are not (all) trivial positions... they can get quite complicated I think, so brute force searching for them all will be quite hard I expect... and then recursing adds many more decision points so I expect a brute force search is going to take a long time and a lot of memory...
Code: Select all
.....
.....
.a.a.
ababa
Piece in hand: BAA
Solution:
..B..
..A..
.aAa.
ababa
All A's are cleared and the B falls in between the 2 at the bottom clearing those as well.
Also if anyone wants to try creating solvable in X moves boards that would be handy too
The board is 9 wide and 12 high (3 rows are off screen but you lose if all clears have happened and there is any tile in that area. There are 5 tile types (Star, Square, Waves, Circle, Cross). 3 diagonal pieces can count as a match as well as vertical/horizontal of course.
You will be able to both shuffle (ABC -> CAB or BCA) and flip (ABC -> CBA) the piece you are in control of (3x1 column) - which is different to columns where you can only shuffle. That does not matter though since we can assume you always place a piece in the correct position
I will probably also add the SJOE rotation in as well which of course does affect how pieces can be placed (can place horizontally and any overhanging tile drops before the board is evaluated).
Cheers!