Rockbox.org home
Downloads
Release release
Dev builds dev builds
Extras extras
themes themes
Documentation
Manual manual
Wiki wiki
Device Status device status
Support
Forums forums
Mailing lists mailing lists
IRC IRC
Development
Bugs bugs
Patches patches
Dev Guide dev guide
Search



Donate

Rockbox Technical Forums


Login with username, password and session length
Home Help Search Staff List Login Register
News:

Rockbox Ports are now being developed for various digital audio players!

+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  2048 Clone
« previous next »
  • Print
Pages: [1]

Author Topic: 2048 Clone  (Read 7423 times)

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
2048 Clone
« on: July 02, 2014, 09:03:07 PM »
For what it's worth, I recently made a clone of 2048 for Rockbox with colors, animations, optional undo, savegames, highscores... EVERYTHING!
If anyone would like to test it out, it is on Gerrit already: http://gerrit.rockbox.org/r/888.

The screendump is broken on iPod 6G (stack overflow on USB insert), so no shots, SO TRY IT YOURSELF! ;D

I have tested it on c200v1, iPod Classic, and e200 in simulator.

Please keep any feedback constructive.
« Last Edit: July 02, 2014, 09:33:04 PM by theunamedguy »
Logged
No support questions by PM, please.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #1 on: July 02, 2014, 09:32:14 PM »
Screenshots are attached (from e200 sim)

* 2048shot.PNG (1.93 kB, 176x222 - viewed 451 times.)
« Last Edit: July 03, 2014, 12:22:31 PM by theunamedguy »
Logged
No support questions by PM, please.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #2 on: July 03, 2014, 12:23:23 PM »
Better screenshot is attached, again on e200 sim.

Font size has been increased to show responsive drawing.

* 2048shot2.png (3.24 kB, 178x222 - viewed 391 times.)
« Last Edit: July 03, 2014, 05:55:24 PM by theunamedguy »
Logged
No support questions by PM, please.

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: 2048 Clone
« Reply #3 on: July 03, 2014, 09:01:22 PM »
Hi theunamedguy,

Thank you for your contribution.

A couple of things, I should (and likely will) post on the gerrit instance, that occurred to me.

Whitespace.

The patch is littered with whitespace that needs cleaning up.

Tiles.

If the plugin were to use bitmaps for the tiles, with some trivial changes it could scale to fit any arbitrary screen resolution, and open the door to greyscale and monochrome targets. This would increase the plugin size somewhat, but the bitmaps wouldn't need to be particularly large, or particularly complicated.

The tile bitmaps could then be scaled to 1/8th (for an 8x8 grid) of the smaller of the two values of the target screen resolution. So, for example, if the target device resolution is 240x320, the tiles would be scaled to (240รท8=) 30px square and stacked side by side in an 8x8 grid.

This would also allow for "pretty" tiles. Perhaps incorporating a border for the tiles, or nice rounded edges.

Once again, thank you for your contribution.



[Saint]
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #4 on: July 04, 2014, 07:21:22 PM »
I have fixed the whitespace and indentation.

When you say an 8x8 grid, do you mean a 4x4 grid? Maybe a 5x5 grid to leave the top row open for the title/score?

I made the following table for convenience:

Table:
Screen Size             Tile Size
240x32048x48
220x17636x36
176x13226x26
160x12826x26
176x13226x26
128x12826x26
132x11022x22
112x6412x12
« Last Edit: July 05, 2014, 04:59:37 PM by theunamedguy »
Logged
No support questions by PM, please.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #5 on: July 04, 2014, 09:04:49 PM »
Rewrote the drawing to use bitmaps, quite bug-free now.

Some things to do before upload:
 - Draw the background (not the tiles, the grid) (maybe)
 - Draw the text at the top. (must)
 - Make corners rounder (maybe)
 - Make tiles glow (maybe)
 - Fix compatibility issues (fall back to text-based drawing if no bitmap support)

Has been tested on e200 in sim and ipod6g on hardware.

Should be ready for upload within a few days.
EDIT: Has been uploaded to Gerrit for review.

* 2048shot3.PNG (18.12 kB, 346x571 - viewed 443 times.)
« Last Edit: July 06, 2014, 10:15:44 PM by theunamedguy »
Logged
No support questions by PM, please.

Offline [Saint]

  • Rockbox Expert
  • Member
  • *
  • Posts: 1662
  • Hayden Pearce
    • Google+
Re: 2048 Clone
« Reply #6 on: July 05, 2014, 01:55:30 AM »
Quote from: theunamedguy on July 04, 2014, 09:04:49 PM
When you say an 8x8 grid, do you mean a 4x4 grid?

I do indeed, yes.

Apparently I couldn't count yesterday.

Regarding the tiles themselves, are they pre-rendered at a fixed size, or being scaled on demand?

It looks really good, by the way. The only immediately obvious thing left to tackle would be making sure the tiles/board is centred in the display (this may be negated if the tiles were scaled to suit the resolution on demand).

[Saint]
« Last Edit: July 05, 2014, 01:59:11 AM by [Saint] »
Logged
Using PMs to annoy devs about bugs/patches is not a good way to have the issue looked at.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #7 on: July 05, 2014, 04:37:13 PM »
Quote
Regarding the tiles themselves, are they pre-rendered at a fixed size, or being scaled on demand?

They are pre-scaled for each target screen. The raw bitmap is available at http://fwei.tk/2048tiles.bmp.

There is the problem of tiles over 2048. According to http://www.quora.com/What-is-your-highest-tile-in-2048, the highest possible tile is 131072 on a 4x4 grid. That's 17 tiles I need to make bitmaps for. Is this overkill?

EDIT: All tiles up to 131072 have bitmaps for them now.

Also, I am not sure how I should go about drawing the background. Should I use a bitmap? If so, what sizes would I need?

Quote
this may be negated if the tiles were scaled to suit the resolution on demand

How would I scale them on-demand? An API function?
« Last Edit: July 07, 2014, 10:55:16 AM by theunamedguy »
Logged
No support questions by PM, please.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #8 on: July 07, 2014, 11:55:08 AM »
To ease testing, I have written a very simple and BUGGY save editor for 2048.
With it, I have verified that the drawing is bug-free! :D

It is attached, but beware that it is BUGGY.
The commands are as follows:
c - change a tile
s - change the score
e - write to 2048.resume and exit
Run it in the .rockbox/rocks/games directory.
* 2048edit.c (2.39 kB - downloaded 186 times.)

* 2048edit.PNG (3.84 kB, 571x176 - viewed 453 times.)
Logged
No support questions by PM, please.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #9 on: July 26, 2014, 08:45:25 PM »
OK, much better now!
Some minor bugs have been fixed, and many new features have been added.
Screenshot attached, running on ipod6g sim.

Notice the NICE, ROUND corners.  8)

Only big thing left is to make sure it compiles on every target. Testers are needed!

* 2048shot.jpg (106.09 kB, 1200x1000 - viewed 469 times.)
« Last Edit: July 29, 2014, 06:33:48 PM by theunamedguy »
Logged
No support questions by PM, please.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #10 on: August 01, 2014, 08:54:10 PM »
Patch set 36 resized the background to make it more like the real game. However, it might go outside of the screen on some targets. Therefore, testers are needed!
A best score box has been added, also.
Screenshot attached, enjoy!  8)

EDIT: Colors look messed up in screenshot because of lossy JPEG compression, it is not because of the plugin.

* 2048shot.jpg (81.87 kB, 1920x1200 - viewed 521 times.)
Logged
No support questions by PM, please.

Offline __builtin

  • Developer
  • Member
  • *
  • Posts: 405
  • iPod 6G, c200v1 (RIP), e200v1 (RIP)
    • FWEI.TK
Re: 2048 Clone
« Reply #11 on: September 05, 2014, 08:34:04 PM »
Kinda late, but this has been accepted into Git!  ;D
Logged
No support questions by PM, please.

  • Print
Pages: [1]
« previous next »
+  Rockbox Technical Forums
|-+  Rockbox Development
| |-+  Feature Ideas
| | |-+  2048 Clone
 

  • SMF 2.0.19 | SMF © 2021, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.028 seconds with 17 queries.