After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743119 - crash because no colors for boxes with > 2048
crash because no colors for boxes with > 2048
Status: RESOLVED FIXED
Product: gnome-2048
Classification: Other
Component: general
unspecified
Other Linux
: Normal critical
: ---
Assigned To: gnome-2048 maintainer(s)
gnome-2048 maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2015-01-18 10:41 UTC by Igor Gnatenko
Modified: 2019-01-30 14:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
view: autogenerate colors (2.13 KB, patch)
2015-01-18 23:01 UTC, Igor Gnatenko
none Details | Review
view: autogenerate colors (2.20 KB, patch)
2015-01-18 23:06 UTC, Igor Gnatenko
none Details | Review
view: autogenerate colors for boxes > 2048 (1.25 KB, patch)
2015-01-19 16:08 UTC, Igor Gnatenko
none Details | Review
view: autogenerate colors for boxes > 2048 (2.29 KB, patch)
2015-01-24 20:25 UTC, Igor Gnatenko
none Details | Review
view: autogenerate colors for boxes > 2048 (1.52 KB, patch)
2015-01-24 20:26 UTC, Igor Gnatenko
none Details | Review

Description Igor Gnatenko 2015-01-18 10:41:47 UTC
Tried to concatenate 2048 with 2048.

Thread 1 (Thread 0x7ffff7f98a00 (LWP 13461))

  • #0 color_palette_pick_color
    at view.c line 823
  • #1 _tile_view_pick_color
    at view.c line 625
  • #2 tile_view_construct
    at view.c line 542
  • #3 tile_view_new
    at view.c line 551
  • #4 _game_create_tile
    at game.c line 1196
  • #5 _game_on_move_trans_stopped
    at game.c line 2901
  • #6 __game_on_move_trans_stopped_clutter_timeline_stopped
    at game.c line 1216
  • #7 g_closure_invoke
    at gclosure.c line 768
  • #8 signal_emit_unlocked_R
    at gsignal.c line 3536
  • #9 g_signal_emit_valist
    at gsignal.c line 3292
  • #10 g_signal_emit
    at gsignal.c line 3348
  • #11 clutter_timeline_do_frame
    from /lib64/libclutter-1.0.so.0
  • #12 clutter_clock_dispatch
    from /lib64/libclutter-1.0.so.0
  • #13 g_main_dispatch
    at gmain.c line 3122
  • #14 g_main_context_dispatch
    at gmain.c line 3737
  • #15 g_main_context_iterate
    at gmain.c line 3808
  • #16 g_main_context_iteration
    at gmain.c line 3869
  • #17 g_application_run
    at gapplication.c line 2290
  • #18 application_main
    at application.c line 1059
  • #19 main
    at application.c line 1071

Comment 1 Igor Gnatenko 2015-01-18 10:45:37 UTC
  public ColorPalette ()
  {
    Object ();

    _palette = new Gee.HashMap<uint,Clutter.Color?> ();

    _palette.set (2,    Clutter.Color.from_string ("#fce94f")); // Butter 1
    _palette.set (4,    Clutter.Color.from_string ("#8ae234")); // Chameleon 1
    _palette.set (8,    Clutter.Color.from_string ("#fcaf3e")); // Orange 1
    _palette.set (16,   Clutter.Color.from_string ("#729fcf")); // Sky blue 1
    _palette.set (32,   Clutter.Color.from_string ("#ad7fa8")); // Plum 1
    _palette.set (64,   Clutter.Color.from_string ("#e9b96e")); // Chocolate 1
    _palette.set (128,  Clutter.Color.from_string ("#ef2929")); // Scarlet red 1
    _palette.set (256,  Clutter.Color.from_string ("#c4a000")); // Butter 3
    _palette.set (512,  Clutter.Color.from_string ("#4e9a06")); // Chameleon 3
    _palette.set (1024, Clutter.Color.from_string ("#ce5c00")); // Orange 3
    _palette.set (2048, Clutter.Color.from_string ("#204a87")); // Sky blue 3
  }

we don't have colors for more than 2048

We should find algorithm which will generate colors automatically
Comment 2 Georges Basile Stavracas Neto 2015-01-18 22:02:39 UTC
This link will certainly help:

http://stackoverflow.com/questions/43044/algorithm-to-randomly-generate-an-aesthetically-pleasing-color-palette
Comment 3 Igor Gnatenko 2015-01-18 23:01:06 UTC
Created attachment 294818 [details] [review]
view: autogenerate colors

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=743119
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
Comment 4 Igor Gnatenko 2015-01-18 23:02:23 UTC
(In reply to comment #3)
> Created an attachment (id=294818) [details] [review]
> view: autogenerate colors
I've not tested it, I'm also not familiar with vala. I will check it after some hours and if there problems - will fix it.
Comment 5 Igor Gnatenko 2015-01-18 23:06:34 UTC
Created attachment 294821 [details] [review]
view: autogenerate colors

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=743119
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
Comment 6 Dmitry Shachnev 2015-01-19 11:22:11 UTC
Shouldn't colors be consistent between games? I think the best thing will be to follow logic in original 2048 (for browsers).
Comment 7 Igor Gnatenko 2015-01-19 15:27:19 UTC
(In reply to comment #6)
> Shouldn't colors be consistent between games? I think the best thing will be to
> follow logic in original 2048 (for browsers).
I think this should be RFE to switch between original game and unlimited game, because getting 2048 in one block is not interesting.
Comment 8 Igor Gnatenko 2015-01-19 16:08:30 UTC
Created attachment 294897 [details] [review]
view: autogenerate colors for boxes > 2048

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=743119
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
Comment 9 Igor Gnatenko 2015-01-24 20:25:12 UTC
Created attachment 295344 [details] [review]
view: autogenerate colors for boxes > 2048

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=743119
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
Comment 10 Igor Gnatenko 2015-01-24 20:26:38 UTC
Created attachment 295345 [details] [review]
view: autogenerate colors for boxes > 2048

Reference: https://bugzilla.gnome.org/show_bug.cgi?id=743119
Signed-off-by: Igor Gnatenko <ignatenko@src.gnome.org>
Comment 11 Juan R. Garcia Blanco 2015-02-04 21:42:33 UTC
Sorry for the delay.

I think this is due to me not being very good on this game as I hardly ever reach 2048 :)

Sorry, I still didn't have the time to apply your patch and test it. Anyway, I think the proposed solution is not ideal. I do not like the idea of having some tiles being colored using pre-defined colors and other tiles being colored using random colors. I think it would be better if we could have a unified solution.

On one side, I like the idea of using the Tango palette; however, it does not come with a large amount of colors. So on the other side, I like the idea of using generated random colors, probably always using the same seed (I would appreciate if a value always matches a color). Any idea? I think we could use your algorithm, but only that algorithm, to create colors; we should still make sure that we always use the same seed.
Comment 12 Juan R. Garcia Blanco 2015-02-15 21:31:57 UTC
I have added a deterministic algorithm to generate colors for tiles greater than 2048. I will leave the bug report open if someone comes up with a better solution.
Comment 13 Nicholas H 2016-03-18 22:59:54 UTC
Just to toss in my two cents -- I like the fixed palette idea, but I want to also point out that the theoretical limit of the board is 16 variations of tiles (you could never build a 2^17 tile because it would need 17 squares), so we only need 5 more colours to pick with likely no one ever seeing the last two or three of them, anyway.
Comment 14 Arnaud B. 2019-01-30 14:22:01 UTC
The colors discussion will probably come again one day, but I’m closing here because the bug is solved for me. Thanks everyone!