WIP - Falling Blocks game

A place where you can keep others updated about your NES-related projects through screenshots, videos or information in general.

Moderator: Moderators

soiaf
Posts: 9
Joined: Wed Jun 08, 2016 9:53 am

WIP - Falling Blocks game

Post by soiaf »

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.
Attachments
fallingblocks_v43.nes
Very early (alpha), one level only, version of Falling Blocks
(24.02 KiB) Downloaded 432 times
User avatar
dougeff
Posts: 3079
Joined: Fri May 08, 2015 7:17 pm

Re: WIP - Falling Blocks game

Post by dougeff »

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
nesdoug.com -- blog/tutorial on programming for the NES
soiaf
Posts: 9
Joined: Wed Jun 08, 2016 9:53 am

Re: WIP - Falling Blocks game

Post by soiaf »

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?
User avatar
mikejmoffitt
Posts: 1353
Joined: Sun May 27, 2012 8:43 pm

Re: WIP - Falling Blocks game

Post by mikejmoffitt »

Defining buttons would be a nice feature, but above all else I think dougeff's suggestion makes for a more sane default.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: WIP - Falling Blocks game

Post by tepples »

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?
User avatar
Kasumi
Posts: 1293
Joined: Wed Apr 02, 2008 2:09 pm

Re: WIP - Falling Blocks game

Post by Kasumi »

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?
soiaf
Posts: 9
Joined: Wed Jun 08, 2016 9:53 am

Re: WIP - Falling Blocks game

Post by soiaf »

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.
tepples
Posts: 22708
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: WIP - Falling Blocks game

Post by tepples »

Someone wrote the book: Hard Drop Wiki.
soiaf
Posts: 9
Joined: Wed Jun 08, 2016 9:53 am

Re: WIP - Falling Blocks game

Post by soiaf »

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
Attachments
fallingblocks_v48.nes
v48 of Falling Blocks game. One level only, alpha version of game.
(24.02 KiB) Downloaded 296 times
na_th_an
Posts: 558
Joined: Mon May 27, 2013 9:40 am

Re: WIP - Falling Blocks game

Post by na_th_an »

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.
soiaf
Posts: 9
Joined: Wed Jun 08, 2016 9:53 am

Re: WIP - Falling Blocks game

Post by soiaf »

@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.
User avatar
Estlib
Posts: 83
Joined: Tue Jul 14, 2009 4:23 am

Re: WIP - Falling Blocks game

Post by Estlib »

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.
NOPE.
soiaf
Posts: 9
Joined: Wed Jun 08, 2016 9:53 am

Re: WIP - Falling Blocks game

Post by soiaf »

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.
Attachments
fallingblocks_v60.nes
Version 60 of Falling Blocks game. Still alpha. Only 1 playable level (level 8)
(24.02 KiB) Downloaded 299 times
soiaf
Posts: 9
Joined: Wed Jun 08, 2016 9:53 am

Re: WIP - Falling Blocks game

Post by soiaf »

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 :)
soiaf
Posts: 9
Joined: Wed Jun 08, 2016 9:53 am

Re: WIP - Falling Blocks game

Post by soiaf »

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.
Post Reply