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:

Thank You for your continued support and contributions!

+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Game of Life
« previous next »
  • Print
Pages: 1 [2]

Author Topic: Game of Life  (Read 7842 times)

Offline piquadrat

  • Member
  • *
  • Posts: 11
Re: Game of Life
« Reply #15 on: December 21, 2006, 05:58:22 PM »
Burned another few hours today :) edit mode now works and worlds loaded from a file behave like they should (I attached a glider gun in the file world.gol). Also, there's a menu now.

To try out the file loading, put this in a text file, save it to .rockbox/rocks/world.gol an watch what happens when you load it :)

Code: [Select]
0
0
0
00000000000000000000000000001
00000000000000000000000001111
000000000000000010000000111100000000011
000000000000000101000000100100000000011
0001100000000010001100001111
00011000000000100011000001111
00000000000000100011000000001
000000000000000101
00000000000000001

(you probabely have to save it in unix format with an editor like notepad++)

There are also developments on the performance. I found quite an involved C++ implementation of the game of life in the book "Graphics Programing Black Book" by Michael Abrash (chapter 17, PDF file) and integrated it into my code. This thing flies! Actually, it's so fast that displaying the viewport becomes the bottleneck. Unfortunately I don't have any idea under which license this code is, so I can't post it yet.

In the mean time, here's the newest version with the slow implementation (still no button mappings other than for the X5  :-[):

[attachment deleted by admin, too old]
Logged

Offline linuxstb

  • Developer
  • Member
  • *
  • Posts: 1163
Re: Game of Life
« Reply #16 on: December 21, 2006, 06:58:25 PM »
They're not perfect, but here is a quick attempt at an ipod keymapping:

Code: [Select]
#define GOL_UP BUTTON_MENU
#define GOL_DOWN BUTTON_PLAY
#define GOL_RIGHT BUTTON_RIGHT
#define GOL_LEFT BUTTON_LEFT
#define GOL_QUIT BUTTON_SELECT | BUTTON_MENU
#define GOL_PLAY (BUTTON_SELECT | BUTTON_PLAY)
#define GOL_SELECT (BUTTON_SELECT | BUTTON_REL)
#define GOL_EDIT (BUTTON_SELECT | BUTTON_RIGHT)
Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: Game of Life
« Reply #17 on: December 21, 2006, 07:30:16 PM »
That's awesome.  I'll be really happy to have this as a plug-in.  Keep up the good work!
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

Offline Mad Cow

  • Member
  • *
  • Posts: 445
Re: Game of Life
« Reply #18 on: December 22, 2006, 12:21:36 AM »
I got a data abort at 000043A4 when I tried this on my H10.

I also have a quick keymap for the H10
Code: [Select]
#elif (CONFIG_KEYPAD == IRIVER_H10_PAD)
#define GOL_UP BUTTON_SCROLL_UP
#define GOL_DOWN BUTTON_SCROLL_DOWN
#define GOL_QUIT BUTTON_POWER
#define GOL_LEFT BUTTON_LEFT
#define GOL_RIGHT BUTTON_RIGHT
#define GOL_PLAY BUTTON_PLAY
#define GOL_SELECT BUTTON_FF
#define GOL_EDIT BUTTON_REW
Logged
iRiver H10 5GB, Gigabeat F40, Gigabeat S60, all rockboxed. :P

Offline piquadrat

  • Member
  • *
  • Posts: 11
Re: Game of Life
« Reply #19 on: December 22, 2006, 04:55:26 PM »
Mad Cow: when does it abort? When you start the plugin, when you initialize a world or while "playing"?

I still haven't found information concerning the license of that optimized algorithm. I contacted the author, Michael Abrash today, let's see if that ancient email address still is active :) In the mean time, I benchmarked the two algorithms by letting them iterate 500 times over a 40% filled random world. With the old algorithm, my X5 spends about 14'000 ticks in the game_step method. Michael Abrash's code cuts that number down to less than 700 ticks! Displaying the world after each iteration adds up to another 2700 ticks.
Logged

Offline Mad Cow

  • Member
  • *
  • Posts: 445
Re: Game of Life
« Reply #20 on: December 22, 2006, 05:04:31 PM »
Right when it's starting. I select the plugin and get the data abort a second later.
Logged
iRiver H10 5GB, Gigabeat F40, Gigabeat S60, all rockboxed. :P

Offline man

  • Member
  • *
  • Posts: 7
Re: Game of Life
« Reply #21 on: December 27, 2006, 11:17:10 AM »
http://sourceforge.net/projects/golly/

This could be interesting, because it's released under the GPL...
Logged

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Game of Life
« Reply #22 on: December 28, 2006, 04:54:31 AM »
I haven't had chance to play yet but wanted to add some encouragement (and a bit of envy that I didn't think of it first).

I'll have a look and contibute and hopefully contribute  H1xx/H3xx keymaps later.
Logged

Offline Llorean

  • Member
  • *
  • Posts: 12931
Re: Game of Life
« Reply #23 on: December 28, 2006, 07:49:27 AM »
I just noticed the .c files for the plugin were attached to this thread. This is the wrong place for them. They belong in the patch tracker.
Logged

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Game of Life
« Reply #24 on: December 29, 2006, 10:26:55 AM »
Had a play - Nice! must go and find some set pieces ...

Here is a key map for the H100/H300 series;
Code: [Select]
#elif (CONFIG_KEYPAD == IRIVER_H100_PAD) || \
      (CONFIG_KEYPAD == IRIVER_H300_PAD)
#define GOL_QUIT BUTTON_OFF
#define GOL_UP BUTTON_UP
#define GOL_DOWN BUTTON_DOWN
#define GOL_RIGHT BUTTON_RIGHT
#define GOL_LEFT BUTTON_LEFT
#define GOL_PLAY BUTTON_ON
#define GOL_SELECT BUTTON_SELECT
#define GOL_EDIT BUTTON_REC

A Llorean says you should probably put it in the patch tracker - I think it is ready for inclusion in rockbox and the first step of that is getting it in the tracker ...

When you're done with this there was a windows screen saver called bugs or something that was a CA simulation of bacteria eating your desktop with the colour of pxels as food - I tried a quick search but couldn't come up with anything - maybe someone else will remember.
Logged

Offline piquadrat

  • Member
  • *
  • Posts: 11
Re: Game of Life
« Reply #25 on: December 29, 2006, 10:44:20 AM »
Thanks for the keymap. I'm still working on it, despite not giving that many status updates anymore. Problem is, I still couldn't get a hold of Micheal Abrash to ask for permission to put my modified code of his under the GPL... :-[

I just found this in another Book by Abrash, "Ramblings in Real Time":
Quote
You may use the code and techniques described herein without limitation; the intent is not to reserve rights to the ideas or technology, but rather to disseminate the ideas and technology so that it may be widely used.

So he seems quite open to reusage of his code... is this enough for the plugin to be released as GPL?
« Last Edit: December 29, 2006, 11:13:57 AM by piquadrat »
Logged

Offline Multiplex

  • Member
  • *
  • Posts: 440
Re: Game of Life
« Reply #26 on: December 30, 2006, 08:25:00 AM »
Well the 'slow' one works at a sensible speed on the H300...

You'd need a lawyer to determine what the interpretation of that in relation to the GPL is - there are some folks hear about who are very oppinionated about licenses (I have no way of assessing their knowledge) you could try a forum search for GPL to locate the names.

I'm still looking for set pieces/enhancements - I turned up a thing I played with called ants which is another CA thing, now all I need is to find the book I got it from.
Logged

Offline man

  • Member
  • *
  • Posts: 7
Re: Game of Life
« Reply #27 on: January 16, 2007, 09:50:11 AM »
hi,

when will this be put to flyspray and/or wiki?
Don't want this to get lost.

man
Logged

Offline mattzz

  • Member
  • *
  • Posts: 8
Re: Game of Life
« Reply #28 on: February 03, 2007, 07:38:06 PM »
I was not aware of any GOL projects ongoing and I started doing a GOL plugin two days ago from scratch. It's called rocklife.

The plugin supports different start configurations (Random, acorn, growth, growth_2 and glider gun). There is colour support for aging, play/pause and step mode. I tuned the algorithm a bit but there are still tons of speed improvements possible. It should run on all platforms except the HAVE_LCD_CHARCELLS models.

Please find the patch here: http://www.rockbox.org/tracker/task/6616

/mattzz

Logged

Offline Chronon

  • Rockbox Expert
  • Member
  • *
  • Posts: 4379
Re: Game of Life
« Reply #29 on: February 06, 2007, 01:36:30 PM »
Awesome!  Thanks for working on this and submitting it to the tracker!

I won't have time to patch this for a while, but I'll probably have a play this weekend.
Logged
Sansa e280, Gigabeat F40, Gigabeat S60, Sansa Clip+, iPod Mini 2g

  • Print
Pages: 1 [2]
« previous next »
+  Rockbox Technical Forums
|-+  Support and General Use
| |-+  Plugins/Viewers
| | |-+  Game of Life
 

  • SMF 2.0.17 | SMF © 2019, Simple Machines
  • Rockbox Privacy Policy
  • XHTML
  • RSS
  • WAP2

Page created in 0.118 seconds with 14 queries.