3D Sokoban

July 01, 2015

About

My University Dissertation focused on considerations, concerns and design over turning classic board or 2 dimensional puzzle or mind games into 3 dimensions. This covered a variety of games including the success of Chess in 3 dimensions, Othello, and breaking down gameplay to determine viability and potential design for another access of movement. This was combined with with my course’s dissertation requirement of being primarily a software project.

Sokoban was the puzzle chosen to demonstrate a viable transition for an older game into another dimension without modification or breaking or fundamental gameplay. Sokoban was the choice due to simplicity of core mechanics, ease of extension into another dimension; by and large a 3-dimensional Sokoban is a standard Sokoban board that wraps around on 1 or more axis’.

The Implementation (Game and Engine)

Sokoban 3D is based on a small 3D Component/System game engine I wrote, with a couple of aspects of its implementation spanning a couple of my senior year modules. This engine is written in C++, utilising OpenGL for rendering, and AssImp for model importing. It also supports fairly extensive scripting via Lua integration. The Sokoban implementation is written almost entirely in Lua on top of engine, with a few specialist C++ classes due to time constraints.

Renderer

The renderer is written entirely with OpenGL, shaders separated from the source inside the binaries folder. It supports both 2D and 3D rendering, as well as font’s using a glyph image (included with download): Rendering menus Usage of GLFW also means that both windowed and fullscreen modes are fully supported, as well as different resolutions, and aspect ratio’s (limited support). Finally, I wrote some rudimentary material file support, to allow for definition of materials, instead of raw textures only. This format is basic Json, and support diffuse and normalmaps, toggling alpha channel usage, and fullbright (always fully lit). Mesh support is .obj & .md5 formats, although it should support other common formats (thanks AssImp, but untested).

In-game

Below are a couple of screenshots in-game. Unfortunately due to time constraints, the playable character lacks texture and animation (he is t-signing). The same applies to the visuals in general, there is support for rendering a Skybox: this can be specified in the configuration to use, by specifying and attaching to the Camera in Lua during instantiation. Level 1

The included Lua scripts setup the game, as well as keep track of the level, interface and elapsed time. Each level is constructed from files formatted as an extension similar to the most common Sokoban implementation format. The above shot is a single face stage, to introduce the mechanics, whilst allowing the player to orbit the camera around the cube.

Below is a much clearer shot of a multi-face level, with multiple goals. The player should move around the faces, and move the blocks as normal onto each marked square. Blocks can be pushed around corners as should be expected. Multi-face levels

This implementation has support for unlimited stages, the next level is loaded on completion of the previous

Download & Requirements

Requirements

Binary: From Dropbox Source: View GitHub repository

Requirements

  • Windows XP or newer
  • OpenGL 4.0 support
  • Source is a VS2013 project, and for ease of compiling, the repo includes the relevant libs.