Rockbox

Tasklist

FS#6702 - More Sokoban Improvements

Attached to Project: Rockbox
Opened by absurdlyobfuscated (DrSpud) - Tuesday, 27 February 2007, 03:33 GMT
Last edited by Antoine Cellerier (dionoea) - Friday, 29 June 2007, 19:52 GMT
Task Type Patches
Category Games
Status Closed
Assigned To No-one
Operating System All players
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

A new set of improvements:

- Full support for text format levels, including RLE (Run Length Encoded) levels. This alone allows all targets to cache the entire default levelset, since the levels now take less than half the space they did before.
- Solution/progress saving/loading: menu on quit button press lets user choose to save & quit or quit without saving; prompt on level completion screen to save solution; .sb solution files may be 'played' to have a solution played out.
- External levels can be opened with the sokoban plugin to be played. Standard text format or RLE only, and lines with comments must start with a semicolon. When progress is saved, the current levelset (external or default) is saved as well - thus a 'load default levelset' menu option for convenience.
- Playback control on menu.
- A few more misc tweaks & code cleanup.

I think this about covers just about every bit of sokoban code I've modified or rewritten now ;)

The features & the way they turned out all made sense to me, so I didn't bother asking around for feedback. Everything works great as far as I've tested, and I haven't even noticed the slightest performance hit when resuming a level with 5000+ move progress on my iHP-140 :)
This task depends upon

Closed by  Antoine Cellerier (dionoea)
Friday, 29 June 2007, 19:52 GMT
Reason for closing:  Accepted
Additional comments about closing:  Applied (again). Thanks.
Comment by absurdlyobfuscated (DrSpud) - Friday, 16 March 2007, 04:00 GMT
One more little update: ROWS & COLS are set dynamically so all targets can support levels that fill their entire screen. No guarantee that a target will allow larger than 20x16, but several do.

Where'd you go, Zakk? ;)
Comment by Hepdog (007quick) - Friday, 16 March 2007, 22:58 GMT
Out of sync!
Comment by absurdlyobfuscated (DrSpud) - Saturday, 17 March 2007, 01:12 GMT
Ah, from revision 12807. Fixed.
Comment by absurdlyobfuscated (DrSpud) - Tuesday, 27 March 2007, 07:52 GMT
New updates:

- Menu reworked & converted to new menu API.
- Levels with non-level data are properly ignored now, though a more thorough check might be better.
- Remote no longer has menu or save screen stay on it after exiting from either.
- Display fixed on H10 5GB.
- Adjustable solution playback speed - press up/down to increase/decrease speed, respectively.
- Keys in manual synced to recent changes, and updated screenshots for all screen sizes included in zip. (The iPod mini [138x110x2] has a background color different from all the other screenshots for it... Not sure how that's supposed to work.)
- Error messages tweaked.
- Suffix for level set and saved solutions changed to the more conventional '.sok'.
- Using its own colors seemed unnecessary, so the user's choice of colors/background are used. It makes sense to me. Easy fix if anyone disagrees - I know there are plenty of other plugins that use their own colors, but a few don't...

Also, I think I found a case of bug  FS#6164  present - pressing play on the 'You Win' or 'Keys' screen seems to cause the previous button to fire again, exiting the menu or reentering the Keys screen. Looks like it happens when the play button is released.

The first patch got a lot more attention than this one is getting - is everyone off working on other stuff, or what? :)
Comment by Hepdog (007quick) - Tuesday, 27 March 2007, 14:34 GMT
Are all the pictures just for the manual?
Comment by absurdlyobfuscated (DrSpud) - Tuesday, 27 March 2007, 16:24 GMT
Yup. Also, I can't seem to get the manual to build (I get 'LaTeX Error: Missing \\begin{document}.'), so I'd appreciate it if someone could test it & make sure I did everything right.
Comment by Martin Arver (tucoz) - Wednesday, 28 March 2007, 08:34 GMT
Sean, are you running Ubuntu? In that case you'll have to tell either the Makefiles to use SHELL=/bin/bash (i.e. the Makefile in the manual build directory and the Makefile in the manual directory) by adding that line to the top of the Makefiles somewhere. Or you could change the symlink /bin/sh to point to /bin/bash instead of /bin/dash.
Comment by Martin Arver (tucoz) - Wednesday, 28 March 2007, 09:10 GMT
There is a patch at http://www.rockbox.org/tracker/task/6919#comment14245 to help you build the manual with ubuntu.
Comment by absurdlyobfuscated (DrSpud) - Thursday, 29 March 2007, 01:27 GMT
Thanks Martin, that got it working.
...and I'm running Kubuntu, actually ;)

Fixed a couple things in the manual and the sokoban.levels -> sokobanlevels.sok rename. With the exception of the iPod mini (see above), it's looking perfect.
Comment by Marianne Arnold (pixelma) - Monday, 09 April 2007, 15:46 GMT
I'm not sure that I like the new sokobanlevel file and how it looks - even though it surely saves space it'll be harder for someone to create an own level because you don't get a picture of how it'll look, like it was with the old code...

Regarding the background colour of the Mini screenshot: how did you take the screenshot from the sim (did you use F5)?
Comment by absurdlyobfuscated (DrSpud) - Wednesday, 11 April 2007, 04:15 GMT
Oh. I see. Screenshot fixed. :)

I have to say I agree about having the levels in a human-readable format. It does make editing quite friendly. The size savings really weren't much anyway (4k, not really all that significant even on, say, archos targets). Changed.

I'd say this is ready for a commit now, as long as no other issues arise.
Comment by Zakk Roberts (midkay) - Wednesday, 11 April 2007, 05:33 GMT
Hi again, Sean. :)

Sorry, I haven't had the ability to commit this lately. A short while ago, Vista crashed on me and I'm on a somewhat-temporary XP installation. I don't really want to spend the time downloading and setting up VMware and the image, because I won't be set up like this for long.

Within a few days I hope I'll have everything saved out to where it needs to be so I can reformat and reinstall an OS for good. Soon after I hope I'll get around to committing this.

Thanks for your continued work!
Comment by absurdlyobfuscated (DrSpud) - Wednesday, 11 April 2007, 20:23 GMT
That's really too bad Zakk. :(
I'll hold my tongue (erm, fingers) about Vista, but I will say it's awful nice (not to mention convenient) running it all natively. Hope you can get everything back up & running eventually.

You're welcome as always. :)
Comment by Nikkhil (AceNik) - Monday, 16 April 2007, 15:47 GMT
sync'ed
Comment by Nikkhil (AceNik) - Monday, 16 April 2007, 17:38 GMT
the above patch compiles well , patches successfully , but while make zip , sokoban.levels is not created
Comment by absurdlyobfuscated (DrSpud) - Wednesday, 18 April 2007, 08:19 GMT
Here it is with the levels and synced. The icon update makes things a lot nicer :)
Comment by Nikkhil (AceNik) - Friday, 04 May 2007, 14:20 GMT
i cant get the levels file to form everytime it gives me an error asking which file to patch sokobanlevels.sok does not exist , how do i make this patch work
Comment by absurdlyobfuscated (DrSpud) - Friday, 04 May 2007, 16:48 GMT
Make a copy of sokoban.levels and name it sokobanlevels.sok, then apply the patch. The patch was supposed to rename it, then change its contents, but I see now that it doesn't quite work the way I expected.
Comment by absurdlyobfuscated (DrSpud) - Sunday, 20 May 2007, 06:16 GMT
Synced with r13436, manual updated too.

So Zakk, did your OS survive?
Comment by Zakk Roberts (midkay) - Sunday, 20 May 2007, 07:54 GMT
Ugh, no, I still haven't done it. My plans for the reformat revolved around finding my external drive to backup a bunch of files to and, unbelievably, I couldn't find it anywhere. I'll have to do so soon though... but I'm really not looking forward to it. I've got quite a mess of files to clean and sort: some here, some there.

As for the patch, sorry, this is far more likely to be committed by somebody else before I'm in such a position to do so. I'd be glad to prod some developers into doing it though... thanks for covering all the bases (patched source and manual, bug-checked, etc) - makes it a lot easier.
Comment by Nikkhil (AceNik) - Monday, 28 May 2007, 18:24 GMT
hey guys fixed this patch, the sokobanlevels.sok earlier patch had the XXXXX also appearing causing it to go above 30kb, now its 17kb only , & this patch is synced with the svn, c ya, please stik to the order of the the svn's file, like there were many instances where edits were shown to be made , when they lease required to be made,like jus two lines wrongly placed, one above the other, please dont change the way the original files are & then make a patch this causes some lines to be appearing for addition & cutting out of no reason, hope you understand , c ya enjoy, oh did anyone get across the 11th level please send me the solution please !!!!!!
Comment by Nikkhil (AceNik) - Monday, 28 May 2007, 19:51 GMT
made a mistake with the earlier one please always follow this procedure, this is for people who don't know or people who will make mistakes like me
1.always before applying this patch revert sokoban.levels (after patch 0kb), in apps/plugins to get the original sokoban.levels(33kb before patch or after reverted to svn)
2.copy this file & rename the copy to sokoban.sok ie 33kb , just like the original sokoban.levels
3.then apply patch attached herewith, everything will be smooth

Also would like to know why are those PNG images included, with earlier patches, do we use them somewhere?
p.s: people patching please read the comment above this also.
Comment by Nikkhil (AceNik) - Monday, 28 May 2007, 19:55 GMT
sorry my net connection passed out
Comment by Nikkhil (AceNik) - Monday, 04 June 2007, 18:51 GMT
sync'ed
Comment by absurdlyobfuscated (DrSpud) - Friday, 22 June 2007, 07:38 GMT
In response to http://forums.rockbox.org/index.php?topic=11023.0 , I fixed a few levels that differed from the 'official' versions:
52 - removed walls restored
58 - goal area lowered
61 - start moved
62 - extra wall removed, start is easier
70 - extra boxes removed
74 - removed walls restored
75 - extra walls removed
87 - extra wall removed
92 - moved box restored, made level solvable!
97 - start moved
100 - moved walls & boxes restored

86 was left alone since it's more correct than the original.
I also fixed a bug in the loading process found while testing the level changes.

@Nikkhil: I think I'll just let whoever commits this figure out the details with the filenames. The pics are for the manual, since the appearance has been updated some. Also, there are solvers you can use if you get stuck - 11 isn't hard compared to later levels :)
Comment by absurdlyobfuscated (DrSpud) - Saturday, 23 June 2007, 02:42 GMT
Fixed typo.
Comment by absurdlyobfuscated (DrSpud) - Sunday, 24 June 2007, 05:54 GMT
Updated the manual to mention some of the extra features, and fixed one last bug similar to the previous one. Now I think it's good :)
Comment by Antoine Cellerier (dionoea) - Thursday, 28 June 2007, 20:45 GMT
Patch applied. Thanks.
Comment by Antoine Cellerier (dionoea) - Friday, 29 June 2007, 11:31 GMT
Reopened since Sean still has sokoban modifications pending.
Comment by absurdlyobfuscated (DrSpud) - Friday, 29 June 2007, 17:19 GMT
Thanks Antoine, here's what I was about to add:


After thinking about it for a while, I decided it made more sense to follow the naming conventions of other games and go back to the original filenames. Plus the level set & save file are hidden away underneath the hidden (by default) .rockbox folder, so it doesn't matter much if they have a .sok extension. It now defaults to the folder /games when saving a solution from the default level set; other level sets are still the same though.

Also a few other additions:
- Level select on menu lets you choose any level in the current set
- I found out that some versions out there mixed in some slight variation from the extra set, so some levels were changed back to the correct version. Now only the following are different than what they were originally: 52, 58, 74 (doesn't affect gameplay), 92, and 100
- Solution playback can be paused, and progress can be manually moved forward or backward
- The folder a save file is in is created if it doesn't exist; prevents errors if, say, /games hasn't been created and a solution is saved there.
- A few tweaks to solution playback speed changing.

You'd need to change the level file name back, too. Sorry about the inconvenience. This patch now concludes all the changes I had in mind :)

Loading...