Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Collapsi

be the last player able to move around a collapsing grid · By Riffle Shuffle & Roll

Collapsi - digital version in JS

A topic by Sentinel65 created 18 days ago Views: 290 Replies: 24
Viewing posts 1 to 18
(4 edits)

Hi, 

I'm still working step by step on improving the digital version. 

Digital version in JavaScript - option to play against AI (heuristic and minimax), PvP game, solo mode with several difficulty levels.

My older son pointed out the solo mode to me, complaining that he often fails to complete the game board. We discussed the rules of solo mode and agreed that the game board cannot be randomly generated. Especially for solo mode, I redesigned the board generation using a solvable game board generator. The game log now includes a generated list of solutions, including a link to play back an animation of the generated solution for a given board. Playback can be canceled by pressing the Reset button or selecting another option from the list. The corrected list of moves, including intermediate steps, is now included in the game log.

Click on the game banner to display help.

Collapsi JS

Developer (2 edits)

I’m afraid you are misunderstanding the rules (which is my fault). Every board is solvable. I will have a better video soon. I know I did not do a good job explaining. 

You do not need an Ace beside the exit joker.  Think of the exit joker as a door. All you need to be able to do is pass through the door, so any number will work. 

I think I understand it correctly. The last active card (not the black joker) can basically have any value, because when you play the last active card on the black joker, the value of the card does not matter; either it matches the joker directly (which would have to be an ace) or it passes (any higher value). The important thing, however, is that the last active card must be adjacent to the black joker either directly or across the edge of the board. Is that correct?

Developer

That is correct!  Again, I apologize for the miscommunication on my end.  I've received quite a few comments about how the game ends, so I need to get a new video up ASAP. 

This was actually the last thing I changed about the solo game.  Before, I was planning on telling people that the puzzle must have an ace that can access the exit joker.  That meant the player would have to identify the problem and fix it, and I did not like that solution.  So, I changed the rules to make it a smoother game.  Now I just need to communicate that better! 

Developer

Have you seen the most up-to-date rules for how to start the game?  Players must move from the joker to an adjacent card as their first move.  This includes cards they can reach through wrapping if their starting joker is on the edge of the board.  

(1 edit)

This is version 1.3.0 of your rules.

SOLO GAME

Start with a 3x3 grid using the following cards: two jacks, three 1’s and 2’s, and one 3. Shuffle and deal out the 3x3 grid. The first jack revealed is your first starting card. That card is the beginning of the puzzle.

Your objective is to collapse the entire grid before exiting. The second jack is the exit card. To successfully exit the puzzle, you must be able to land on or pass through the exit card. If you successfully collapse allthe cards before exiting, you win. All of the rules from the regular game apply. There are two ways to increase the difficulty of the solo game: 1) replace low numbers with higher numbers or 2) make the grid bigger by adding more cards to the deck.

The rules document has been updated to include the solo version of Collapsi (video below).

I noticed this in the post about solo mode, but in the first sentence you write that it applies to the solo version for multiplayer.

I have also revised how the multiplayer game begins. Rather than moving up to four spaces from your joker to begin the game, jokers are now 1's. You can only move one space. I have also included an alternative starting method in the variations section of the rules doc: all jokers/face cards begin the game collapsed. Players choose their starting card for the game.  

So I assume that the rules for the solo mod for 1 player remain unchanged. The red joker has 1, 2, 3, or 4 moves at its discretion, and then the number of moves depends on the value of the card I land on.

I think that the version I programmed, which includes solo mode, does not violate your rules.

Developer

When I play as Red (Player),  Blue (AI), Alternate, or Random, I can move from the joker to any card on the board, I am not limited to one card adjacent from the joker.  I love playing with your app.  It is very well done!

Developer

Also, could you help me out with the solo game?  I would like to know if there are any unsolvable puzzles when the first move is limited to a card that is adjacent to the starting joker( just like the multiplayer game), even if is it on the edge and can reach other cards through wrapping.  I have only played and tested that you can move to any card on the grid.  I have not been able to gather data about this new way to start (the same rules as the multiplayer game now).

Yes, the red joker leads the first move, and here the player can determine how many steps to use (1, 2, 3, 4), but then they must use as many steps as the value of the card they are standing on. That should correspond to your rules. But solo mode is something else. I originally played solo with a 4x4 board. After about 5 games, I managed to fold the board down to the black joker. But then I didn't manage it for a long time, and then I managed it again. But in my opinion, it was probably just a coincidence. So I modified the program to 3x3, and it's better here, but even so, there are combinations of 3x3 card layouts where the board is unplayable. That's why my son gave me the idea to generate game boards recursively. This means that the generation starts by placing the black joker, and then a card of any value is added to it, provided that it must be adjacent to it directly or via wrap-around. The next cards are added to the last card placed according to the same principle (they must be adjacent) and with a value that complies with the rules of the number of steps, wrap-around, and other rules. Finally, a red joker is placed on the last empty space on the game board, and the game board is recursively composed and, most importantly, always has a solution.

I don't quite understand the question. Are you considering a rule that in a solo game for one player, the red joker will also only be able to move one space, as in multiplayer?

I can't judge this, it completely changes the conditions of the game and it's more up to the AI and the creation of some kind of generator that would test the set conditions of the rules against the generated game board. 

Under the current conditions, I have two simple sets of cards (easy and medium difficulty) and five sets for hard difficulty in the program. However, there is a certain limitation here as well, in that not just any set of cards can be used.

I would rather summarize the rules precisely. Mainly, the game board for 2 or more players can be generated completely randomly, because the primary goal is to see who will be the first to have no legal move. Whereas solo mode is like a classic puzzle, it must always be solvable. And that's probably not possible with some combinations. I asked the AI and it gave me this example:

R 3 3

2 2 4

4 1 B

The restriction in solo mode to 1 move on the first turn, as intended in multiplayer, can have unexpected consequences for players because they will not be able to choose the card that seems most suitable to them on a freshly generated game board, but will be limited to the adjacent card (for the first move, this is a restriction to 3 moves - if adjacent to a black joker - or 4 moves instead of 7). It is really up to the AI to create a generator that evaluates this and determines whether the game board is solvable under these conditions or not. But to apply this rule in real life, when we shuffle 9 or, in the worst case, 16 cards and arrange them randomly, we have no idea whether it is playable under the given conditions.

I am preparing a solo mod for the 4x4 board, and with the right card sets and a solvable game board, it will be very interesting even with the existing rules.

Developer

I appreciate everything you are doing for Collapsi!  I know we have a lot of messages going back and forth, so I hope you don’t miss this one. 

Developer (2 edits)

I have been working with a solving program for a few months (with the rule that from the joker you can go to any card in the grid).  Trust me, these puzzles can be solved as long as there is a 1 that can access the exit joker. =^)

The solver has not been changed to account for the potential rule change that the player must move to an adjacent card from the starting joker.

Try it out in your solving program to see if it solves this combination.

R 3 3

2 2 4

4 1 B

Developer

Are you trying to solve this puzzle with the rule that you must land exactly on the exit, or that any adjacent card can be used to win?  

Developer (1 edit)

In regard to your app, when I play the multiplayer game, it is not beginning correctly.  From the starting joker, I can move to any card on the board.  The updated rules state that you must move from the joker to an adjacent card.  The starting joker is essentially a 1 now.  I think you said the app plays that way, but it's not doing that for me.  When playing under all of the multiplayer modes, the piece can be moved to any card on the board from the starting joker.

(2 edits)

You need to rewrite and update the rules. It's getting a little chaotic :-) From what I wrote above and quoted from you, what you wrote yourself, it logically followed that the new rule applies only and exclusively to multiplayer! So logically, I had no reason to change it for 2 players. I consider multiplayer to be 3 or more players, which I logically assumed would only be implemented in the card version, not the digital version.

Regarding the composition of this particular case, the program is set up so that the last move on the black joker can lead directly to it or through it, so the value of the card doesn't matter if I go for the black joker.

Here, I modified the program so that in solo mode, the first move from the red joker is set to 1 step. You can try it out and test it. It makes sense to me in multiplayer mode because there are more people in the game and the last one in line would be at a disadvantage. With two players, it doesn't make sense to me at all.

Developer (1 edit)

Thank you for taking the time to do this.   Just so you know, multiplayer is a shorter way to say multiple players meaning two or more.  Single player means one player and sometimes the term "solo" is used to describe a game for one player.   Again, I want to emphasize that I am very happy you have put so much effort into the online implementation of Collapsi!  It has been awesome to play.

The rule book has been updated since 6/30/2025.  The deck of cards used for the 4x4 grid and the 6x6 grid was also changed to include Jacks rather than jokers (since most people have four jacks on hand, and not every deck has jokers).  You can download the pdf for the rule book on the game's main Itch page.  Here is the setup from the rule book:

Player 1 goes first.  The number of spaces you must move is determined by the number on your starting card.  A starting card is the card on which you begin your turn.  On your first turn, your starting card is a jack which allows you to move one space.  After you complete your move, flip your starting card face down.  That card has collapsed, and it can no longer be passed through or landed on.   From your second turn on, you must move a number of spaces equal to your starting card’s number.  If your starting card is a 2, you must move two spaces.  If it is a 3, you must move three spaces and so on.  Your starting card will collapse every turn.

I am done with rule updates for the multiplayer game (meaning 2 or more players), so this is what stands.  =^)

Regarding the solo game, I have removed it from the rule book entirely until I can get some more data regarding what works and what doesn't. 

My cousin helped me with the solver that used the older rule set, and he generated unsolvable and solvable puzzles, but I have not seen the data.  I fear my rule change that makes every board possible also makes the puzzle far too easy.  I'm leaning towards scrapping the solo version altogether.

Is there any way you could email me, so we can streamline this conversation a bit?  My email is marksball@gmail.com

(10 edits)

Hi, thanks for the feedback. I misunderstood when I saw you talking about 3- and 4-player games in the chat.

I modified the program according to the rules so that the first move of both players is only 1 step, and I fixed the situation so that a joker cannot move onto another joker. The second and subsequent moves are governed by the rule of the value of the card I land on, and I have the corresponding number of steps available in my move.

I'm leaving the solo game in the program because I really like it, and the generator I use creates solvable board variations. See the game logo image  (Generated solution path). Try click to replay solution.

Collapsi JS



I added a new version, simplified the menu, added a solo mode for the 4x4 board, both 3x3 and 4x4 modes generate a solvable game board from several assembled sets of cards. After selecting the game mode, a colored marker appears, indicating the difficulty of the generated game board.

   

      // 3x3

      '1,1,1,2,2,2,3,B,R': '🟢',

      '1,1,2,2,3,3,4,B,R': '🟡',

      '1,2,3,3,3,3,4,B,R': '🟠',

      '1,2,3,3,4,4,4,B,R': '🔴',

      '2,2,3,3,4,4,4,B,R': '🟣',

      '2,3,3,3,4,4,4,B,R': '🟣',


      // 4x4

      '1,1,1,1,2,2,2,2,3,3,3,3,4,4,B,R': '🟢',

      '1,1,1,2,2,2,3,3,3,3,4,4,4,4,B,R': '🟡',

      '1,1,2,2,2,2,3,3,3,3,4,4,4,4,B,R': '🟠',

      '1,1,2,2,2,3,3,3,3,3,4,4,4,4,B,R': '🔴',

      '1,2,2,2,3,3,3,3,3,4,4,4,4,4,B,R': '🟣'

Developer

Awesome!!!! 

(2 edits)

Added button to switch AI mode settings minimax:


0 - minimax

2 - first 2 moves heuristics → minimax

3 - first 3 moves heuristics → minimax