Skip to main content

News

Topic: Sphere 5.5.1 (miniSphere) (Read 408659 times) previous topic - next topic

0 Members and 2 Guests are viewing this topic.
Re: minisphere 4.3.8
Reply #1470
Replacing screen.flip with FlipScreen worked. Maybe you should have a function or property to prevent throttling, or is there something like this already?

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.3.8
Reply #1471
Code: (javascript) [Select]
screen.frameRate = Infinity;


That's actually documented:
https://github.com/fatcerberus/minisphere/blob/master/docs/sphere2-api.txt#L616-L619

Note that will peg the CPU though if you're rendering in a loop.
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: minisphere 4.3.8
Reply #1472

Note that will peg the CPU though if you're rendering in a loop.

Is that a bug?
  • Last Edit: January 20, 2017, 05:20:03 am by Eggbert

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.3.8
Reply #1473
No; by setting the framerate to infinity, you're asking the engine to draw as many frames as it possibly can.  That's why it's set to 60 by default, so the engine can sleep in between frames.
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.3.8
Reply #1474
What I might do for minisphere 4.4.0 is add a new property, screen.frameSkip.  You could then set that to 0 to prevent frames from being skipped, but still take advantage of throttling to keep your CPU usage under control.
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.3.8
Reply #1475
Good news: I'm finally done with the Cell overhaul and it's no longer a useless waste of disk space, but instead something I can be proud of. :))  Barring more bugs cropping up (hopefully I squashed them all this time!), minisphere 4.4.0 should be out in a few days with the new compiler.  Then everyone will be able to use ES6 goodies like arrow functions in their Sphere games!

Using Cell 4.4.0 and a properly-written Cellscript, it will already be possible to:

  • Automate your build, only including those files which are relevant to a release.

  • Package your game into an SPK package for easier distribution

  • Transpile ES 2015+ to ES5 using the transpile module

  • Minify scripts using the minify module.



More Cell features will be coming in minisphere 5.0, like TypeScript compilation, so keep a look out for updates on that front. :)

As for minisphere itself: I tried very hard not to make any breaking changes to the Sphere v2 API, but I did ultimately have to make one change: Some of the FS functions got renamed.  For example, FS.unlink() is now FS.deleteFile().  One of Sphere's many strengths has always been its self-documenting API and using the POSIX names for file system functions wasn't doing us any favors in that department. ;)

tl;dr: minisphere 4.4.0 coming very soon!
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.4.0
Reply #1476
After nearly two months of tireless work (minisphere unofficially sponsored by Monster Energy™ :P), the first minisphere release of 2017, v4.4.0, is out now!
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • DaVince
  • [*][*][*][*][*]
  • Administrator
  • Used Sphere for, like, half my life
Re: minisphere 4.4.0
Reply #1477
Nice work, dude! :D

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.4.0
Reply #1478
There's a bug in the Ubuntu packages which causes Cell to not be able to find require() modules.  Unfortunately Launchpad won't let me re-upload the packages without changing the version number. :(

Specifically the problem is that I didn't account for the makefile installing the system folder in /usr/share/minisphere, rather than next to the executables as in Windows.  That didn't show up when I tested it on Linux because I only tested the standalone build.  If I had tested 'make install' it would have shown up.  I'll remember to test that next time.

I'll post 4.4.1 tonight.
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.4.0
Reply #1479
@Eggbert: Your PKGBUILD uses make install, so the Arch release probably suffers from the same bug. :(
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: minisphere 4.4.0
Reply #1480
It looks like games that use game.json cause minisphere to throw a parsing error and then segfault, while games that use the legacy game.sgm format work fine.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.4.0
Reply #1481
Huh, weird.  Is the game.json missing any properties?  Spectacles works fine for me and that uses game.json, but it's also compiled with Cell, which ensures everything is accounted for.  I'll look into it.
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

Re: minisphere 4.4.0
Reply #1482
I don't think so, but just to verify that it isn't on my end, here is what I'm looking at. If I run `spherun .`, it fails, but it works fine from within shmup/dist/, the folder that Sphere Studio generated.

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.4.0
Reply #1483
Yeah, Sphere Studio sets new projects to build in dist/ by default (this is also where Cell builds if you don't tell it otherwise).  As for your JSON file, there are a few issues with it actually.  The first one I noticed was:

Code: (json) [Select]

"main": "main.js",


SphereFS requires that path to be relative to game.json, or in other words it should be "scripts/main.js".  That's not what caused the crash, though.  The parse error you saw is caused by the trailing comma after the last property.  For some stupid reason, JSON doesn't support trailing commas.  Removing the last comma allows minisphere to load the game.

The last issue, which prevented the game from running, was that your manifest didn't specify v1.  Without that minisphere tries to run the game in v2 mode (basically: the main script is a module), which causes most legacy code to break (e.g. "personlib is not defined").  Here's a fixed JSON file that allows the game to run:

Code: (json) [Select]

{
"version": 1,
"name": "Unnamed Shump",
"author": "Eggbert",
"summary": "Follow Scott Starcross in his quest to stop the Primus.",
"resolution": "416x416",
"main": "scripts/main.js"
}


In any case I'll fix the segfault.  It definitely shouldn't crash, no matter how many errors are in the descriptor file. :)
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub

  • Fat Cerberus
  • [*][*][*][*][*]
  • Global Moderator
  • miniSphere Developer
Re: minisphere 4.4.1
Reply #1484
Okay, I uploaded 4.4.1 which makes Cell work in Linux again and also fixes the crash Eggbert found.
Sphere 5.5.1 - miniSphere engine - Cell compiler - SSj debugger
forum thread | on GitHub