Rockbox Technical Forums

Rockbox Development => Feature Ideas => Topic started by: __builtin on November 21, 2016, 09:34:56 PM

Title: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on November 21, 2016, 09:34:56 PM
Finally got around to it...

Source is up on Gerrit, all 120,000 lines of it: http://gerrit.rockbox.org/r/1421/ ;)

Testers welcome, builds available on request.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: chrisjj on December 16, 2016, 08:26:16 AM
Testers welcome, builds available on request.

Build for Creative ZEN, please.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: chrisjj on December 16, 2016, 08:20:21 PM
Build for Creative ZEN, please.

FTR, got it, and discussion is here:

https://www.rockbox.org/irc/log-20161216
https://www.rockbox.org/irc/log-20161217
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on January 08, 2017, 04:09:07 PM
Just an update here, the majority of the puzzles have made it into the mainline repository.

I have some concerns, however, about some of the more memory-intensive puzzles running out of memory at runtime on some of the targets with smaller plugin buffers. These targets are the Sansa c200v2 and c100. If you have one of these targets, I'd appreciate it if you could test the following puzzles on them, at various settings (listed by order of increasing size):

Code: [Select]
92 sgt-bridges.rock
92 sgt-galaxies.rock
92 sgt-tracks.rock
96 sgt-singles.rock
100 sgt-net.rock
132 sgt-pearl.rock
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: tdb on January 10, 2017, 05:06:53 PM
Hi - gave it a try on my c200v2


Code: [Select]
92 sgt-bridges.rock
92 sgt-galaxies.rock
92 sgt-tracks.rock
96 sgt-singles.rock
100 sgt-net.rock
132 sgt-pearl.rock

They all give me a fatal error due to low memory - but not only these. After a while most games i tried gave a fatal error.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on January 10, 2017, 07:11:55 PM
Ok, thanks tdb. I'll put together a patch in the coming days that will hopefully "solve" the issue to an extent, though it will break playback in the games in some cases.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: saratoga on January 10, 2017, 10:50:16 PM
c200v2 and clipv1 have only 2 MB of RAM, and the c200v2 must use a color framebuffer, so memory is very tight.

If you want to test low memory, you could configure a device build with less RAM, or use the SIM and further decrease memory a little (to be safe since the SIM isn't quite the same with allocations).
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on January 13, 2017, 07:06:55 PM
Just pushed the fix. Could you please test the newest autobuild and tell me if it works now?

Commit: https://git.rockbox.org/?p=rockbox.git;a=commit;h=637c7414a91c33e2627f99fee7b4c9cbf04abdb4 (https://git.rockbox.org/?p=rockbox.git;a=commit;h=637c7414a91c33e2627f99fee7b4c9cbf04abdb4)
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: tdb on February 08, 2017, 01:27:05 PM
No errors on my c200 :) Every game starts and seems to work.   
Using version d787191-170204

A couple of fun and intuitive games but some of them require reading a manual (most games I just started and pressed a few buttons to see if they worked). Screen of the c200 is pretty small and the playing field usually takes up even less than half of the screen so not all games can be played comfortably.
The cursor/pointer is nearly invisible so that doesn't help either ;)

 

 
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on July 17, 2017, 10:11:32 PM
Added a new feature for dynamic font sizing in commit e7a35ba. You'll need to extract this zip file to /.rockbox/fonts/: http://download.rockbox.org/useful/sgt-fonts.zip (http://download.rockbox.org/useful/sgt-fonts.zip). It lets the puzzle choose among differently-sized fonts at runtime. Without it, the puzzles will fall back to the old method of just hoping whatever UI font was set is of a reasonable size.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: codyteam on August 21, 2017, 06:42:03 PM
Can i use this on my sansa clip+?
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on August 21, 2017, 08:43:50 PM
Can i use this on my sansa clip+?

No, it only supports color displays. You might be able to make it work with greylib, though.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: Rick314 on October 22, 2017, 04:18:47 PM
I am a fan of Tatham's puzzle collection and use it on my Android phone and tablet regularly.  I've also been a Rockbox fan since 2008.  Thank you for your efforts to port the puzzle collection to Rockbox!  But on my SanDisk Sansa c250 v1 running Rockbox v3.14 many of the puzzles are unusable.  For example, see the attached images for the simplest possible Bridges (7x7) and Net (5x5) puzzles.  Solving the Bridges image required using a 5x eye loupe and decoding the numbers in the circles as each was selected, like the "2" that can be seen in the top-center of the image.  It would help to use the whole display area, or ideally add a "zoom" feature so only part of the puzzle is seen and the view window can be panned to see different areas of the puzzle.  But again, thanks for efforts so far.

Edit: I added images of what Bridges looks like on an Android tablet, for a 7x7 and a 15x15 game. Perhaps some of these puzzles just aren't appropriate to include on limited-resolution displays.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on October 23, 2017, 03:38:34 PM
Unfortunately the puzzles were written for PCs in mind, and are simply unsuitable for the extremely small screens we support (c200 has 112x80, I think). As for the zoom feature, it's certainly feasible and I will look into it more when I have time.

EDIT: the rockbox port is constantly being updated with changes from the upstream source, try the dev build to see if those changes improve anything (http://git.tartarus.org/?p=simon/puzzles.git;a=commit;h=84d3fd2bd8d3bd5db8cf61a134a4601307b9b7ea might help with Net, for example).

EDIT 2: looked further into the zoom idea, turns out it would require a complete rewrite of the drawing code.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: Rick314 on October 25, 2017, 08:37:44 PM
Unfortunately the puzzles were written for PCs in mind, and are simply unsuitable for the extremely small screens we support (c200 has 112x80, I think). As for the zoom feature ... turns out it would require a complete rewrite of the drawing code.

I understand and have an alternate suggestion then.  For each puzzle identify a Minimum System Requirement for display resolution and maybe other specs (mouse, track wheel, shift key, etc.).  Use conditional compilation to make it so that if a given Rockbox device doesn't meet the MSR, that puzzle doesn't appear to the user.  Games that can't realistically be played at even their simplest settings won't show up to users.  If in the future drawing code is changed, the Minimum System Requirement changes and more puzzles magically appear on devices where they weren't available earlier.

I think the SanDisk Sansa c200 series has a 132Wx80H pixel display, but the 80 is what matters and yes it is very limiting.  (I have a few pictures and videos on mine, just to appreciate what can be done on such a compact device. But they aren't very attractive.)
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on October 26, 2017, 08:15:00 PM
To tell the truth, I don't think going through and removing certain ones based on some criteria is worth the effort. The functional ones have been enabled for all targets they can run on for some time now. The only issue they could theoretically cause is taking up disk space, but they don't take up too much space, disk is cheap, and removing them from the build won't remove them from old .rockbox directories anyway.

That being said, if you decide to go through the SOURCES.games file [1] that controls which puzzles are built for which target and submit a patch to change the behavior, it'll certainly be considered. However, just know I don't plan on making that happen myself.

[1] https://git.rockbox.org/?p=rockbox.git;a=blob;f=apps/plugins/puzzles/SOURCES.games;h=8893c3e9a452109277b2cee43824ae1a88589bd6;hb=HEAD (https://git.rockbox.org/?p=rockbox.git;a=blob;f=apps/plugins/puzzles/SOURCES.games;h=8893c3e9a452109277b2cee43824ae1a88589bd6;hb=HEAD)
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on October 27, 2017, 06:11:49 PM
As for the zoom feature, it's certainly feasible and I will look into it more when I have time.

EDIT 2: looked further into the zoom idea, turns out it would require a complete rewrite of the drawing code.

Turns out I was wrong, it wasn't that hard. I just pushed the commit to add a "Zoom In" feature to the pause menu. Try the latest dev build and see if it helps.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: Rick314 on October 28, 2017, 12:11:49 AM
Very nice!  I loaded rev 9ba899f (2017-10-28T02:30:58) onto my SanDisk Sansa c250v1, started a complex (15x15) Bridges puzzle, and did Zoom In.  See the attached picture.  Each press of up/down/left/right moves the image about 1/2 the view dimension. It takes 3+ moves to span left-to-right, and about 5 moves to span top-to-bottom. But I can't figure out how to then play the game while zoomed. I assume that isn't working yet.

A related topic: Without using Zoom In, as in the 3.14 release, user control in Bridges seems odd. During the game, pressing the MENU key does nothing. I would expect it to transition from the game screen to the Rockbox menu for this game. (VOLUME-DOWN does this instead.) During the game, pressing SELECT, the big square button centered between up/down/left/right, does nothing. I would expect it change the state of the current island to prepare for making a bridge. (VOLUME-UP does this instead. On my SanDisk Sansa e250v1 running Rockbox 3.14, the REC key does this.) So two questions: How is Bridges meant to be controlled on the SanDisk Sansa c200 series in release 3.14? How is it meant to be controlled in Zoom In (since up/down/left/right move the view window instead of the currently active island)?  I looked in the Rockbox user guide for the SanDisk Sansa c200 series, but couldn't find any documentation describing how the controls explained in the puzzle help pages maps to the SanDisk Sansa c200 series controls.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on October 28, 2017, 09:34:31 AM
The zoom in feature is only for viewing the puzzle; it cannot be played while zoomed in. All the Zoom In feature does is render the game once at 3x resolution and let you pan around a static bitmap. You must exit the zoomed-in view in and return to the game in order to interact with the game.

As for the controls, on the c200, the VOL UP button functions as the select button, and the VOL DOWN button lets you exit to the pause menu (from the zoomed-in view, for example). I do realize that this is somewhat counter-intuitive, but it's how the keymaps are for now.
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: Rick314 on October 30, 2017, 04:19:28 PM
You must exit the zoomed-in view in and return to the game in order to interact with the game.
OK, but if left that way then Zoom In has little use to someone actually playing the puzzle.  I said earlier "Perhaps some of these puzzles just aren't appropriate to include on limited-resolution displays."  It sounds like 80 pixels just isn't enough to render and play some of the puzzles.  Fortunately most Rockbox hardware has more resolution that that, so it isn't an issue for most users.  Maybe the documentation for small-display Rockbox devices can explain the problem and leave it to the user to ignore non-playable puzzles.  This might be better than what I suggested before, deciding case-by-case which puzzles are playable on which Rockbox devices.  Regardless, good work and thanks for the puzzles!
Title: Re: Port of Simon Tatham's Portable Puzzle Collection
Post by: __builtin on October 30, 2017, 04:22:08 PM
I can probably make it playable from within the zoomed-in view. I'll see what I can do.

EDIT: Just pushed it. Basically pressing whatever's mapped to select on your target while zoomed toggles interaction mode now, which lets you play the game. I'll see about improving the c200 keymap.