sphere

Chad Austin's 10 Pitfalls of Dirty Code

tung's picture

I recently bumped into a programming-related blog entry by Chad Austin, father of Sphere and a member of the IMVU team. Entitled 10 Pitfalls of Dirty Code, it first lists the ways code can turn sour:

  • unclear or too many responsibilities,
  • overly complicated or obscure control flow,
  • concepts that don't map to the domain,
  • too many dependencies,
  • global state,
  • or duplicated logic.

Then he goes on to list how bad code can bite you back:

Read more »

Illuminating the stack backtrace, just a little

tung's picture

The following is lifted from a post I made over at the Spherical forums, about reading a backtrace to do something other than panic and tear out hair.

There was a problem with trying out the zlib routines on Linux, but I fixed them, and here's how.

I added sfxr.cpp and ssfxr.cpp to the engine's SConscript, and zlibengn.cpp to common's SConscript. That got it to build under Linux with scons.

Attempting to run engine with DeflateFile() got me a long message, including this stack trace.

======= Backtrace: =========
/lib/libc.so.6[0xa7bd6ee4]
/lib/libc.so.6(cfree+0x9c)[0xa7bd87bc]
/usr/lib/libstdc++.so.6(_ZdlPv+0x21)[0xa7d9e971]
./engine[0x80cea6d]
./engine[0x80d07bd]
/usr/lib/libjs.so(js_Invoke+0xa92)[0xa7f6c33f]
/usr/lib/libjs.so(js_Interpret+0x7184)[0xa7f7390c]
/usr/lib/libjs.so(js_Execute+0x2f6)[0xa7f796d9]
/usr/lib/libjs.so(JS_EvaluateUCScriptForPrincipals+0x90)[0xa7f40a37]
/usr/lib/libjs.so(JS_EvaluateUCScript+0x43)[0xa7f40abc]
/usr/lib/libjs.so(JS_EvaluateScript+0x68)[0xa7f43785]
./engine[0x80bae4c]
./engine[0x8053b9f]
./engine[0x80e04aa]
./engine[0x80e09c6]
./engine[0x80e0d1a]
./engine[0x812b905]
/lib/libc.so.6(__libc_start_main+0xe5)[0xa7b816c5]
./engine[0x804d4f1]
Read more »

A rush of blood to the Sphere project

tung's picture

This is me, on the Sphere forums, January 31 2009:

[Sphere is] basically a software engineer's nightmare.

I wish I could share your bright-eyed optimism, but with the amount of effort required to understand, modernise and lead the project in new directions, it'd be much easier to start from scratch and make a new project with similar goals, which would have the added benefit of using up-to-date technologies and simpler project management.

This is me, on the same forums, February 25 2009:

I'll try the compilation fixes that kamatsu was doing myself. When I get it working, I'll put it in CVS right away.

What changed?

Read more »

Denture's Revenge

tung's picture

Denture eats food while avoiding the moving brushes that threaten to clean him

Guide Denture to eat the food, but don't get cleaned!

Read more »

Job's finished

tung's picture

Well, it took a while, but I just ported all the stuff from my old website onto this one. Now I never have to to look at that eyesore of a design again. Hooray!

On a separate note, there's meant to be an articles section on this site, but I haven't written or ported any yet, so it's not there yet. I'll get around to it once I write one.

persist.js framework

tung's picture

persist.js is a framework for the Sphere RPG engine that lets you store persistent data and code with persons and maps.

Read more »

Text wrap script

tung's picture

A screenshot of the text wrapper at work

This script can wrap strings given either a character or a pixel width, breaking it into an array of lines.

Handy to side-step the issues with char-by-char word "jumping" with Sphere's text drawing functions.

Read more »

Console script

tung's picture

Console taking keyboard input

Ever wished that Sphere's graphical engine could act a bit more like the old text consoles? This may well be what you're looking for!

Read more »

Robot Forest Plus

tung's picture

A screenshot of the player gaining a level

An adaption of Flikky's compo game that adds a few fun elements.

Read more »

Flood fill

tung's picture

The flood filler in action

This is an implementation of the recursive flood fill algorithm for Sphere.

Read more »
Syndicate content