miniSphere 4.6.0
miniSphere 4.6.0 is the sixth minor update in the miniSphere 4.x release series and brings many improvements to the Sphere v2 API as well as greatly enhanced Sphere 1.x compatibility. It also reinvents miniRT as the new Sphere Runtime, now an official part of the Sphere v2 platform!
Important Considerations
-
When using standard JavaScript modules (
.mjs), the main module of a
Sphere v2 game can now optionally useexport defaultto export a class.
The exported class should implement, at the very least, astart()method
to be called by the engine on startup. If the startup class derives from
Thread, you need only implement theon_update()andon_render()
handlers and miniSphere will kick off your main thread for you! -
Several Sphere Runtime modules have been removed or renamed. Pact is no
longer available, and term has been renamed to Console. All CommonJS modules
making up the Sphere Runtime now also match the object they export. For
instance,require('scene')returns the standardSceneobject. -
Most
Primmethods have been renamed to make them more self-documenting and
to make it more obvious that these represent immediate-mode drawing. For
example,Prim.line()is now calledPrim.drawLine(). Refer to the API
documentation for the full list. -
The Sphere v2 Core API now includes a
Sampleclass which allows a single
loaded sound to be played multiple times simultaneously, on any mixer. This
is great for sound effects. -
describe()has been removed from the Cellscript API and Cellscripts must
now manipulate the contents ofSphere.Gamedirectly. If desired, you can
use ES6Object.assign()to get semantics similar todescribe(). -
SSJ.log()andSSJ.trace()have returned and allow logging text to the
attached debugger.SSJ.log()output will also be visible in the terminal,
whileSSJ.trace()output will not. -
You must now call
Console.initialize()to enable the debug console for your
game. Loading the console module withrequire()will no longer enable it
automatically.
Changes in This Version
- When using ES6 modules (
.mjs), the main module can nowexport defaulta
class and miniSphere will automatically instantiate it and call itsstart()
method. This mirrors how Sphere v1 engines call the globalgame()function
on startup. - Adds a new
Sampleclass which works likeSoundbut loads the sound into
memory instead of streaming it and allows multiple instances to be played at
the same time. - Adds methods to
Modelfor setting vector-valued shader uniforms. - Adds
Transform#matrix, allowing direct access to the individual matrix
cells of a transformation. - Adds back the
SSJobject, to allow sending text to the attached debugger
(and optionally, to standard output). - Adds
Prim.blitSection(), to allow drawing only part of an image. - Adds
Console.initialize()which must now be called manually to enable the
debug console. Simply doingrequire('console')is no longer enough. - Adds a new module,
sphere-runtime, which brings together all the standard
modules and allows multiple symbols to be imported simultaneously by using
import {}. - Adds support for
Sphere.Gamein Cellscripts, allowing the data in the JSON
manifest to be manipulated directly. - Adds more missing Sphere v1 API functions, further improving compatibility.
- Renames several standard modules, e.g.
termbecomesconsole. - Renames
Primfunctions to better reflect their immediate nature and improve
code readability, at the expense of some extra verbosity. For example,
Prim.line()becomesPrim.drawLine(). - Renames
defScenelet()toScene.defineAction(). - Removes the
consoleobject from the Core API, as it turned out to be easily
confused with the standard console module. - Removes the
pactmodule from the standard library. - Removes the
minifymodule from Cell's standard library. - Removes
describe()from the Cellscript API. - Updates the internal graphics framework to use a pixel-perfect backbuffer,
which improves screenshots and fixes several rendering-related bugs. - Updates the Sphere Studio project template with code to illustrate the use of
ES6 class syntax as well as better showcasing the standard library. - Fixes a crash that happens when using
SetTileImage()orSetTileSurface(). - Fixes a bug where an error thrown during execution of a Console command will
crash the game with a JavaScript error. - Fixes a bug where Cell will sometimes not detect a filename conflict.
- Fixes a bug where
Dispatch.onRender()jobs are processed in reverse order
following a call toDispatch.onUpdate(), and vice versa. - Fixes a bug where miniSphere calls the render script before the update script
on map engine startup, leading to compatibility issues. - Fixes a bug in
LineSeries()andPointSeries()that made them always throw
a "two or more vertices required" error. - Fixes a bug where Sphere v1
Surface#cloneSection()andSurface#rotate()
could introduce graphical artifacts on some platforms. - Fixes a bug where Sphere v2
Sound#panrange is treated as [-255,+255]
instead of the documented range of [-1.0,+1.0].
Installing in Windows
Simply download and run miniSphereSetup-4.6.0.exe. The Inno Setup install wizard will walk you through the installation process.
Installing in Linux
For Ubuntu (14.04 and later), miniSphere is available via personal package archive (PPA):
Installing from a PPA is easy. Simply open Terminal and run the following commands:
sudo add-apt-repository ppa:fatcerberus/minispheresudo apt-get updatesudo apt-get install minisphere
You only need to do this once. The system will automatically notify you of future miniSphere updates.
Note: Users of Linux distributions other than Ubuntu will need to build the engine manually from the tarball (minisphere-4.6.0.tar.gz).