WIP - Falling Blocks game

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
WIP - Falling Blocks game
by on (#175339)
I thought I'd share my progress with my first game for the NES, Falling Blocks.
This is a port of my game that I wrote for the ZX Spectrum - see here if you want to try that version out: https://github.com/soiaf/FallingBlocks

I plan on adding some extra levels/challenges that weren't in the ZX Spectrum version.
The game itself is essentially a variant of Tetris, but I'm adding some features which hopefully should make it interesting to people.
I only started learning 6502/NES programming last month, but as I've done assembly programming I had no issues with 6502, the fun has been learning how to interact with the NES.

Attached is an early alpha of my game - just one level, with no special features - I guess it's really just to show that I've started :)

Some notes about the controls:
Pressing Start in-game will switch on/off a ghost - this shows where the shape would end up if you were to drop.
Pressing B will swap the shape with the saved shape. You can't swap again till you have placed the shape and are on a new shape.
Tapping A quickly will drop the shape to the bottom (though you then have a brief moment of time to move it left or right). Holding A will make the shape move quicker down the screen.

In the final version I will have a settings menu where, for example, the user can choice their preferred default behaviour for the drop button (always drop, fall faster while held, or mixture).

The one concern I have about the game right now is sound/music. I made a test version where I integrated GGSound into my code, but I have no talent for producing music myself, so I guess I'm going to have to look around for suitable music that I'm allowed use. If anyone has any suggestions here I'd love to hear them.

When I'm finished the game (or close to being finished at least) I plan on putting the source code up on my GitHub account.
Re: WIP - Falling Blocks game
by on (#175342)
I spent much of my teen years playing a similar 'falling block game'. And, I'm so used to the button choices of that game, that playing your game is like trying to ride a bicycle backwards, while using my hands to pedal.

Specifically.
A - rotate clockwise
B - rotate counter-clockwise
Down - place the block quickly
Re: WIP - Falling Blocks game
by on (#175343)
dougeff wrote:
I spent much of my teen years playing a similar 'falling block game'. And, I'm so used to the button choices of that game, that playing your game is like trying to ride a bicycle backwards, while using my hands to pedal.


You'll really like level 3 of the game then :wink:

But seriously - in the ZX Spectrum version I allow people to define their own keys. In theory I could add the same functionality to the version (so for example people could choose to press down for drop), but I'm not sure if it would be worth the effort. Would people like having the ability to define the buttons?
Re: WIP - Falling Blocks game
by on (#175345)
Defining buttons would be a nice feature, but above all else I think dougeff's suggestion makes for a more sane default.
Re: WIP - Falling Blocks game
by on (#175349)
I agree with dougeff. Using the standard keys used by Dr. Mario and other popular falling block games is like gas on the right, brake on the left.

DAS
Left: shift left 1 cell
hold Left longer than about 12 frames: rapid shift left
Right: shift right 1 cell
hold Right longer than about 12 frames: rapid shift left

Gravity control
Down: rapid shift down
Up: move directly on top of ghost

Rotation
B: rotate left
A: rotate right

Dr. Mario didn't have anything for hold piece. In the past, B+A has been suggested, or Select if you're not worried about 2-player on an RF Famicom.

How did you decide what set of pieces to use?
Re: WIP - Falling Blocks game
by on (#175351)
It's probably worth looking at Tepples' LJ65: https://github.com/bfirsh/jsnes/blob/ma ... 5/lj65.nes

For what it's worth, I play TGM and could write you a book about Tetris design, rotation systems, wall kicks. But... you're probably not interested if you're aiming for a more classic Tetris. (LJ65 is quite modern in gameplay.)

So... instead I'll mirror the others in saying reconsider your default controls. There's a lot of Tetris games for a d-pad, A, B, Start, Select button layout. Tetris (GB), Tetris (NES), Tetris DX, Tetris Plus and many more™ and most of them do what dougeff suggested. Considering most people that will play this have probably played one of those games, it's worth following suit to not turn off players of those games.

Also, I found a bug. You can fast drop the next piece before it comes out. This seems like it'd be a neat feature, but it's hard enough to do consistently that I'd bet it's a bug:

Image
Input display on the bottom left. I press A way before the other piece enters the well.

Edit: Maybe tick your randomizer on the press start screen so the piece sequence isn't always exactly the same?
Re: WIP - Falling Blocks game
by on (#175396)
Ok, I'll definitely change the keys to that selection, so that'll be in my next alpha release.
For that I'm planning on showing a different level, this one will be a bit more difficult, but should be a good demonstration of what I'm planning on adding to the game.

Thanks for the feedback everyone, I really appreciate it.

@Kasumi - I'll definitely give LJ65 a look!
The plan is to link the randomisation to when the user clicks on Start from the main screen, right now having predictable patterns makes it easier for me to debug. But I'll definitely consider making the next alpha release more random.
Thanks for the bug report, I'll have a look at that over the weekend and see if I can work out what's happening there.
Re: WIP - Falling Blocks game
by on (#175397)
Someone wrote the book: Hard Drop Wiki.
Re: WIP - Falling Blocks game
by on (#175815)
Here is my latest version of the code.
Hopefully this should give a better idea of what I'm trying to do with the game - in this level you have an expanded list of dropping shapes and random blocks appear every few turns, sometimes helping, sometimes causing frustration :)

The main things I've worked on since the last version are

*Modified the game controls
*Added extra shapes
*Added one of the difficulty factors (random blocks appearing every few turns)
*Tidied up some of the code
*Added most of the high score code (not fully working yet though)


Two known issues with this release
High score not always recognising a high score (and sometimes setting the high score to a score that is not)
If a random block completes a line it will not be recognised as a winning line till the next shape has been played
Re: WIP - Falling Blocks game
by on (#175848)
The DOWN key should make blocks fall faster, it still takes ages for them to get to the bottom of the pit. Besides (maybe it's my emulator) I've had some debouncing problems with the DOWN key.

I've noticed that sometimes you can't rotate the block in tight spaces even though the "destination" orientation would fit. I don't know if this is intentional.

Appart from that, looking promising.
Re: WIP - Falling Blocks game
by on (#176556)
@Kasumi
Thanks a lot for the animated gif/bug report. I was able to replicate it fairly easily thanks to your report, though it took me a while to figure out what was going wrong!
But I've fixed that and have been tidying up the code and adding some new features, hoping to have a new testable version in the next couple of weeks.
Re: WIP - Falling Blocks game
by on (#176850)
This would my ideal control scheme to play with:

*tengen version of tetris*

that version did almost everything right. it even had 2 player and vs com.
Re: WIP - Falling Blocks game
by on (#177053)
Latest WIP version attached. This has a few bug fixes, but also has a lot of extras the previous versions didn't have, scoring, lines completed etc.
Lots of work still to go, but I'm happy that this is beginning to come together.
This version still only has 1 level to play, but is a different level from the other versions, with a new challenge for players.
Re: WIP - Falling Blocks game
by on (#178205)
Since my last update I've found someone to compose music for the game, which is great!
I've integrated ggsound into the code.
I've added a couple of settings on the title screen, you can now choose your preferred drop method and choose the difficulty level.
I've also started tidying up the code, some of the code I wrote at the beginning is very wasteful of memory and I now need that space :)
Re: WIP - Falling Blocks game
by on (#178912)
I've now finished the game :)

The official title for the game is now Dúshlán.
Dúshlán is the Irish for challenge and would be roughly pronounced as do-lawn.

The game and all its source code is available on my GitHub page

https://github.com/soiaf/Dushlan

Thanks to everyone here for their feedback and I'd especially like to thank Teuthida for the music and sound effects, Derek Andrews for the ggsound sound engine and help fixing issues.
Thanks also to Shiru, Drag, Damian Yerrick and Joe Granato for some code snippets used.
Re: WIP - Falling Blocks game
by on (#178913)
soiaf wrote:
I've now finished the game :)

The official title for the game is now Dúshlán.
Dúshlán is the Irish for challenge and would be roughly pronounced as do-lawn.

The game and all its source code is available on my GitHub page

https://github.com/soiaf/Dushlan

Thanks to everyone here for their feedback and I'd especially like to thank Teuthida for the music and sound effects, Derek Andrews for the ggsound sound engine and help fixing issues.
Thanks also to Shiru, Drag, Damian Yerrick and Joe Granato for some code snippets used.

I would have loved a multiplayer mode, but this is still pretty nice!
Re: WIP - Falling Blocks game
by on (#178926)
Congrats on finishing the project! I downloaded it and will give it a go later. Congrats again!