Skip to main content

News

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Rhuan

1
Sphere General / Re: Proper way of using Sphere?
Didn't want to make another thread to ask this, but does Sphere support looping audio by reading metadata? I've always wondered how do deal with the problem of looping music.
As far as I know there is no built in feature for reading metadata.

BUT you can achieve the same effect as long as you use a seekable sound format (such as Ogg).

Sphere v2 soune objects have a writeable position property. Or if using the v1 api there's the setPosition Method and the getPosition method.

You would need to seperately store values for loop points somewhere then have an update script/function that checks the position of the current sound and if it has reached the loop point sets the position to wherever its meant to loop from.

This would be quite a simple system to make in Javascript - let me know if you'd like more detailed guidance.
2
Engine Development / Re: miniSphere 5.0.1
I recently updated from 4.5 to 5.0.1 so I already know I'm going to run into a heap of issues with the project I'm working on. I got the cellscript working and have a successful build, but I'm getting errors in my main script when importing my own modules.
I'm sure there is a lot of nuance and order that is over my head, so is there an example demo that I could view? I've looked at the getting started tutorial and it helped a little bit, but I've got a small rat's nest that's gotta be sorted through.

Any tips on updating projects from the older version of minisphere? Any recommended reading would be great, too!
Thanks!
This should probably be a topic in support rather than engine dev but :P

The getting started tutorial is horribly out of date right now... :(

One important change if moving from 4.x to 5.x is to get rid of uses of transpile() in your cell script - scripts should just be install()'ed with 5.x.

Also if using the import operator scripts need the extension ".mjs" rather than ".js".

Here's a link to a simple example project in miniSphere 5.0, very early demo of my remake of Kefka's Revenue (mostly just showing off the map engine I've made):
https://www.dropbox.com/s/x5sfkcad3jjhk91/KRdemo.zip?dl=0

If you need more specific help saying what error messages you're getting exactly and posting some of your code would make it easier.

If the problems are just with import then maybe read the MDN article on it: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
The common places I expect people to go wrong with it are:
a) get the file path wrong (import expects relative paths)
b) confuse default exports with other named exports
c) try and use static import syntax in a dynamic way
d) not use the .mjs extension that miniSphere requires
3
6/10 not enough pigs
Should I make some kind of performance test involving a herd of pigs?
4
This has moved from a project to a usable library now I think, new topic:
http://forums.spheredev.org/index.php/topic,1529.msg11018.html#new
5
Libraries / MapEngine for Sphere v2
This is still an alpha version I suppose but really needs some usage so I can know what else to do with it.

Feels good enough to share as a release of sorts now rather than just a project.

https://github.com/rhuanjl/SphereLibs

See the "Map Engine tutorial.md" file for a fairly brief getting started tutorial - it's a lot of files to put in your project but should hopefully be simple to use once in place.

Any questions let me know.

Note: this requires miniSphere version 5.0 (or later) it will not run with earlier versions and certainly won't run with Sphere 1.5.
6
Projects / Re: Project ZeC (My Zelda-esque Clone)
The zip file is too large to post in the forum.
Upload it with drop box or sendfile or something OR maybe make a github repository for it?
7
The Map Engine should now be usable - more polishing to do and more features coming also more documentation is coming...

But the code is all on github so you can take a look, if anything's not obvious feel free to ask.
https://github.com/rhuanjl/SphereLibs
8
Sphere General / Re: Proper way of using Sphere?
And yeah, I've peeked into the Discord. Looks like you guys talk about stuff related to developing the engine that I can barely make sense of.
Sorry that's probably my fault :(

As for examples of modules, can I push my Map Engine and related files - all modular and all Sphere v2 code - have a read of the code: https://github.com/rhuanjl/SphereLibs
9
Sphere General / Re: Proper way of using Sphere?
miniSphere 5.0 is about to be released (due date the 31st) in which the Sphere v2 api will finally be stable additionally I'm hoping that the modules I've been working on to go with it https://github.com/rhuanjl/SphereLibs will provide a good base for a game (though no one other than me has tested them yet).

Previously with the Spherev1 api there were two basic means of working:
1. Use the mapEngine, have anything else you wanted to happen regularly go in the update script and render script and store key data as global objects.
2. Don't use the mapengine (as it's not suited to your project) set up your own loop with an update stage and a render stage etc.

With Sphere v2
1. The engine now provides the loop https://github.com/fatcerberus/minisphere/blob/master/docs/sphere2-core-api.txt#L153-L184
 - it has an update stage for logic a render stage and a dispatch stage (for handling one-offs)
2, I'm hoping that my Map Engine script can replace the v1 mapengine, it's intended to be more flexible and give more control - also for more complex maps it should run faster as there are fast less calls between JS and C
3. Generally with v2 globals are discouraged, run all your code as modules with their own seperate scopes, hand anything you need to share around as parameters.

10
Hellos and Byes / Re: Hello all, from a mac user
Always good to see new members, welcome to spheredev.

Firstly on macOs support - miniSphere's source is fully macOs compatiable, just the provided makefile is not and you need to sort out some dependencies before you can build it; I have an xcode project that does it but it's just rather messy so I haven't posted the project, I'm intending to make a clean version at some point to be added to the github repo but it hasn't been my priortiy; I've only done macOs Sierra builds as Sierra is what I use and I've had almost no interest from anyone else in the mac version; I could make a build for an older version of macOs if you'd like? (will be most of a day until I can do it as I'm about to go to work).

On your other questions:
1.Android support is an idea, it could be a reality in maybe a year's time - it's no ones priority right now and would require this to be resolved first: https://github.com/Microsoft/ChakraCore/issues/3966

2. Raspberry pi I don't think we've even thought about - it should be possible but would need someone to do some work to make it work.

3. Depends what you mean by packaging - my current build of miniSphere is designed to be dev friendly - it runs with it's "system" resources in a folder with it so (so you can look at them etc) it's not quite the macOs dream of a drag and drop .app - your game can be packaged as one file that can then be opened with miniSphere on a different computer (or shipped in the same folder as miniSphere and named so miniSphere will auto-open it on launch) - with some minor tweaks to the source of miniSphere (literally two lines) I could make it work as .app bundle with the game inside it - that version wouldn't be so usable for development but I do intend to add such a version in the future as an extra build for releasing games with.

4. There's not much, the Sphere community seemed to dry up quite badly over the last couple of years we're hoping to give it a new shot of life shortly with all the new features coming in miniSphere 5 as well as some work I'm doing on a library of modules that should make game development with modern style JS easier/more intuitive - demo videos could be something for us to do over the next few weeks.

(note when I say "we" above at the moment miniSphere effectively has two developers @Fat Cerberus and me - Fat Cerberus writes the miniSphere code and I find problems with it for him to fix + make it work on macOs + sometimes help fix things + write lots of JS that I'm hoping will be a useful standard lib of sorts to go with it)
11
I lost most of my old Sphere games and resources when my laptop died (milk +laptop + seizure = spilled milk and a dead laptop), but I remember someone created a rudimentary 3D test game that rendered some cubes with textures from Minecraft, and you could move around the camera.
You could always do it with transformBlit and some maths but it's a bit of a pain.
12
Sphere was designed as a 2D RPG engine, it can do more than that but full 3d isn't quite there yet as said miniSphere's got a lot of what it needs but not quite all.

With miniSphere you can make shapes/polygons and apply a texture to them but you can only give their vertices x and y coordinates, they have a z coordinate property but it isn't used at the moment.

What have you been implementing your own 3d engine in?
13
@SilicateWielder welcome to spheredev/spherical. Recently there's been more conversation on the discord channel: https://discord.gg/F49sVP But the forum is still good for conversations we want to last. Sorry to hear you've had problems joining.


As for 3d; I think proper 3d support could come in miniSphere 6....

TBH all we need is an ability to draw shapes that have z coordinates, most of the hooks are there just a bit of internal plumbing missing.

After that we'd want a method for loading some common 3d formats - wouldn't be too hard to write some loading scripts I assume.

We may run into performance issues at that point if we tried to do anything too big with 3d stuff but I dunno - miniSphere with chakra is pretty fast but we're currently locked to being single threaded.
14
Projects / Re: Project ZeC (My Zelda-esque Clone)
Code: [Select]
var name = candle_flame;

var tile;
var tw = GetTileWidth();
var th = GetTileHeight();
var tn = GetTileName(tile);

var px = GetPersonX(name);
var py = GetPersonY(name);
var pl = GetPersonLayer(name);
var dir = GetPersonDirection(MainChar);

var x;
var y;
var l;

switch (dir) {

case "north":
 
 x = px;
 y = py - 2;
 l = pl;
 tile = GetTile(x, y, l);
 
  if (tn = "burnable_bush") //tile name to be changed later
   {
    if (py == y)
    {
     }
    }
   break;

I am not currently in front of a computer to test this on... Writing the code on my mobile phone. Looking at how this code is written so far, I'm wondering if it will produce an error on var tn due to the fact that var tile technically isn't being define until the switch (dir)?
I'm not even sure what you're trying to do in this example, I'm sure there's a way to do it that's more concise and won't make an error though.
15
Sphere Support / Re: Player Movement Systems...
It's certainly possible and a simple switching mechanism could be implemented.

Could it cause glitches? Well if there were mistakes in the code, sure :P