This is a minimalist Sokoban puzzle game & autosolver for Windows, OSX, Linux--all distros. It uses data in a format that is found on the internet, perhaps requiring a bit of editting. The beauty of this implementation is that it is fully OpenGL 3.3 core profile, and uses no OpenGL-deprecated functions. It has few embellishments, but it does have undo (u), restart (r), and setpoint (z) functions. Each data file has several "levels". The next (n) and previous (p) keys move between levels. Bigger (b) and smaller (s) keys help you adjust the size of the window. The (left-shift) and (right-shift) keys move you to the previous or next puzzle files. To move the "pusher" use the arrow keys. The objective is to push all the movable objects onto their targets.
This full version has been archived by the uploader because it is out of date and no longer supported. We recommend you browse the file list for the latest full version.
**ver 2.2.5 -- 4jul17** * Updated linux scripts to use a) SFML v2.4.2; b) AdaCore 2017; * Added linux script lcmp16.sh for AdaCore 2016 and earlier; * Note that AdaCore 2017 works on OS-X with no changes; * Added startup messages listing OGL profile & version; * Improved keyboard response;
# RufaSok
-------------------------------------------------------------
## What's new:
**ver 2.2.5 -- 4jul17**
* Updated linux scripts to use a) SFML v2.4.2; b) AdaCore 2017;
* Added linux script lcmp16.sh for AdaCore 2016 and earlier;
* Note that AdaCore 2017 works on OS-X with no changes;
* Added startup messages listing OGL profile & version;
* Improved keyboard response;
**v2.2.4 - 02may17**
* Added step countdown during solve.
* Made corrections to autosolvers.
**v2.2.4 - 23apr17**
* Puzzle files are now sorted alphabetically for intuitive navigation.
* An autosolver is now embedded within this application so that pressing the "=" key at any time initiates an attempt to solve the present state of the current puzzle. See extended description below.
**v2.2.3 - 18apr17**
* Now saves the complete game state on exit so that your progress through the levels of each puzzle file will be preserved.
* Also includes precompiled solvers for each platform.
## See complete revision history at end of file
-----------------------------------------------------------------
## RufaSok Introduction
This is a minimalistic version of the Sokoban puzzle game with 2 external solvers, and one embedded solver.
This implementation is fully OpenGL 3.3 core profile, and uses no OpenGL-deprecated functions.
It has undo (u), restart (r), and setpoint (z) functions. Each data file has several "levels". The next (n) and previous (p) keys move between levels. Bigger (+) and smaller (-) keys on the numeric keypad help you adjust the size of the window. The (left-shift) and (right-shift) keys move you to the previous or next puzzle files. To move the "pusher" use the arrow keys, or WASD keys. The objective is to push all the movable objects onto their targets. And now the (=)-key triggers an embedded solver that helps you when you get stuck.
--------------------------------------------
## Features
* uses SDL2;
* works on OS-X Retina displays;
* uses SFML for applause sound;
* all runtime files are in ./data/
* all puzzle files are in ./games/
* includes 2 external autosolvers: puller, ibox
* includes 1 internal autosolver too.
----------------------------------------------
## Embedded Autosolver Function
An autosolver (ibox) is now embedded within this application so that pressing the equal-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 equal-key to single-step toward the solution. Otherwise you will see no such prompt.
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 equal-key and proceed manually. This really helps when you cannot see what your next move should be.
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.
## External Autosolvers
Remember that there are still two 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 "puller" or "ibox". There are many large or sparse [lishout] puzzles these 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).
----------------------------------------------
## what is special about this project?
Uses the Ada programming language and fully modern OpenGL methods. Achieves version 3.3 core profile contexts, and compiles and runs on both GNU/Linux and Mac OS-X systems.
Focusing on portability and freedom, no coding effort or compromise has been made to accomodate proprietary operating systems. It relies on a thin SDL2 binding from Dan Vazquez, a thin OpenGL binding from "Lumen", a PNG reader by Stephen Sanguine, and SFML-Audio (because of its elegant audio interface).
## Build Requirements:
* a recent GNAT Ada compiler from AdaLibre;
* graphics card that supports OpenGL version 3.3 or later;
* Xcode g++ compiler, if using OS-X
## Build instructions:
"ocmpss.sh" is the build script for OSX, and "lcmpd.sh" is for GNU/Linux. ccc.sh is the build script for the autosolvers "puller" and "ibox". Just type "ccc.sh puller" or "ccc.sh ibox" to compile on any platform, assuming the presence of an Ada compiler.
The Mac binary should run on any recent version of OS-X. Simply navigate to the install directory in Finder and click on the icon.
If the delivered GNU/Linux binary does not run, try:
* Manually install GNAT GPL from libre.adacore.com/download/.
* Rerun the compile script lcmpd.sh or lcmpd2.sh.
### Fixable Link Problems during linux build:
On a linux build machine, you might have fixable link errors, depending on its configuration. If you are missing "libz", you can simply copy "libz.so" from /usr/gnat/lib/gps/ into /usr/local/lib/. If "libGL" cannot be found, this literally means "libGL.so" was absent. But you might have "libGL.so.1" present. In this case, simply create a softlink by changing to the libGL directory, then type the line:
sudo ln -s libGL.so.1 libGL.so (and enter the admin password)
whence the linker should now be able to find what it wants. But if there is more than one file libGL.so present on your system, make sure you use the best one; i.e. the one that represents your accelerated-graphic-driver.
------------------------------------------------
## Running:
Unzip the archive and you will see a new directory appear with a name like bundle+date, that you should rename to something like install_directory.
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, you may also double click the icon for rufasok_gnu in file manager.
Mac users must navigate to the installation directory in Finder and click the "rufasok.app" icon named "Rufasok".
The install_directory should contain subdirectories named "data", "gnulibs", "include", "games", "skins".
Pusher movement is accomplished using the arrow keys or the WASD keys.
asok has the following skin options:
* gray bkgd
* star bkgd
* water bkgd
* antique desk skin
* plain and simple
...the (c)-key now cycles thru the skins (c=color)
-----------------------------------------------------------------
Note that the (h) key brings up a help menu that looks like this:
* (esc) = exit
* (u) = undo last move
* (r) = restart
* (n) = next-puzzle in current file
* (p) = previous-puzzle in current file
* (R-shift) = next-file
* (L-shift) = previous-file
* KP(>) = bigger
* KP(<) = smaller
* (z) = reZero (setPoint)...subsequent presses of (r)-key will restore this configuration
* (c) = next skin Color
* (=) = try autosolver
-----------------------------------------------------------------
## 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.
===================================================================
I anticipate some problems with the newly attached autosolver so please report them and any questions or comments to fastrgv@gmail.com
===================================================================
## legal mumbo jumbo:
RufaSok itself is covered by the GNU GPL v3 as indicated in the sources:
Copyright (C) 2015 <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/>.
-------------------------------------------------
## Revision History:
**v2.2.2 - 9apr17**
* Improved error checking in shader package;
* Removed OpenGL-deprecated functions that could cause aborts;
* Revised directory structure, simplified codes;
* Added screen output of push-count, move-count.
**v 2.2.1 - 5jan17**
* Now used improved SFML interface binding.
* Added WASD keys for movement as alternates for the arrow keys.
**v 2.2.0 - 20aug16**
* Converted to Ada with essentially the same functionality. Of course the build scripts are different.
* Now includes two sokoban solvers, also written in Ada: puller, ibox.
**v 2.0 - 22feb16**
* added a Mac binary bundle that acts much more like a typical Mac App. This app is delivered in the installation directory, but could be moved elsewhere, such as your personal Applications directory. Note that there are some soft [symbolic] links in the bundle that are resolved automatically when copied by the command "cp -r rufasok.app destination-directory".
**v 1.6 - 26jun15**
* added (z) to menu, a keystroke that creates a setpoint (reZero) such that subsequent restarts (r) actually restore this configuration instead of the initial configuration. Use this when you have made progress but then want to embark on various alternate speculative strategies.
* Within a game session, the current level attempted in each file is now preserved as one moves between files.