Columns (Sega) gameplay mechanics question

General software. From trouble with the Banyan Tree to OCP Art Studio, post any general software chat here. Could include game challenges...
Post Reply
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Columns (Sega) gameplay mechanics question

Post by ParadigmShifter »

So I'm writing a(nother) columns style game which will also be the new engine for the improved version of SJOE (memory permitting). It uses the top secret tiled background mode on the Spectrum :D

Image

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.
EDIT: I don't think it's necessary/sufficient to only have 3 tile types placed for a board clearable in 1 either I think some tiles could be different to the tiles of the piece in hand as long as they fall into a position next to 2+ of the same tile.

Also if anyone wants to try creating solvable in X moves boards that would be handy too :D

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!
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Columns (Sega) gameplay mechanics question

Post by ParadigmShifter »

I'm guessing columns must wait until all falling pieces settle like what I do before re-evaluating the position since you may clear more than something you just formed when the physics settles, otherwise it would be cheating you out of potential clears. It would also have to distinguish between falling pieces and pieces that should be cleared (I use a single bit for that in the collision, falling or ready for removal are the same, just handled differently in physics and score/removal phase. I could use 2 bits though but I don't think I need to now) otherwise it might try and clear a piece in mid air that hasn't settled into place yet.

So gonna carry on with how it currently works. Which is good because doing a full board evaluation while it is also scrolling stuff down would have been expensive.
User avatar
Lee Bee
Dynamite Dan
Posts: 1297
Joined: Sat Nov 16, 2019 11:01 pm
Location: Devon, England
Contact:

Re: Columns (Sega) gameplay mechanics question

Post by Lee Bee »

I can't advise on the gameplay, but it's looking nice :-)
User avatar
Joefish
Rick Dangerous
Posts: 2059
Joined: Tue Nov 14, 2017 10:26 am

Re: Columns (Sega) gameplay mechanics question

Post by Joefish »

I don't think I've ever seen this, or any other game like it, do match-ups and eliminations whilst individual pieces are still able to fall into space below them - whether they're still under player control, or whether they're 'physics'-falling because pieces under them have just been eliminated.
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Columns (Sega) gameplay mechanics question

Post by ParadigmShifter »

I'll stick with what I am doing then.

Physics just sounds cooler ;)

Could do with a mashup of this

Image

and this

Image

As a logo for the splash screen since it uses my (patent pending and TM)

Mullet Physics Library

* other mullets are available, doesn't have to be Michael
User avatar
ParadigmShifter
Manic Miner
Posts: 670
Joined: Sat Sep 09, 2023 4:55 am

Re: Columns (Sega) gameplay mechanics question

Post by ParadigmShifter »

I've uploaded a TAP file of progress so far.

https://fastupload.io/vXJHAS0phrJqvPS/file

It all goes wrong if it tries to scroll when it should drop a piece from offscreen, I really need to fix that. So don't tell me that is bugged, I know.

If you see any suspicious clears/things you thought should be cleared but weren't I might be interested in that though (gif is fine, TZX is better obvs). Every time I see a suspicious clear if I try and reproduce it it looks fine though I was just too unobservant to notice it ;)

The pieces always come out in the same order so you can always repeat what you did if you see a gnarly bug (and have an amazing memory lol).


Keys: QAOPM

Not really lol ;)

It's WASD to move. Z and C are debug keys that move diagonally downwards with only 1 keypress, will be removed once the movement is fully working (rotation will be included at some point).

W to move up will also be removed when gravity gets turned on.
Post Reply