Skip to content

@fatcerberus fatcerberus released this Feb 20, 2020 · 45 commits to master since this release

miniSphere 5.4.2 is a maintenance release in the 5.4 series.

What's Changed?

  • Adds experimental Thread#suspend() API, which works like Thread#pause() but also pauses rendering.
  • Adds support for mp3 playback through the Sound API on Windows.
  • Renames FileStream.open() to FileStream.fromFile().
  • Renames Socket.connectTo() to Socket.for().
  • Fixes an issue where from() didn't check its argument, leading to a nonsensical stack trace later if the caller accidentally passes null or undefined.
Assets 4

@fatcerberus fatcerberus released this Jan 5, 2020 · 56 commits to master since this release

miniSphere 5.4.1 is a maintenance release in the 5.4 series.

What's Changed?

  • Changes strictImports to also disable CommonJS module support.
  • Removes the xml module from the Sphere Runtime.
  • Fixes a bug where Cell writes the wrong values for name, author, and description in game.sgm.
Assets 4

@fatcerberus fatcerberus released this Dec 1, 2019 · 62 commits to master since this release

miniSphere 5.4.0 is the fifth release in the 5.0 series. This release brings support for the .cjs extension, adds a new strictImports development flag and brings a slew of bug fixes and other enhancements.

important note:
the .tar.gz tarball no longer includes ChakraCore binaries. to get these, first check if your distribution has a ChakraCore dev package available and install it if so; if not, then run sudo make deps from the miniSphere source directory to download the binaries from Microsoft and install them. you should only need to do this once.

What's New?

  • miniSphere and Cell now support the .cjs file extension introduced in Node.js v13.2.0. Scripts with this extension are always loaded as CommonJS modules, regardless of whether require() or import is used. This can be helpful if you need to load a CommonJS module using a relative path, since relative require() is not supported in ESM files.

  • miniSphere 5.4 adds a new optional strictImports flag in the development section of game.json. This flag, when enabled, causes SpheRun to enforce that your import specifiers are Oozaru-compatible--in particular, any imports referring to files in the project must include the file extension, such as .js. Like other development flags, strictImports has no effect in production.

  • DirectoryStream now includes additional depth and extension properties on result objects, making it easier to filter directory entries based on those criteria. Keep in mind that since the new properties are part of the experimental API level 3, they will be disabled in retrograde mode.

  • Mouse#getEvent() no longer returns null in case of an empty queue. Instead it now returns an object whose .event is set to null in this case to facilitate safe destructuring of the return value. This might break code that specifically checked for a return value of null. The old behavior is being treated as a bug and the change may be backported if necessary, so any code that does this should be updated as soon as possible.

  • Several Query methods were renamed to align with the corresponding LINQ names. This will inevitably break code that uses these methods; check the changelog for the full list. Note that the Sphere Runtime API is not yet frozen.

  • Cell now supports using a directory name for Tool#stage(). Directories are considered to be permanantly out-of-date, so Cell will always run a tool which claims to build one. This eases things for tools that dynamically determine their sources or create multiple output files, which would often be considered erroneously up-to-date because Cell didn't consider all the files involved.

  • To improve sandboxing and ensure out-of-source builds always work correctly, starting with this version, Cell code can no longer write files and directories under $/. This change might break builds that depend on $/ being writable.

  • Cell now tracks all files created using FS.writeFile() as build artifacts. These files will be therefore now be deleted when running cell clean, even if they have no corresponding Target.

Full Changelog

  • Adds several Query methods: apply, call, concat, elementAt, join, memoize, pull, single, skipLast, skipWhile, takeLast, takeWhile, and zip.
  • Adds Mouse#position which returns a tuple [x, y] for easy destructuring.
  • Adds mouse-button activation support to the console module.
  • Adds a new FS.match() API for matching filenames and paths against "glob" patterns such as **/*.js, useful for filtering DirectoryStream output.
  • Adds new depth and extension properties to DirectoryStream output to make filtering even easier.
  • Adds support for using a directory as the output of Tool#stage() in Cell.
  • Adds support for the .cjs file extension to facilitate smoother interop between ESM and CommonJS code.
  • Adds a strictImports manifest flag to enforce Oozaru-compatible imports.
  • Improves sandboxing by disabling write access to $/ in Cell code.
  • Improves Cell build hygiene by tracking files created with FS.writeFile() as build artifacts and cleaning them as necessary.
  • Renames Query#drop() to Query#skip() for consistency with LINQ.
  • Renames Query#reduce() to Query#aggregate().
  • Renames Query#over() to Query#selectMany().
  • Renames Query#uniq() to Query#distinct().
  • Fixes a bug where destructuring the return value of Mouse#getEvent() can throw an error due to being null.
  • Fixes a bug where Query#any() and Query#all() can return undefined in certain cases instead of a boolean value.
  • Fixes a bug where Query#count() can return null instead of 0.
  • Fixes a bug where require() can't be used to load system modules like sphere-runtime.
  • Fixes a bug where Cell fails to properly normalize the pathname passed to Tool#stage(), potentially leading to undesirable behavior later.
Assets 4

@fatcerberus fatcerberus released this Dec 25, 2018 · 137 commits to master since this release

Merry Christmas! 🎄🎅

miniSphere 5.3.0 is the fourth release in the 5.0 series. This release brings back support for 32-bit Windows and comes with a host of new features and enhancements such as cell init, brand-new Core APIs, a new version of from.js rewritten from the ground up for maximum performance, support for loading .js as ESM, and many fixes for issues and bugs discovered since the previous release.

important note:
the .tar.gz tarball no longer includes ChakraCore binaries. to get these, first check if your distribution has a ChakraCore dev package available and install it if so; if not, then run sudo make deps from the miniSphere source directory to download the binaries from Microsoft and install them. you should only need to do this once.

What's New?

  • Several APIs were canonized in this release (refer to the API documentation to see which ones) and the maximum supported API level increased to 2. If you put apiLevel: 2 in your manifest, your game will require miniSphere 5.3 or later. If you still want to support earlier versions, specify apiLevel: 1 in the manifest and test for newer APIs at runtime by checking the value of Sphere.APILevel.

  • Cell's command-line syntax has been enhanced to support new commands. Notably, a few options have been promoted to full commands, e.g. cell -c is now cell clean. If you need a quick primer on the new syntax, you can type cell help on the command-line.

  • New fromFile factory methods have been added to all built-in classes whose constructor accepts a filename. These methods return a promise for the new object, which allows assets to be loaded asynchronously in implementations where that is necessary.

  • The from module has been rewritten for improved performance and along with several new query operators come some minor breaking changes. Query#skip is now called drop, Query#from is now called over and the iteratee for .first and .last is now treated as a mapping function rather than a predicate. As always, refer to the Sphere Runtime API documentation to get up to date on current API usage.

  • import statements are now always treated as ES Module imports regardless of filename extension. If your game or Cellscript needs to load CommonJS modules and is now doing so using import, you will need to switch to using require().

  • To improve end-user security and ensure the SPK package format is not a malware vector, it is no longer possible to relax or disable the SphereFS sandbox in production. The sandbox manifest field has been moved into a special development namespace which will only honored by SpheRun when running a game from a local directory. When using a relaxed or disabled sandbox during development, Cell will notify you when building for release that full sandboxing will be enforced in production.

  • When executing a standalone .js or .mjs script from the command line, starting in miniSphere 5.3, you must use the spherun command. Standalone scripts are executed with the SphereFS sandbox disabled, so allowing the end-user engine to run them was identified as a potential security issue.

  • New MouseKey event codes were added (MouseKey.Back, MouseKey.Forward), and therefore games written for API 1 will now end up seeing key codes they can't match to a known constant. This is a potentially breaking change if your game treats unrecognized event codes as an error. Instead of producing an error, unknown event codes should simply be ignored.

  • SSj.assert has been added which lets you perform sanity checks during development without impacting performance in production. Expensive checks can be wrapped in an arrow function which will only be called when running the game using SpheRun.

  • The obsolete assert and test modules have been removed from the Sphere Runtime in preparation for an upcoming API freeze in miniSphere 6.0. These modules were written based on old CommonJS specifications and don't really have a place in a modern JavaScript codebase.

  • The undocumented scenelets (fadeTo, tween, pause, call) that were previously registered by default by the scene module have been removed. They had been retained for internal use, but the Scene API accidentally exposed them to user code. If you're currently using one of the scenelets listed above, you will need to implement their functionality yourself.

  • DirectoryStream objects can now be initialized in recursive mode. In this mode, instead of listing subdirectories along with files, it will recursively descend into subdirectories to list the files in them. This provides a convenient way to find files at any level of a directory structure using a single DirectoryStream.

  • When calling Transform#rotate and specifying a vector to rotate about, the provided vector is now normalized. This is a bug fix, but may be a breaking change if your game happened to rely on the previous behavior. If your rotations seem broken after upgrading to mS 5.3, this is probably why.

Full Changelog

  • Adds support for games targeting API level 2, canonizing several Core APIs.
  • Adds cell init to initialize a new Sphere source tree on the command line.
  • Adds asynchronous asset loading functions, e.g. Sound.fromFile(), to improve cross-compatibility with Oozaru. Refer to the miniSphere 5.3 release notes for further information.
  • Adds a pop-up message when pressing F12 to confirm a screenshot was taken.
  • Adds Joystick.P1 through Joystick.P4, providing built-in default gamepad inputs for up to four players.
  • Adds new async methods to Socket for performing connnections and I/O via the event loop, allowing a game to await the arrival of data and avoiding the need to explicitly check the state of the socket every frame.
  • Adds SSj.assert to automatically verify assumptions made while coding.
  • Adds Socket#noDelay which disables Nagle's algorithm for a connection.
  • Adds Server#numPending, the length of a Server's connection backlog.
  • Adds JSON.fromFile() for loading and parsing a JSON file in a single call.
  • Adds Font#widthOf() and Font#heightOf() convenience calls.
  • Adds a new parameter to FS.readFile to control how file contents are returned.
  • Adds a new class to the from module, Query, which lets you prefabricate queries and run them as many times as you want on any source.
  • Adds a new Sphere Runtime module, tween, for handling simple animations.
  • Adds support for -h as an alias for --help for all command-line tools.
  • Adds FS.directoryOf(), FS.extensionOf() and FS.fileNameOf() for taking apart path strings.
  • Adds a new development manifest field to control behavior under SpheRun.
  • Adds API support for the Back and Forward buttons found on modern mice.
  • Adds a new option, recursive, for DirectoryStream, to include files in subdirectories.
  • Adds apiVersion and apiLevel to the example Cellscript.
  • Improves module handling; all import statements regardless of extension are now loaded as ESM code.
  • Improves security by forcing full SphereFS sandbox enforcement in production.
  • Improves security by disabling execution of bare scripts using minisphere.
  • Improves BlendOp by making it into a class, allowing games to define their own custom blending modes.
  • Improves performance of code using SSj namespace methods in production by avoiding unnecessary native calls.
  • Improves performance of from() queries across the board.
  • Improves bare-script execution by loading .js files passed on the command line as module code, allowing them to use import.
  • Improves the performance of Transform#matrix, particularly on first-access.
  • Improves first-access performance of Sphere.Game by avoiding an unnecessary JSON round-trip conversion.
  • Improves Cell's command-line syntax. Many options have been replaced with easy-to-remember commands like cell build or cell pack.
  • Removes the assert, delegate, joypad, and test modules.
  • Removes several internal-use-only Scenario scenelets (fadeTo, call, playSound, tween) which sometimes clashed with game code wanting to use those names.
  • Fixes a crash when calling MapEngine/FlipScreen from the main function.
  • Fixes an issue where the cursor is hidden while sitting over the game window.
  • Fixes an issue where FS.fullPath doesn't add a trailing slash when passed the path of a known directory.
  • Fixes an issue where Socket#close disposes of the underlying socket object preventing it from being reused.
  • Fixes a bug where the MULTIPLY blend mode is rendered the same as ADD.
  • Fixes a bug where Cell puts dist/ in the PWD by default instead of in the directory of the project being built.
  • Fixes a bug where calling Sound#play without passing a Mixer doesn't work.
  • Fixes a bug where the vector passed to Transform#rotate is not normalized before calculating the rotation matrix, leading to unpredictable behavior.
Assets 5
Dec 16, 2018
miniSphere 5.3.0 RC1
Nov 25, 2018
miniSphere 5.3b2
Oct 2, 2018
miniSphere 5.3b1

@fatcerberus fatcerberus released this Sep 6, 2018 · 420 commits to master since this release

miniSphere 5.2.13 is a maintenance release in the 5.2 series.

What's Changed?

  • Adds Sphere.main which provides access to the object created by the engine when the main module exports a class.
  • Changes the default Console prompt from $ to >.
  • Changes Thread#start() to an async function which returns only after the Thread's startup handler has run to completion.
  • Fixes a bug where Sphere.sleep() prevents the engine from shutting down until the sleep period expires.
  • Fixes a bug in which Scene#call() doesn't await async functions.
  • Fixes a bug where an async function used for a recurring Dispatch job can be re-entered before an earlier invocation has completed.
Assets 4

@fatcerberus fatcerberus released this Aug 18, 2018 · 429 commits to master since this release

miniSphere 5.2.12 is a maintenance release in the 5.2 series.

What's Changed?

  • Improves the Core API documentation by adding minimum API levels for each function and property documented.
  • Fixes a crash bug where calling certain Sphere v1 map engine functions without the map engine running causes a null pointer dereference and ensuing segfault.
  • Fixes a bug where cancelling the last recurring job using JobToken#cancel leaves the event loop spinning indefinitely, forcing the user to close the game window manually.
  • Fixes a bug where passing a Symbol to SSj.log() throws an exception.
  • Fixes a bug where Mouse#getEvent() returns the wrong cursor coordinates when the game window is scaled or in fullscreen mode.
  • Fixes a bug where Mouse#getEvent() produces way too many click events.
Assets 5

@fatcerberus fatcerberus released this Jul 1, 2018 · 440 commits to master since this release

miniSphere 5.2.11 is a maintenance release in the 5.2 series.

What's Changed?

  • Updates ChakraCore to version 1.10.0.
  • Fixes an issue where miniSphere crashes with a segfault when a .js script attempts to dynamically import a module that doesn't exist.
Assets 5
You can’t perform that action at this time.