The way I see it, the Sphere 1.5 API is perfect in every step of it's existence, but if you think about it, it doesn't need to be implemented in the engine. Rather, only a few API calls ever need to be exposed and that's the direct interaction with each file type and input/output method. So really you only need like a couple dozen API calls.
1. Maps/People/Spritests/etc. are full JS objects that you can create the Get/Set API from, script side.
2. All objects become normal JS constructors, which you can make the Load*() API calls from.
3. All graphics are ran through a vertex/shape API that you can make the primitives and images API from.
4. All input is handled by global singletons for that game instance, where you can make the input API from (keyboard, mouse, joystick).
5. All files use 1 IO API which you can make all LogFile/RawFile/File API's from.
If you really think about it you only need to expose like 12 to 20 actual, hard coded, necessary API calls to sphere in order to run 90% of the rest of the API. Graphics, persons + maps, IO, input just have to use the few objects exposed to code and that's it.
It'll truly 'unlock' Sphere. It's great because you can then do cool things like:
// we may have an issue here: how do you attribute people to maps not yet loaded?
function CreatePerson(name, ss, destroy) {
var p = new Person(name, ss, destroy);
_current_map.addPerson(p);
return p;
}
function SetPersonX(name, x) {
_current_map.people[name].x = x;
}
var p = CreatePerson("fred", "fred.rss", false);
p.items = [];
p.coins = [];
// what a naive implementation of Sphere File Object looks like:
function LoadFile(filename) {
var p = new File(filename); // basically a raw file, and the only file type ever.
p.write = function(key, value) { this.writeLine(key + '=' + value); }
p.read = function(key, default) { // naive method
var l = this.readLine(); // returns null if EOF
while (l) {
var data = l.split('=');
if (data[0] == key) {
if (typeof default == 'number') return Number(data[1]);
if (typeof default == 'string') return data[1];
if (typeof default == 'boolean') return Boolean(data[1]);
}
l = this.readLine();
}
return default;
}
}
// easiest method ever to saving a person
var file = LoadFile("save.txt");
file.write("fred", JSON.stringify(p));
file.close();
TurboSphere is headed this way with it's Sphere 1.* shim. This is really a good idea. Having very few Sphere API calls also increases the fact you get more 'freedom' from the engine. I used to think you could never make a game without Sphere MapEngine... oh how wrong was I. It was just that since it was there, you had access to it and since there was this huge API around it, it made it hard to give the illusion of freedom, but it's there, you had a lot of freedom, but the API never always showed it. Especially when you hit brick walls like enumerating the fields of an image, adding a property to an image, or heck, even getting the dang filename of an image.