Math and Logic in Ygdrasil

Ygdrasil is primarily a scene description language, not a procedural programming language. The building blocks in Ygdrasil are only nodes, messages, and events. It's very easy to describe arrangements of objects, sequences of events, and user interactions, but what about things like variables, functions, if/else statements, loops, and all the other standard components of a programming or scripting language? In Ygdrasil, all of these concepts are in fact still expressed through nodes, events, and messages. The logic of this system can be confusing at first, particularly for anyone accustomed to other procedural programming languages. While some ideas which are trivial in a language like C++ or Lingo are awkward or complicated in Ygdrasil, many of these concepts can be expressed in surprisingly elegant (though often non-intuitive) ways.

Let's consider a few common types of concepts or problems one might encounter. Some of these might seem bizarre, artificial, or arbitrary, but demonstrate fundamental concepts in building more complex interactions and logical systems.

These few examples illustrate some fundamental concepts in building more complex worlds. Here is the progression of worlds we've seen so far: (1) static environments, (2) scripted animation or motion, and (3) interaction through triggers, where one action causes one particular response. The next level of complexity involves entities which can have variation in their behavior or response, user interactions which are a series of actions rather than a single one, entities which will behave or react differently depending on conditions in their environment, entities which can have multiple states which determine how they behave or what interactions they can have. We're not talking about really complex things here, about A-Life, A.I., nonlinear dynamics, flocking and swarming algorithms, automated path-finding, fuzzy logic, simulated emotional states, data visualizations, rigid-body dynamics, or even throwing a ball against a wall. All of that comes later; but even these basic, fundamental programming concepts will add a rich array of possibilities, complexity, and subtlety to your virtual worlds.
(c) Ben Chang