Home

Awesome

screenshot

RufasSok

RufasSok is a minimalistic version of the Sokoban puzzle game with embedded autosolvers for Windows, Mac OS-X and GNU-Linux.

Get full source and binaries in the tar.gz file under releases, or try this link:

https://github.com/fastrgv/RufasSok/releases/download/v2.5.9/rsok24jan24.7z

Type "7z x filename" to extract the archive.

GitHub downloaders: Please ignore the "Source code" zip & tar.gz files. (They are auto-generated by GitHub). Click on the large 7z file under releases to download all source & binaries (Windows,Mac & Linux). Then, type "7z x filename" to extract the archive.

RufaSok ...

Minimalist Sokoban
using GLFW3, OpenAL audio
with embedded live solvers

What's new:

ver 2.5.9 -- 24jan2024

ver 2.5.8 -- 8oct2023

ver 2.5.7 -- 23sep2023

See complete revision history at end of file


RufaSok Introduction

This is a minimalistic version of the Sokoban puzzle game with 3 external solvers, and 3 embedded auto-solvers designed to help you to learn to solve puzzles on your own.

The objective is to push all the movable objects onto their targets. And the embedded solvers can help you a little, or a lot, when you get stuck.

Controls

solver keys [within parentheses]:

movement keys:

other keys:


Features


Embedded Autosolver Function

Three autosolvers are now embedded within this application so that pressing the (=)-key or (,)-key or (.)-key at any time initiates an attempt to solve the present state of the current puzzle within a limited amount of time. If successful then you will see an onscreen prompt to continue to press the same key to single-step toward the solution. Otherwise you will see no such prompt. These three embedded solvers are good for small and dense layouts; but not so good at large, sparse puzzles.

The 3rd alternate solver [hbox4] is initiated with the (.)-key. It is the most capable embedded solver.

Note: all 3 solvers can fail if the puzzle is too large (256 or more valid puzzle positions).

Thus, you can give yourself a headstart toward a correct solution by limited use of this feature. Once you think you can solve it yourself, stop using the solver and proceed manually. This really helps when you cannot see what your next move should be.

Note also that the solvers can tell you when you have gone too far and gotten yourself into a deadlock. If you periodically test to see if a solution is available as you proceed manually, then if you go too far you will suddenly find no solution is available. This means you need to undo (u) until a solution is once again available.

Embedded autosolver failure might imply the present state of the puzzle is impossible to solve, or simply that the autosolver failed due to time constraint, or insufficient capability.

Finally, a single command-line argument (decimal float) specifies a persistent timeout interval to wait for the internal autosolver before giving up. The default is 10.0 seconds. A new setting remains in effect until a different setting is specified using a command-line argument.

The default method used by embedded solver Hbox4 [ (.)-key ] can now be reset using the k-key, where k is 0..5.

6 method options for hbox4:

* 0 "quickest"
* 1 more "efficient"
* 2 suppress hungarian estimator (for dense puzzles)
* 3 like 0 but tries to reduce total moves
* 4 like 1 but tries to reduce total moves [default]
* 5 like 2 but tries to reduce total moves

For further details see:

* https://sourceforge.net/projects/hbox4/

External Autosolvers

Remember that there are still three external autosolvers without time constraints. Subject to several limitations, typing: "solver-name puzzle-file-name.sok maxlevels level-number" will attempt to solve a particular puzzle for you, where solver-name is either "iplr3r" or "ibox3r". There are many large or sparse [lishout] puzzles the first two solvers cannot handle, but they are pretty good at sovling the small dense ones. Use the script ccc.sh to compile either solver for your operating system (assuming the presence of an Ada compiler).

To run type: [exeName puzzleFile TotalLevels LevelToSolve]

EG on windows type: binw64\iplr3r.exe games\pico_22.sok 22 3 ...to solve the 3rd level in file pico_22.sok.

EG on Linux type hbox4 games/pico_22.sok 22 3

EG on OSX type hbox4_osx games/pico_22.sok 22 3


what is special about this project?

It uses the Ada programming language and modern OpenGL methods, with textures, shaders and uniforms. Compiles and runs on Windows, OSX, GNU/Linux systems.

Focusing on portability, transparency, and open source freedom, this project relies exclusively on F.O.S.S. tools: a thin GLFW3 binding, a thin OpenGL binding, a PNG reader by Stephen Sanguine & Dimitry Anisimkov, and a GNAT compiler.

The linux-build is among very few modern OpenGL games where a single pre-built executable can run on multiple Linux distros without 3rd party add-ons!


Setup & Running:

Mac/OSX users see "osx-setup.txt". Windows users see "windows-setup.txt".

Unzip the archive.

After the archive is unzipped...

Users may then open a terminal window, cd to install-directory, then, at the command line, type the executable name to start the game.


In Linux type "rufasok" OR you may also double click the icon for rufasok in file manager. The command rufasok 20.0 sets the autosolver-wait to 20 seconds...double the default. This might help when using the second method ".", which is hbox, the most powerful of the 3.

You can also use the Windows executable under wine, thusly: * wine cmd < rufasok.bat * wine binw64/rufasok.exe


Windows users type: "rufasok.bat", or to reset solver wait to 10 seconds type binw64\rufasok.exe 10.0


The install-directory should contain subdirectories named "data", "libs", "games", "skins", "src", "buildScripts", "binw64", "docs".

Pusher movement is accomplished using the arrow keys or the WASD keys.

rufasok has the following skin options:


Other Details

The (h) key brings up a help menu that looks like this:


Linux Note: a "mouse" or "sloppy" window focus policy might allow window focus to slip away while changing puzzles (if the new window no longer includes the pointer). In this case, simply move the cursor back onto the puzzle window. This annoyance does NOT occur with a systemwide "click" policy. But now, the f-key toggles a game policy that forcibly keeps focus, although it is generally considered improper to do this.


Adding Your Own Sokoban Files

Note that the file naming conventions must be maintained now that dynamic file loading is done after reading the ./games/ directory. No underscores are permitted except one that precedes the integer that indicates the number of levels in the file. The name format is thus anyname_nnn.sok. Note that there is a standardized format for the online sokoban files themselves that I have attempted to respect and maintain.

Note also that a specific sokoban file may be tested by naming it on the terminal window command line with the following syntax:

rufasok sokfilepath maxlevels startlevel

where rufasok can be rufasok or rufasok.bat.

For example on linux you could type

"rufasok games/original_50.sok 50 2"

to tackle level 2 from the original_50 sokoban file. In this single-file mode, you can still use the next-level(n) & previous-level(p) keys, however, the next/previous files (R-shift/L-shift) keys are disabled.

Build Requirements:

Build instructions:

In the ~/buildScripts/ directory try:

Mac/OSX => lbuildall.sh

Linux => mbuildall.sh

msWin64 => setpath64.bat + wbuildall.bat

Note that the above windows built scripts might need to be adjusted. Please read ~/docs/gnuAdaOnWindows.txt.


The distributed linux executable requires glibc v2.14 or newer. That means if your distribution is older than june 2011, it probably will not run, and you will need to recompile.

Note that linux users with wine installed can run with the command:

wine binw64/rufasok.exe

If the delivered GNU/Linux binary does not run, try:

The command to build the external autosolvers [on linux] is simply: cccgnu.sh ibox3r cccgnu.sh iplr3r cccgnu.sh hbox4

and on Windows: ccc.bat ibox3r ccc.bat iplr3r ccc.bat hbox4

===================================================================

License

RufaSok itself is covered by the GNU GPL v3 as indicated in the sources:

Copyright (C) 2024 fastrgv@gmail.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You may read the full text of the GNU General Public License at http://www.gnu.org/licenses/.


Download Sites for all my games:

https://github.com/fastrgv?tab=repositories https://www.indiedb.com/members/fastrgv/games https://fastrgv.itch.io https://sourceforge.net/u/fastrgv/profile/ https://gamejolt.com/@fastrgv/games


Media Files

It is my intention to use media with copyrights or licenses that are compatible with GPLv3. Please notify me if you believe there is an incompatibility, and it will be removed ASAP, eg a CC-by-NC license is NOT GPL compatible.

SoundFiles (applause,fanfare,whoosh)

...are from freesound.org and are covered by the Creative Commons CC0 license documented in the accompanying file creativeCommonsCC0.txt.


Revision History:

ver 2.5.6 -- 5oct2022

ver 2.5.5 -- 28oct2021

ver 2.5.4 -- 13oct2021

ver 2.5.3 -- 15apr2021

ver 2.5.2 -- 4mar2021

ver 2.5.1 -- 20feb2021

ver 2.5.0 -- 3nov20

ver 2.4.2 -- 19sep20

ver 2.4.0 -- 04jan20