# Help With Puzzle Game

### » Thu Oct 22, 2009 8:36 pm

Just got home to check it out, works like a charm. Thanks a ton.

Two questions, is the random(4)+1 more effiecent than random(5) because it stops me from getting one number that's unused (or maybe loops around causing me to have more of one frame)?

And on the vertical movement, what's the purpose of making sure red isn't already moving. Seems to function the same with and with since it will always handle the horizontal movement first.

Trying to learn to optimize this stuff.

EDIT: I found I can break it if i switch while one's falling, i can cause them to overlap and stick together. I gotta fix that.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

### » Thu Oct 22, 2009 9:07 pm

[quote="mattdubs":2nbsjsn4]Two questions, is the random(4)+1 more effiecent than random(5) because it stops me from getting one number that's unused (or maybe loops around causing me to have more of one frame)?[/quote:2nbsjsn4]

Actually I forgot about that. You used random(5), which will return 0, 1, 2, 3 or 4. But you have frames from 1-4. So random(4) returns 0, 1, 2, 3 obviously and +1 it's just what you need.

[quote="mattdubs":2nbsjsn4]And on the vertical movement, what's the purpose of making sure red isn't already moving. Seems to function the same with and with since it will always handle the horizontal movement first.
[/quote:2nbsjsn4]
[quote="mattdubs":2nbsjsn4]EDIT: I found I can break it if i switch while one's falling, i can cause them to overlap and stick together. I gotta fix that.[/quote:2nbsjsn4]

Actually that's what the inverted Is moving condition is meant for. So you can't break it that way.
Well if you added it to the switching conditions too that is.

EDIT: I just tried it briefly and realized that alone won't do. You'll have to change your switching events further. Of course it also depends on what kind of gameplay mechanics you plan for the game. Like switching possible all the time or just when no block is falling and stuff like that.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

### » Fri Oct 23, 2009 9:20 pm

Yeah adding the inverted moving condition to the switching event was the first thing I tried when I saw it could be broken.

I never want to stop the person from flipping blocks. The basic run-down is they fill from the bottom, you need to keep them from leaving from the top. There will be a meter on the left for destroyed blocks when it's full you get to move on to the next level. Will add a combo meter as well, multiplies score and if you fill it you will get bonus points.

Took a little break to mess with the graphics, now I've been fiddling with the block destruction mechanic but my basic idea doesn't seem to work out. Tried to set it up to just kill off 2 that are matched horizontally (though in the end it will be 3 or more and both horizontal or vertical). Doesn't seem to want to compare blocks that are touching's animation frames, ends up just destroying all blocks.

.cap file PuzzleFudge-02.cap

Feeling like I'm running into more things I can't figure out now then things I can. But I guess that was the point of this exercise. I'm trying to go further than I need to for a platform project for the next indie game challenge with my room mate who is a very talented 3d artist.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

### » Fri Oct 23, 2009 9:39 pm

I got it destroy two matched tiles when you swap them... Other then that I have no idea. I would really like to know this as well!

Edit: Taking a second look at the cap, The last sub-event does nothing, I dunno what I was doing. Blah!
B
3
G
3
Posts: 42
Reputation: 959

### » Fri Oct 23, 2009 9:48 pm

[quote="jeffro11":2rp52729]I got it destroy two matched tiles when you swap them... Other then that I have no idea. I would really like to know this as well![/quote:2rp52729]

But I will NEVER tell!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Just joking. But you're getting into a little more complicated territory here. So all I can say right now is watch your picking. It's all way too simple and wrong right now.

Sorry for the short and pretty unhelpful message, but I'm drunk and sleepy right now. I will post something better soon, promise. Have a good night and don't drink too much beer in Germany.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

### » Fri Oct 23, 2009 9:54 pm

Thanks fellas, yeah I got a similar result at one point. couldn't make it passive.

By picking I assume you mean the red overlapping the green at offset? also can it get the animation from from the families since one family contains multiple objects?

Beer in Germany is no joke. I hardly remember my last trip there.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

### » Mon Oct 26, 2009 1:49 pm

Okay, I'm kind of sober again.

First of all let me admit that I used some kind of detector setup (dummy sprites)for Crypta and a loop which would place them horizontally and vertically from each block that needed to be checked. This principle was also used to build the playfield at the beginning in a way so there would not be 3 blocks in order.

I'm planning on doing it smarter for the next incarnation of my puzzle game. I had some ideas involving an array and other stuff. Although I'm not sure yet which would be the smartest way.

I tried to get something done in your cap. As I set it up right now, it's only checking for blocks you swapped or rather the row and both columns of those blocks. If there are 3 or more matched, their opacity will be set to 50% for now, so you can see properly that it actually works (press K to reset opacity). I'm using For Each ordered loops and some Globals for this and I guess it should be commented. Tell me if it's too confusing.

This (or something like this) should now be set up in a way that it checks for any block that moved, not only the swapped ones, and of course it needs to be applied to the creation of the playfield as well.

Maybe I'll do it properly with more time on my hands. Some stuff needs to be optimized too like the unnecessary double-check of the row.

Okaaaaaaay, well, that's it for now.

The cap.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

### » Tue Oct 27, 2009 1:30 am

Wow man, you're really puttin in a lot of work helpin me out.

I think getting what you did. I haven't had a chance to really go through it heavily. Are the toggled (strike out) events not necessary? I'm really going to have to get into it more before I know if I have any more serious questions. But again, that's a ton for all your help. This community has some really great members.

Arkedo released a game today that's very VERY similar to the direction I wanted to go with this. I suggest if you have Xbox Live, check it out. SWAP! on the indie games.
B
3
S
1
G
3
Posts: 25
Reputation: 1,075

### » Tue Oct 27, 2009 6:48 pm

[quote="mattdubs":1ttbc2ny]Wow man, you're really puttin in a lot of work helpin me out.[/quote:1ttbc2ny][quote="mattdubs":1ttbc2ny]But again, that's a ton for all your help. This community has some really great members.[/quote:1ttbc2ny]

Yeppa, this community rocks!

And this thread gave me back a lot of motivation to finally get started working on a new version of Crypta again, so I kind of have to thank you as well.

[quote="mattdubs":1ttbc2ny]I think getting what you did. I haven't had a chance to really go through it heavily. Are the toggled (strike out) events not necessary? I'm really going to have to get into it more before I know if I have any more serious questions.[/quote:1ttbc2ny]

Toggled events/conditions/actions are mostly still in there because I wanted to test something. I guess you can ignore them. I hope it'll be helpful to you once you had a closer look.

[quote="mattdubs":1ttbc2ny]Arkedo released a game today that's very VERY similar to the direction I wanted to go with this. I suggest if you have Xbox Live, check it out. SWAP! on the indie games.[/quote:1ttbc2ny]

No Xbox here, unfortunately. And don't let that demotivate you!
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

### » Fri Oct 30, 2009 10:37 am

Just a little heads up here mattdubs...

I got my own puzzle engine up and running again, complete with field generation, matching block recognition, destroying and spawning of new ones to fill up the gaps. It's made much smarter than the old version, using no detectors or any of the old stuff which I refer to as "MMF-style" sometimes. Although I'm pretty sure it could still be improved upon a lot, with smarter usage of certain objects. But I'm quite happy already in using an array, even if it's just to a pretty limited extent.

It basically uses the same principle as the stuff I put in your cap. But there's one major flaw with that version, since it only works properly while the playfield is full of blocks. So it doesn't recognize gaps which will cause problems, matching blocks wrongly. Just wanted to let you know, because I was confused about it for a sec myself when I realized it didn't work quite right just yet. Maybe you figured it out already or made your own different engine, I don't know. But if you're having trouble with the gap recognition, let me know. It's just a minor change to those events.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

PreviousNext

### Who is online

Users browsing this forum: No registered users and 4 guests