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 - Radnen

1
Engine Development / Re: Oozaru: Sphere for the Web
I have been playing a game called CrossCode lately and it's clearly HTML5 based engine, but they had console releases, which gives me hope on Oozaru... I might think about using Sphere again. I was toying around with Game Maker, but I think it may be easier to build the game in Sphere? How's the performance?
2
Engine Development / Re: miniSphere 5.5.0
miniSphere is Sphere now. Good job Fat Cerberus! Congrats on the v5.5.0 release. :)
3
Off-Topic Discussions / Re: Happy new year everyone!
Happy new year, all. It's been well over a decade now w/ this community, and even longer for others too! :)
4
Hellos and Byes / Re: My return
Hello Datomas! I think I remembered someone like you... The community is fairly active on Discord. https://discord.gg/ApNjK5
5
Libraries / Re: EventEmitter for miniSphere
I like this idea, it's great on turn based tactic style games, and other event driven behaviors.
6
Engine Development / Re: Tileset won't update...
Since it's minisphere; it's likely an issue with Cell, the game 'compiler' system, which is supposed to compile your assets into a distribution folder for release. In this case the 'dist' folder has an outdated tileset.
7
Programming / Re: So I wrote a monad tutorial...
@FatCerberus: I think you just nailed it with that post, bud. :) That's indeed the simplest explanation yet. I was looking for a simple overview, like an "all-together", and what you just wrote, is it.
8
Programming / Re: So I wrote a monad tutorial...
I'm only loosely aware of monads and in theory know what they are. Like I knew that a JS Promise is a monad-like structure, but not exactly as to why.

I'd say I understand Monads a bit better from an imperative context, but I also think your tutorial isn't necessarily the easiest to understand. I think if one has a lot of programming experience, one can follow along, but at the very end of the day monads are complex, and must take a complex chain of thought to understand. And, if anything, actually making a monad and playing around with them interactively is the best way to learn.

But as for me, I will definitely say I came out learning a lot more about them. So, I do think it's effective for more seasoned programmers, Does it break the curse? I dunno, but I'm sure you'll find out someday!
9
This is looking really sweet and I"m very happy to see how far Sphere has come with it's new JS and graphics engines. Keep it up! I might even get back into game dev with Sphere again. My girlfriend wants to work on a game with me, haha.
10
Hellos and Byes / Re: Happy 2019!
Hi FBNil! Long time no see! I hope you have a fantabulous 2019 too! :)
11
I'm still baffled the widespread popularity of lodash... when libraries you and I write can be an order of magnitude faster, and any missing convenience methods lodash has, can always be added.

Anyways, I didn't have from.js on me, but I ran your parameters on my new Linkier library along with lazy and Link and got:
Code: ('js') [Select]
const Linkier = require('./linkier.js');
const Link = require('./modules/link.js');
const Lazy = require('./modules/lazy.js');
const Benchmark = require('benchmark');

// Generate a random list of 100,000 integer between 0 and 1,000.
const items = [];
for (let i = 0; i < 100000; ++i) {
    items[i] = Math.floor(Math.random() * 1001);
}

const suite = new Benchmark.Suite;
const linkier = Linkier(items).filter(n => n % 2 === 0).take(10000).map(n => n + 1);
const link = Link(items).filter(n => n % 2 === 0).take(10000).map(n => n + 1);
const lazy = Lazy(items).filter(n => n % 2 === 0).take(10000).map(n => n + 1);

suite.add('Linkier', function() {
    linkier.reduce((a, n) => a + n, 0);
}).add('Link', function() {
    link.reduce((a, n) => a + n, 0);
}).add('Lazy', function() {
    lazy.reduce((a, n) => a + n, 0);
}).add('For Loop', function() {
    let n = 0;
    let r = 0;
    for (let i = 0; i < items.length; ++i) {
        if (items[i] % 2 === 0) {
            n++;
            if (n <= 10000) {
                const m = items[i] + 1;
                r = r + m;
            }
        }
    }
}).add('For Loop 2', function() {
    let n = 0;
    let r = 0;
    for (let i = 0; i < items.length; ++i) {
        if (items[i] % 2 === 0) {
            n++;
            if (n <= 10000) {
                const m = items[i] + 1;
                r = r + m;
            } else {
                break;
            }
        }
    }
}).on('cycle', (event) => {
    console.log(String(event.target));
}).on('complete', function() {
    console.log('Fastest is: ' + this.filter('fastest').map('name'));
}).run({ async: true });

Code: [Select]
Linkier x 4,242 ops/sec ±5.49% (78 runs sampled)
Link x 3,786 ops/sec ±2.13% (91 runs sampled)
Lazy x 2,917 ops/sec ±2.87% (91 runs sampled)
For Loop x 2,213 ops/sec ±2.01% (96 runs sampled)
For Loop 2 x 11,052 ops/sec ±1.52% (97 runs sampled)
Fastest is: For Loop 2

What we learn here, is that hand-writing a for loop can be slower... The first for loop doesn't short circuit after 10,000 items, but that's on intention. How many times in writing a for loop you think of doing that? Therefore from.js, link.js and other libraries are going to be faster since they can make those common-sense decisions for you, and just automatically make your code faster.
12
Spherical News / Re: Forum updates thread
I really like the theme going on. It's easy on the eyes and says "Sphere". Thanks!
13
Same with Fat Cerberus. I didn't know Ctrl+PageUp/PageDown was a thing! I just tried in Chrome and it worked. Guess you learn something new every day.

I do use Shift+Insert to paste all the time, however. On a nice full keyboard, at least, it feels nicer with just the right hand.
14
  • Dispatch.onExit: Run some code on shutdown, after the event loop terminates.  This works even if the user manually closes the window!

I like this. This prevented me from writing a clean MMO in Sphere back in the day. I had to 'poll' every user to see if they were actually logged in or not every like 5 minutes. Good times, hahaha,
15
Since QSI won't have a source editor, I'm going to work on a Visual Studio Code extension for miniSphere API completion/documentation and possibly for interfacing with SSj.

I like this Visual Studio Code idea!