Learning BYOND, Day 1: Little Digital Souls

Contrary to my previous entry, I’m not finding BYOND to be the mind-reading device I was hoping it was. Instead, I’m wrapping my head around how to code my creation. This is not just that dinky script modification stuff I was doing in Neverwinter Nights 2 or Elder Scrolls IV: Oblivion, but rather defining a completely event-driven game already running within the generous framework provided.

Pouring over manuals and tutorials reveals that reading about it is one thing, actually doing it requires more than a skim. Several dendrites have died needlessly, however, progress has been made. I don’t have much to say about today’s progress, so this will be a short entry. However, I will leave this hard-earned gem:

I thought I knew was Object Oriented programming was, having dabbled with Java a bit in the past. However, I was mistaken, and at least part of my mind was still mired in the procedural past. Unlike Java (a completely object oriented language), BYOND offers no point in which the program starts; there’s no main() starting function. Instead, the starting point is the BYOND game interpreter itself, and what the would-be BYOND designer is given is an entirely event-driven model.

Nothing in BYOND happens unless an event sets it in motion: the server reboots, a player logs in, a tree falls in the forest (and the server was there to hear it). The event triggers a whole newly spawned process, running on its own independent thread, until it is completed. Behind the scenes, only one thing may be happening at a time due to the limitations of the hardware. However, to perception of the players and the BYOND programmer, there’s several things running at once at all times.

It makes sense. After all, BYOND was made to simulate virtual worlds. Each active PC and NPC needs no less than their own little digital soul or else the virtual reality fails to acknowledge them when the time is right. Trees won’t fall in the forest if the universe is too busy doing something else to enact gravity, so they need their own slice of time (preferably immediately after the axe has finished its work). And so on.

Suffice to say, it’s been a mind-expanding experience. I’ve never worked on software that worked quite this way before, and it’s taking some adjustment. However, like learning music, mathematics, or (most appropriately) a foreign language, anything worth learning can be learned in persistence. (Unless you die trying, of course. Pacing is important!)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: