2048 for NES/FC (includes source)

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

Moderator: Moderators

tsone
Posts: 30
Joined: Fri Feb 14, 2014 11:16 pm
Location: Linköping, Sweden
Contact:

2048 for NES/FC (includes source)

Post by tsone » Sat May 24, 2014 7:45 am

EDIT: Rev #5 (download): Fixed broken tile spawning and blinking on tile merge/spawn.

EDIT: Rev #3: Changed to NROM-128 and added out of moves notification.

EDIT: Rev #2: Should have the bugs fixed for NTSC.

EDIT: Attached screenshots.

Hi all,

This is a release of NES/FC version of the popular 2048 game. Download ROM here (from Bitbucket)

Font and number tile graphics were taken from Oerg866's Sega Mega Drive/Genesis version. The game also uses FamiTone2 by Shiru. Everything else (including music) was done by me. Many thanks to Shiru and Oerg866.

The game sources and all resources are in examples/2048/ directory of my neskit project:
https://bitbucket.org/tsone/neskit

Best way to build this from source is by cloning the above repo and running build.bat/.sh in the 2048 directory.

BTW. I only tested this on PAL system hardware. Could anyone help to test this on NTSC? Rev #2 was tested on NTSC HW and it should work.

Enjoy! :)
Attachments
2048-10.png
2048-10.png (2.15 KiB) Viewed 10471 times
2048-2.png
2048-2.png (1.99 KiB) Viewed 10471 times
Last edited by tsone on Sat Jun 21, 2014 11:53 pm, edited 5 times in total.

tepples
Posts: 21748
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 2048 for NES/FC (includes source)

Post by tepples » Sat May 24, 2014 8:38 am

Let me guess: this is like Gravnic, right?

I used a hex editor and noticed a lot of blank space at $8910-$BFFF, $E4C0-$F7FF, and $FAA0-$FFF9. It looks like this could easily fit into 16 kilobytes with a bit of rearrangement.

Anyway, I tried it on a PowerPak on an NTSC NES, and tiles were corrupting themselves all over the place. Just from the artifacts that appeared on my NES, I guessed that your engine is taking more than 2270 cycles after vblank to update things. It appears that you're even running the music engine (!) before resetting the scroll position. Try running the game in FCEUX set to NTSC mode and new PPU to see what I mean.

But if you do fix it up, it could be a counterpart to NES15 on the next Action 53 multicart.

JRoatch
Formerly 43110
Posts: 388
Joined: Wed Feb 05, 2014 7:01 am
Location: us-east
Contact:

Re: 2048 for NES/FC (includes source)

Post by JRoatch » Sat May 24, 2014 8:45 am

Beaten to the punch by temples, but I took a picture of it anyway.

Nice job with the music and color palette by the way. When I was imagining to myself a month or so ago how I would do this, I was giving myself the near impossible requirement of showing the complete movement transition like in the browser game. Good to see that the game can work without that.

I would be nice if the game can detect when no more moves are possible, so that it can tell you to press start to go start another game from the menu.
Attachments
2048-ntsc.jpg
2048-ntsc.jpg (59.39 KiB) Viewed 11325 times

User avatar
infiniteneslives
Posts: 2097
Joined: Mon Apr 04, 2011 11:49 am
Location: WhereverIparkIt, USA
Contact:

Re: 2048 for NES/FC (includes source)

Post by infiniteneslives » Sat May 24, 2014 11:38 am

tepples wrote:But if you do fix it up, it could be a counterpart to NES15 on the next Action 53 multicart.
I second that motion! ;)

Nice work on this so far. I have been wanting to make one myself after getting addicted to the game a couple months back. I really like the music too BTW.
If you're gonna play the Game Boy, you gotta learn to play it right. -Kenny Rogers

tsone
Posts: 30
Joined: Fri Feb 14, 2014 11:16 pm
Location: Linköping, Sweden
Contact:

Re: 2048 for NES/FC (includes source)

Post by tsone » Sat May 24, 2014 8:53 pm

Thanks for quick replies. I'll fix this ASAP. I didn't try this on the new PPU in FCEUX, so I missed that one. It's a stupid mistake, I didn't take account the NTSC's shorter VBLANK :oops:

lidnariq
Posts: 8776
Joined: Sun Apr 13, 2008 11:12 am
Location: Seattle

Re: 2048 for NES/FC (includes source)

Post by lidnariq » Sat May 24, 2014 10:35 pm

I'm pretty certain you're not compensating for the "DPCM causes bit deletions" bug. (I'm getting spurious presses of Right in Nestopia)

I think I remember someone saying Nintendo'd fixed it in the 2A07, so it's another NTSC-only problem.

tsone
Posts: 30
Joined: Fri Feb 14, 2014 11:16 pm
Location: Linköping, Sweden
Contact:

Re: 2048 for NES/FC (includes source)

Post by tsone » Sat May 24, 2014 11:24 pm

lidnariq wrote:I'm pretty certain you're not compensating for the "DPCM causes bit deletions" bug. (I'm getting spurious presses of Right in Nestopia)

I think I remember someone saying Nintendo'd fixed it in the 2A07, so it's another NTSC-only problem.
You are right. Thanks for pointing this out. I also noticed this just moments ago when testing new fixes on Nintendulator. I assumed earlier no DPCM will be used, so the input routine was broken... I'll fix this one also ASAP.

tsone
Posts: 30
Joined: Fri Feb 14, 2014 11:16 pm
Location: Linköping, Sweden
Contact:

Re: 2048 for NES/FC (includes source)

Post by tsone » Sun May 25, 2014 5:26 am

43110 wrote:I would be nice if the game can detect when no more moves are possible, so that it can tell you to press start to go start another game from the menu.
I'll add this to the next revision. Thanks for the feedback!

tsone
Posts: 30
Joined: Fri Feb 14, 2014 11:16 pm
Location: Linköping, Sweden
Contact:

Re: 2048 for NES/FC (includes source)

Post by tsone » Sun May 25, 2014 5:36 am

infiniteneslives wrote:
tepples wrote:But if you do fix it up, it could be a counterpart to NES15 on the next Action 53 multicart.
I second that motion! ;)
That would be great!

tepples
Posts: 21748
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 2048 for NES/FC (includes source)

Post by tepples » Sun May 25, 2014 7:56 am

It appears working on my NTSC NES. But $8000-$8909 still isn't relocated up into $E580-$F7FF. Do you plan on doing that soon? It'd be nice to have the entire bottom half blank so that I can stick another NROM-128 game in its place.

Gameplay bug please: If there are two pairs one one row or column, should they be allowed to collapse in one press? They appear not to on this version. Try getting something like this and pressing left or right:

Code: Select all

,--. ,--. ,--. ,--,
  2    2    2    2
`--' `--' `--' `--'
,--. ,--. ,--. ,--,

`--' `--' `--' `--'
,--. ,--. ,--. ,--,

`--' `--' `--' `--'
,--. ,--. ,--. ,--,

`--' `--' `--' `--'
If I press left or right in the popular version, I get two 4's, each created from one pair of 2's.

JRoatch
Formerly 43110
Posts: 388
Joined: Wed Feb 05, 2014 7:01 am
Location: us-east
Contact:

Re: 2048 for NES/FC (includes source)

Post by JRoatch » Sun May 25, 2014 6:46 pm

tepples wrote:Gameplay bug please: If there are two pairs one one row or column, should they be allowed to collapse in one press?
Can be logically and visually simulated by having the game repeat the direction until it detects that more tiles can merge that direction, then the random tile is added.

tepples
Posts: 21748
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 2048 for NES/FC (includes source)

Post by tepples » Sun May 25, 2014 6:55 pm

The behavior I saw in the web app is to slide, merge ONCE, and then slide further. [2 2 2 2] should merge right to [_ 4 _ 4] and then slide. They should not merge recursively to [_ _ _ 8] in one keypress. Nor should [16 4 2 2] merge to [_ _ 16 8] in one keypress.

JRoatch
Formerly 43110
Posts: 388
Joined: Wed Feb 05, 2014 7:01 am
Location: us-east
Contact:

Re: 2048 for NES/FC (includes source)

Post by JRoatch » Sun May 25, 2014 7:00 pm

I was just now attempting to read the source code to make sure my words where accurate, and I got it wrong.

Thanks for pointing that out.

tsone
Posts: 30
Joined: Fri Feb 14, 2014 11:16 pm
Location: Linköping, Sweden
Contact:

Re: 2048 for NES/FC (includes source)

Post by tsone » Sun May 25, 2014 7:21 pm

tepples wrote:It appears working on my NTSC NES. But $8000-$8909 still isn't relocated up into $E580-$F7FF. Do you plan on doing that soon? It'd be nice to have the entire bottom half blank so that I can stick another NROM-128 game in its place.
Good to hear! Thanks for testing. Is it considered safe to have 16K PRG ROM when using iNES mapper #2? Like you said, the second bank is not necessary. This game just needs CHR RAM from this mapper to decompress graphics.
Gameplay bug please: If there are two pairs one one row or column, should they be allowed to collapse in one press? They appear not to on this version.
Thanks for noticing, but it's not a bug - it's a feature. :wink: I took this merging mechanic from Veewo's version. The Cirulli's version indeed has a different mechanic. I assumed these were identical, but they are not. I also thought Cirulli made the original, but seems I was wrong again. Reportedly, original is by Saming, and this game has yet another merging mechanic. See for yourself. I'll stick with the current one.

tepples
Posts: 21748
Joined: Sun Sep 19, 2004 11:12 pm
Location: NE Indiana, USA (NTSC)
Contact:

Re: 2048 for NES/FC (includes source)

Post by tepples » Sun May 25, 2014 7:34 pm

tsone wrote:Is it considered safe to have 16K PRG ROM when using iNES mapper #2?
Yes.
I took this merging mechanic from Veewo's version.
I'd try it to confirm, but why does 1024 for Android require access to my tablet's "precise location" (that is, GPS)?

Post Reply