Skip to main content


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.

Topics - Eggbert

Off-Topic Discussions / Inspiration for music?
I would like to write my own music for games, but a lot of my stuff tends to be somewhat derivative (i.e. using some other song as a base). Where do you usually draw inspiration or get ideas for your music? I know people often say that nothing is truly original (or something like that), but I would like to work on being having more originality without sounding generic or boring.
Libraries / Personlib 1.0
I finally got around to completing my Personlib library that I mentioned a while ago. The syntax is almost identical to the Sphere 1.x, with some changes to account for miniSphere's differences. It also makes good use of miniSphere's threading capabilities, and adds some convenience functions of its own. For example:

Code: (js) [Select]
// Cellscript.mjs 
transpile('@/lib', files('lib/personlib.mjs'));

// main.mjs
import { Person } from "personlib";

var player = new Person("player","player.rss",false); // same arguments as CreatePerson
player.customUpdate = function() {
    var adjacent = this.getAdjacentObstructions(5); // where 5 is the offset in pixels
    var rand_r = Math.floor((Math.random() * 255));
    var rand_g = Math.floor((Math.random() * 255));
    var rand_b = Math.floor((Math.random() * 255));
    var rand_a = Math.floor((Math.random() * 255));
    this.setMask(new Color(rand_r, rand_g, rand_b, rand_a)); // setMask detects if the parameter is a miniSphere color object or a 1.x color object, and getMask allows you specify which one you want
    if(adjacent.north.tile > -1 || adjacent.north.person != "") Sphere.abort(" You are ded. RIP in pieces.");
    else this.queueCommand(COMMAND_MOVE_NORTH, true);
return true;
Since thread.create requires an update function and a render function, the Person object's update and render functions just call customUpdate and customRender respectively and return whatever customUpdate/customRender returns.
Most of the object methods are just call the legacy function given the appropriate arguments, so if you run into issues, there's a decent chance that it's miniSphere's fault. If you suspect that isn't the case or you have some suggestions, let me know.
I'm going to be visiting family in Europe for a little while, so if you don't hear from me (updates and such) that's why. See you in ten days!
Last night I came up with an idea for a game heavily based on later versions of Bomberman, with some improvements/additions, but restricting myself to using only black and white (no colors or shades of grey) which creates a deliberate challenge of making realistic shading. I tried this a while ago with a different game, but it never really went anywhere.
In the attached screenshot, the left half shows solid black floor tiles, and the right half shows checkered tiles. Which one do you prefer? On one hand, the checkered tiles make bomb sprites stand out more than on black sprites, but on the other, the checkered tiles might cause eye strain.
If I have a person (16x16 px) in a map (16x16 px tiles) touching but not overlapping a wall, GetObstructingTile returns > -1 when it seems like it should be returning -1. Is there a better way to detect if the person would actually be able to move to the given coordinates regardless whether it's touching something or not?
In the attached picture, the person spawns at 1,1 and GetObstructingTile("personName",1*GetTileWidth(),1*GetTileHeight()) returns index 0 (the wall's tile index number)
I'm trying to get it so that I can play a loaded Sound file multiple times (for example, playing a bullet firing sound quickly), but calling seems to block it script execution until it finishes. Is there a way to play sound objects asynchronously?
Editor Development / QtSphere IDE (working title) 0.2.3
QtSphere IDE

(On Github)

QtSphere IDE is an alternative Sphere development environment, focused on being both powerful and cross-platformy, for those of us who use Linux/Mac/*BSD/Solaris (>implying people actually use Solaris :^)) and their respective minisphere builds but lack a proper IDE without using the 1.x editor via WINE. I don't have much experience with C++ yet, so my code may not be the best (pls no bully) but I'm fairly confident that this is going to be the real deal, the one IDE to rule them all. Eventually.

A friend of mine would like to learn to program to ideally make games. Do you guys think Sphere would make a decent starting point, or would it be unrealistic?
Off-Topic Discussions / Tiled Map Editor
For anyone interested, there's a cross-platform FOSS map editor, primarily for top down games called Tiled, which can be found here. Since Radnen's IDE can't run in Linux, I haven't used this in any projects yet (though I might use it in a SHMUP I'm using as a testbed for Personlib), but playing around with it, it's pretty neat. You could create a map with it, export it as an image, and then import it into the Sphere 1.5 editor to add collision, scripts, etc. It doesn't seem to have an individual tile editor, so you have to import one, but it can create an isometric maps, use layers with transparency, create animations, select multiple tiles and use them as a stamp (as seen in the image), and other cool stuff.

Site Comments / Woo!
 Good to see the site is back up. I was kinda worried for a little while that we were going to have a repeat of last time.
I've been working on a simple library to treat Sphere Persons as javascript objects, rather than having to interface with the map engine's functions. So for example, instead of doing

Code: (javascript) [Select]

function game() {
    // ...
    player_obstructed = IsPersonObstructed("player", GetPersonX("player"), GetPersonY("player"));
    direction = GetPersonDirection("player");
    QueuePersonCommand("player", COMMAND_MOVE_SOUTH, true);

etc, which can be rather tedious after a while, you would instead do (as it is now)

Code: (javascript) [Select]

var player;
function game() {
    player = new Person ("player","player.rss",destroy_with_map);
    // ...
    player_obstructed = player.isObstructed(player.x,player.y);
    direction = player.getDirection();

And so on and so forth. This would also make it simpler to create custom update/render functions  and custom properties per-person by doing person_object.update = function() {} as desired
Instead of using GetPersonList, you would just reference the persons[] array.

Do you think this is a good way of doing things? Would the new minisphere API benefit from using this method as opposed to the old way? I'd post this in minisphere's engine update thread, but I wanted to make this thread to ask for your guys' opinions on this method in general.
Projects / Sphere 6502 emulator
I'm working on porting an emulator of the ancient (relatively speaking) 6502 processor from to run in Sphere. Getting it to draw as it would on the site (without having to worry about flipping buffers) has been a bit of a chore, but I got it mostly working, but I've noticed that it's significantly slower than the website, both compiling and drawing. Because of the upscale and the way it draws to the screen (coloring individual pixels for each draw), I've had to create <scale_width> by <scale_height> surfaces for each pixel and then fill it with a rectangle (surface_obj.rectangle(0,0,fullwidth,fullheight,color). The issue of slow compilation shouldn't (hopefully) be too much of an issue to look into, but do you have any advice for improving drawing? How does Duktape's spead compare with browsers, or could it just be an issue of having to optimize the site's code to work well with minisphere?

EDIT: wow, I just checked, and both the 1.5 and 1.6 engines perform far better than minisphere. Could this be an issue with minisphere's javascript engine, or would you like me to upload the game folder (please don't look at the source, it's incredibly hacky and I'm not proud of it) and have someone here try it in Windows?
Sphere Support / Resizing a map via scripting?
Would it be possible to resize the width/height current map in-game, short of manually modifying the file and reloading?
I have an idea for a game that requires the map to be able to grow, and it wouldn't work (as well) if I just went with a very large map instead.
I used to dislike the fact that there were multiple forks of the original engine, but now I don't think it's such a bad idea. Originally, there was just one Sphere, the main engine, from its origin to its stagnation at v1.5. Now there's TurboSphere, miniSphere, Sphere 2.0, the beta of Sphere 1.6 (which from what I understand has ceased development?), Sphere SFML, and at one point, JavaSphere and web-sphere.

So it seems now that rather than Sphere being one engine, it has turned into a standard. Like HTML, with multiple browsers and their goal at being compatible via different methods.
What do you guys think?
Off-Topic Discussions / Windows 10
Anyone else here upgrading to Windows 10? What are your thoughts?
cmd.exe finally dropped the max width! And they fixed the issues with some old games (Like RPG Maker 2k/3 ones) having choppy full screen animation.
I'm still waiting for a tabbed Explorer, though.