October 28, 2021, 15:01:47

Author Topic: Logic behind a match 3 game like Bejeweled  (Read 307 times)

Offline c0d3r9

  • Full Member
  • ***
  • Posts: 172
Logic behind a match 3 game like Bejeweled
« on: December 19, 2020, 22:23:54 »
I create a match 3 game many years ago but the last problem was that at some point the new items doesn´t allow new combinations.
Have anybody an logical idea how to solve that problem?
Desktop: Win10@64bit - AMD Ryzen 5 3400G - MSI B450 Tomahawk - 16GB Ram - 240GB SSD

Offline blinkok

  • Sr. Member
  • ****
  • Posts: 381
Re: Logic behind a match 3 game like Bejeweled
« Reply #1 on: December 19, 2020, 22:49:05 »
I feed in a colour that is one of the remaining colors or a least heavily weighted towards that group of colours

Offline Derron

  • Hero Member
  • *****
  • Posts: 3675
Re: Logic behind a match 3 game like Bejeweled
« Reply #2 on: December 20, 2020, 08:48:34 »
You either do forward-solving - or you check if there is at least ONE allowed move ("switch elements").

allowed move: if not, then mix the board (not visually), check for possible combinations ... and once you found a working solution (maybe even check for "x possible combinations", not just 1) you do the visual shuffling


forwardsolving: only add combinations which allow combinations if the current board would else have no combination possibility. You can even increase "likelyness". So if there is only one combination on the board, you should most probably add some new "could combine" when adding new ones ("falling down"). There is surely a sweet spot. If there are 20 combinations possible on the board this surely means there are so many "randomly aligned" elements, that almost every new added block will be combineable too already.


bye
Ron

Offline c0d3r9

  • Full Member
  • ***
  • Posts: 172
Re: Logic behind a match 3 game like Bejeweled
« Reply #3 on: December 21, 2020, 23:48:44 »
Okay thank you both for the tips...I think this is a new sideby project over the xmas days ;)
Desktop: Win10@64bit - AMD Ryzen 5 3400G - MSI B450 Tomahawk - 16GB Ram - 240GB SSD

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal