Skip to content

miniSphere 4.6.0

Choose a tag to compare

@fatcerberus fatcerberus released this 05 Jul 03:24

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 use export default to export a class.
    The exported class should implement, at the very least, a start() method
    to be called by the engine on startup. If the startup class derives from
    Thread, you need only implement the on_update() and on_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 standard Scene object.

  • Most Prim methods 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 called Prim.drawLine(). Refer to the API
    documentation for the full list.

  • The Sphere v2 Core API now includes a Sample class 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 of Sphere.Game directly. If desired, you can
    use ES6 Object.assign() to get semantics similar to describe().

  • SSJ.log() and SSJ.trace() have returned and allow logging text to the
    attached debugger. SSJ.log() output will also be visible in the terminal,
    while SSJ.trace() output will not.

  • You must now call Console.initialize() to enable the debug console for your
    game. Loading the console module with require() will no longer enable it
    automatically.

Changes in This Version

  • When using ES6 modules (.mjs), the main module can now export default a
    class and miniSphere will automatically instantiate it and call its start()
    method. This mirrors how Sphere v1 engines call the global game() function
    on startup.
  • Adds a new Sample class which works like Sound but loads the sound into
    memory instead of streaming it and allows multiple instances to be played at
    the same time.
  • Adds methods to Model for setting vector-valued shader uniforms.
  • Adds Transform#matrix, allowing direct access to the individual matrix
    cells of a transformation.
  • Adds back the SSJ object, 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 doing require('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.Game in 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. term becomes console.
  • Renames Prim functions to better reflect their immediate nature and improve
    code readability, at the expense of some extra verbosity. For example,
    Prim.line() becomes Prim.drawLine().
  • Renames defScenelet() to Scene.defineAction().
  • Removes the console object from the Core API, as it turned out to be easily
    confused with the standard console module.
  • Removes the pact module from the standard library.
  • Removes the minify module 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() or SetTileSurface().
  • 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 to Dispatch.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() and PointSeries() that made them always throw
    a "two or more vertices required" error.
  • Fixes a bug where Sphere v1 Surface#cloneSection() and Surface#rotate()
    could introduce graphical artifacts on some platforms.
  • Fixes a bug where Sphere v2 Sound#pan range 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/minisphere
  • sudo apt-get update
  • sudo 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).