Some More Jewel Game Clones (Work In Progress)
KevinCross
London, UKMember Posts: 1,894
Unfortunately this Bejewelled clone template has taken a lot longer than I hoped, and there's still a way to go but I am working on it.
I think I'll be sharing it again for free once it's finished, even though this one has been a lot more complicated then the last. However I'm not going to be able to make it public until the loops have been improved in GameSalad, because at the moment it takes too long to loop through 64 iterations which is why in the video below you see a delay before the jewels are destroyed. I've tried it with a timer, an alternative to a timer someone sent me a little while ago, and the loop behaviour in the nightlies. I'm hoping the loop behaviour will be fixed in the next version of the nightly because I have a game idea that I want to build myself with this template.
This one has been set up a little different from the last template because this time I'm looping through a table.
What I need to work on next is filling in the empty slots in the grid when jewels are destroyed.
I think I'll be sharing it again for free once it's finished, even though this one has been a lot more complicated then the last. However I'm not going to be able to make it public until the loops have been improved in GameSalad, because at the moment it takes too long to loop through 64 iterations which is why in the video below you see a delay before the jewels are destroyed. I've tried it with a timer, an alternative to a timer someone sent me a little while ago, and the loop behaviour in the nightlies. I'm hoping the loop behaviour will be fixed in the next version of the nightly because I have a game idea that I want to build myself with this template.
This one has been set up a little different from the last template because this time I'm looping through a table.
What I need to work on next is filling in the empty slots in the grid when jewels are destroyed.
Comments
Shadows Peak is an atmospheric psychological horror that explores the dark side of a player.
Sjee, that will keep me awake for a while
Lump Apps and My Assets
If you can let me know the game type I will rename the file accordingly, add in notes and upload it as it is as another starting template before taking what I've learnt from this one to create a Bejewelled clone/template.
I love how fast it is
P.S. I reloaded it a couple of times to show the jewels dropping in the grid, the destroying of jewels starts about 8 seconds into the clip. The white boxes that show before the jewels are destroyed are there for testing purposes. In the final game they would be invisible.
I need to set it so that you can choose the minimum number of blocks need to be adjoining before they're destroyed which should be easy enough.
Enclosed is a README.pdf and the project has notes throughout it. What's missing from this (aside from the obvious like menus and scoring) is that it does not refresh the grid if there aren't any possible moves. You might be able to use what's in the project to check through the grid or even loop through the table regularly.
It has the option to set the minimum number of blocks that need to be adjoining before they're destroyed.
If I update the project in the future I will update the file in the same location. Next on the list is the Bejewelled clone.
This is a nightly only build. It will probably open in 10.3 and 10.4 but for some reason it runs painfully slow in both of those versions, yet blisteringly fast in the nightly build.
Apologies to anyone that has recently downloaded it and opened it in GameSalad 10.3 or 10.4 and found it really slow/buggy. I originally created it in the nightly build where it worked fine, but decided to convert it over to 10.4 as it isn't using things like loops and the first couple of times I tried it it seemed fine but after a while noticed a couple of settings not quite copied across correctly and that it was painfully slow.
I've since updated the zip file (about 6 minutes ago).
I have no idea why the nightly is running much quicker than 10.3 and 10.4. I'm going to continue sticking with the nightlies from now on.
I like that it does not take any timers to loop through the table. And that is an interesting technique for checking adjacent squares.
Have you thought about using the table exclusively to check adjacent squares. That eliminates the need to spawn any actors and can be an efficient method too.
That worked fine in that template but I was experiencing problems with it when I was working on a Bejewelled template, problems I might still experience with this new approach (hopefully I don't). Ideally I need to be able to destroy jewels and still be able to swap other jewels while those are being destroyed, which is something I've not been able to achieve with loops and relying on values in the table due to speeds and delays.
I imagine I'm going to need to do some full table reads when it comes to checking whether or not it's possible to make any more moves so it may end up being a mix of different methods.
I was just thinking out-loud that you can do the same kind of algorithm with tables that you are doing with spawned actors. And you still wouldn't need to worry about loops or timers. (Just like you don't need to worry about loops with the spawning actor approach you are using.) It's the same algorithm. It's just done by referring to table cells to designate which actor to test (rather using spawned actors).
It was just an idea. But I like your approach. Its all good!
I woke up at about 4am this morning with an idea how I can adapt the spawning method for a jewel swapping game which I'll be looking at soon
I'm not sure if it was a coincidence I woke up at the same time I had the idea, or if I was dreaming about GameSalad before waking. The latter possibility is slightly worrying >.<
Nice work on your template!
Im making match 3 type of game also at the moment.
I see and follow your progress, and recently I read you have a new technique of detecting matches while abandoning the loops and the tables, If it works for you then carry on with it, but I want to remind you (just in case you forgot due to the enthusiasm of making a game) to keep thinking forward about the game/template, meaning, match 3 is an array type of game, while you have a current state of the array, and the game mechanics is making decisions based on that current state, whether if its activating power ups, finding special shapes of matches, finding possible matches etc, and making all of these without an array to hold the board data, might be extremely difficult, myself, I have more then one array of the board,for each state, have the board array, and the tmpBoard array, while the tmpBoard array is remained untouched, and the board array is being contaminated with special bread crumbs, like 0 for popped, -4 for 4 in a row/col
-5 for 5 in a row/col , -6 for T shape.. you got the point.
Now, I guess (and its just a guess) the reason you neglected the loops and arrays was due to the long time it takes for loop to finish, correct me if im wrong cause otherwise I dont see any other reason to not using loops.
See, the way loop is triggered is frameBased , meaning, if your game is working at steady 60 fps, then the loop will fire 60 times per sec, the lower your frame rate, the slower your loop will fire (this is not official, these are just my findings), so say you have a 8x8 board, that means 64 'gems' to check, which will take more then a second ( and thats on a perfect world when your game runs at 60 fps), thats just too much, thanks to @FryingBaconStudios (AKA the GS Guru) help and findings, the better method will be to use 8 loops, one for each row, and another 8 loops, one for each column, running simultaneously, this way, you can scan 8x8 board TWICE (by rows and by cols) in just 8 frames, converting it to time, if your game runs at say 50 frames per sec, that means 0.16 sec to scan the whole board, (witch is VERY SLOW comparing to a real code loop, but since this is what we have at the moment in GS, its not bad at all and almost unnoticed)
So, sorry for the long post, like I said if you like your new method, stick to it, but dont forget to think forward.
Keep the progress posts coming.
Cheers and good luck!
Roy
And thanks for the column and row loops suggestion, it'll definitely be an option that I will look at too. I need to be able to check regularly if the board is unplayable and whether or not it needs a refresh/reshuffle so I haven't given up on tables completely.
Can I ask if you're using game phases to trigger each event please? i.e. something like this:
phase 0: awaiting player action
phase 1: selecting jewels
phase 2: switching jewels
phase 3: checking jewels
phase 4: destroying jewels
phase 5: falling jewels
...loop 3-5 until no more jewels have been destroyed
...and then loop back to phase 2 to switch them back if no jewels were destroyed, otherwise it goes back to phase 0.
This is one of the several approaches I took but it stops you from switching two lots of jewels instantly because it can only ever be one game phase at any one time. In Jewel Mania you can switch the second set of jewels while the first lot is being destroyed. Trying to get something like this working a long with the slow loops made it unjoyable to build and play.
I tried it without phases and things were triggering at the wrong time, probably because the project was getting a little messy. One of the biggest problems I had with game.phase was trying to get the game to register when no more jewels were falling and switch from that phase to another. This is something I could have achieved by looping through the table but it was already running slow enough.
In theory the spawning collision detection actors should detect 3 or more blocks horizontally and vertically, if I tackle it the way I thought of early this morning, and because of the speed of it I won't need to have game.phases. However I haven't given much thought to power ups yet though. It's not that I've forgotten completely about them, it's more of a "I'll think about it later once I've got the basic game working smoothly." kind of thing
By the way, the speed that yours runs in that video makes me sick! :P
I use multiple booleans (I like working with booleans to trigger events), and not a single integer for the phases, but the end result is the same basically, I dont scan the board all the time, I only make a scan after the player swapped 2 gems, and after all the gems finished their falling down animation.
As for the swapping, in my game, the player can NOT make another swap while the gems are in the middle of the fall, I admit, Ive been trying to achieve this effect and could not come up with a working algorithm, it made me nervous at first thinking that the players would want such a feature, but then I came across 'candy crush' which also not giving this option, so I was relief
Roy.
I can't download this template from your site. Could you pm me the file instead using dropbox or something like that?
@Fajlajp, sure I'll put it on Dropbox in an hour or two when I get into work.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
I will definitely break up the loops for when it comes to checking the whole board for possible moves but I'm going to try and work with spawning collision detecting actors (my current approach) for when it comes to swapping jewels because I feel it would be quicker than loops and tables, and I quite like it the simplicity of it I just don't see it being practical for checking the whole board.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
It only matches 3 or more horizontally at the moment, and for the purpose of the video I've set the grid to only show 2 colours so that there's more chance of it making those matches.
It cycles through these game phases:
1 = Fill grid
2 = Check grid
3 = Destroy
4 = Falling
... back to phase 2 if number of jewels destroyed > 0
5 = Awaiting player action
I haven't set up phase 5 yet so you can't switch the jewels. I've been spending a very long time trying to get the other phases to run correctly and quickly, which I now think I've nailed.