# Virtual Walls

Last time we saw that, while we can describe a maze abstractly in terms of its network of paths, we can implement a more causal (that is: physical) approach by simulating its walls. In particular, this allows us to preserve its basic physical shape, which can be of value in game or art contexts.

This time I want to talk more about virtual walls as causal objects in a maze (or any) simulation. Walls are a basic physical object (as well as a basic metaphysical concept), so naturally they are equally foundational in the abstract and virtual worlds.

And ironically, “Something there is that doesn’t love a wall.”

In the functional maze simulation a “wall” is a single datum associated with a given location in the maze. That datum just says whether a wall exists in that location (or not).

We can expand that to give a particular wall various properties, such as transparency (making it a window) or the ability to open (making it a door). We could also give it properties like thickness or strength if our simulation allowed a notion of breaking through walls.

If we imagine a game in which players have lasers, hammers, plus their own physical strength, then walls might be characterized in terms of how effective those things are. A shiny weak wall might reflect lasers but submit to physical strength. A stronger wall might require a hammer.

It all depends, and it’s a bit like that old game of rock-paper-scissors: The rules of causality in a virtual world are entirely up for grabs. You can freely create a virtual world in which paper really does beat rock.

Why? Because!

Because why? Because math!

§

In the virtual world everything is based on math.

As we saw in the functional maze, a wall can be represented by a single bit in a number, the presence of a word in a string, or some kind of variable. In all cases, a single “fact” about reality. We only care whether a wall prevents moving to the adjacent square or not.

That’s location is an abstraction limited to single grid squares and movement is square by square. The only thing that matters is whether a move to another square is legally allowed by the rules.

And those rules say we can’t move through walls.

If the game is more sophisticated, as touched on above, then each wall needs more than a single “fact” to define its properties. The game also needs more involved rules for deciding when a wall can be busted (or maybe just seen) through.

A common extension is a door — a portion of a wall that is passable when open and impassable when closed. In this case (and in the case where walls can be broken down) the wall data must be dynamic so it can reflect the current state.

This means how we represent virtual walls depends on our needs. In a simple maze we may only care that a wall exists or doesn’t. As things become more sophisticated (that is to say, more physical or life-like), the representation necessarily becomes more complex.

At the extreme, the data represents walls (and everything else) at their lowest possible level — as fundamental particles. Which is basically impossible with current technology. (Although quantum computers will allow quantum-level simulation of small bits of reality!)

Even atomic or molecular simulations of large systems (like walls) is beyond common computing ability. The best powerful computers can do today is break the wall into something like parcels — their size and detail generally correlating with the size of the wall. (A bigger wall requires bigger parcels to keep the computing requires manageable.)

§

Not bricks! (Not a wall!)

Unless the point of the simulation is to capture the detailed and accurate physics of walls, there’s no need to go down to that level.

In most games, for example, a wall can be a single object of a specified size (height, width, thickness) and having whatever properties are necessary for the game. A crucial one in some games might be what the wall looks like — it’s surface texture and color.

For example, a “brick wall” is often just a solid wall with a brick texture. There is no need to simulate the individual bricks… unless that is a factor in the game. Perhaps “bricks” can be removed to create a peephole, or maybe the wall can be broken down and the bricks used in some fashion (say as weapons or to build something).

It all depends on what’s required by your virtual reality.

Note again there is no requirement to stick to reality. Bricks can vanish if touched or turn to frogs that hop away. The numbers can do whatever we want them to do. Paper beats rock!

§ §

So if it’s all done with math, how exactly is it done?

I’ve explored the basics of how walls might be represented. Basically, a “wall” is a related data group (set of “facts”) that defines the wall’s nature. Exactly how that data is stored is an implementation detail. What matters is the facts we can obtain about the wall.

One of the more significant facts being its location in virtual space.

As we make the virtual maze more physical, one of the first changes involves the grid. To capture curved walls, or any non-regular floor plan, the grid must be much finer. Previously, we equated a grid square to being a “room” in the maze. Now each square needs to be something more like a square inch.

The actual size depends on our needs. The more precise the virtual reality needs to be, the smaller the grid squares need to be. As mentioned above, an extreme version takes us down to the size of molecules or atoms or even smaller.

Often the grid simply becomes good old X, Y, and possibly Z (if we want the vertical). Then locations — the coordinates — are real numbers. Also, objects extend over many coordinates because they have width, depth, and height.

§

Connecting lots of dots.

This makes the notion of location more complicated. A single location might define the center (or some corner) of an object, but it can’t define the boundaries. That requires multiple coordinates.

For regular objects (many walls, for instance), it suffices to provide the coordinates of the edges. As an example, any rectangular box can be defined by just its opposite corners. So just two coordinates can define the boundaries of a square beam or rectangular wall.

With more irregular objects, it takes more coordinates to define the shape. If you’ve ever seen a wire-frame rendering of 3D objects, you have some sense of how many. Each node (point where lines connect) is a coordinate. (Wire-frames are made by simply drawing lines between adjacent shape-defining coordinates.)

These coordinates tell us is where the edges or surfaces of an object are. We obviously need to know that if we’re to simulate the physics of solid objects, because (generally speaking) solid objects can’t overlap.

§ §

In light of all this, let’s consider a simple example: a wall.

Let’s say this particular wall “exists” on the X coordinates +120.0 through +145.0, and we’ll define a unit of 1.0 as one foot, so the wall is 25 feet wide. We’ll also say its on the Y coordinates +82.0 through +82.5, which makes it 6 inches thick. (The thickness will become important later!)

For simplicity, we’ll skip the vertical Z direction and stick with 2D.

Imagine we throw a ball at this wall with the goal that it bounce off the wall — a simple real-world event we’d like to simulate as reasonably accurately as possible. (Which we’ll define as realistic flight of the ball.)

Obviously we need to detect the moment of contact. What does it mean for a virtual ball to come in contact with a virtual wall?

We’re sticking with 2D, so a ball is a circle (think of it as the ball’s shadow on the floor). Circles are simple to define: they have a center-point (one coordinate) and a radius. Let’s say our ball has a radius of 0.25 (three inches).

Assuming the ball is within the X coordinates of the wall (120.0 to 145.0), then what matters is the Y coordinates (82.0 to 82.5).

§

Virtual seconds!

To know when the ball hits the wall, we need to know where its location at some prior moment and we need to know its velocity.

Which brings us to a crucial point: Our virtual reality needs a clock!

In the functional maze, movement was akin to moves or turns in most games — asynchronous.

In most games, the only dynamic is the move itself. Time essentially freezes between moves. (Such games have well-defined state tables.)

In a physical simulation, we need to simulate time in order for there to be motion and change. So the simulation itself always has a notion of what time it is and of time ticking.

Time is a fundamental property of virtual reality!

The notion of time informs the notion of velocity, which is motion of a given speed (distance divided by time) in a given direction (an X-Y vector).

So if we know the ball is at [+130, +80] and its direction takes it in the positive Y direction (without too much X direction), then it hits the wall when the center-point reaches the coordinate 81.5.

If it was on the other side, say at Y=+90 and headed “south” (in the decreasing Y direction), then it hits the wall when its center-point reaches 83.0.

§

As each moment ticks past, the system looks at the ball’s coordinates and uses its velocity to update its location.

It checks that location for a collision with the wall, meaning the center-point of the ball (plus the radius) is at — or just inside! — the wall. If so, the ball has hit the wall.

What happens next depends on the wall, the ball, and the simulation.

That “just inside” needs some unpacking. The idea of the ball’s motion as well as what happens upon collision are topics that I’ll pick up next time.

For now I’ll just re-emphasize the key point:

When “reality” is just numbers, “reality” is easy to manipulate!

In a virtual reality, paper really can beat rock.

Virtual reality is arbitrary! (Because math.)

Stay virtual, my friends!

The canonical fool on the hill watching the sunset and the rotation of the planet and thinking what he imagines are large thoughts. View all posts by Wyrd Smythe

#### 15 responses to “Virtual Walls”

• SelfAwarePatterns

When reality is just numbers, it is indeed easy to manipulate, at least if you have control of those numbers, that is, if you’re that reality’s god. If you’re just a part of it, things might appear less arbitrary. (Which reminds me of David Brin’s short story, “The Stones of Significance”.)

Of course, the mathematical universe people see everything being math all the way down. Although most of us ask, what breathes fire into the equations? But couldn’t we ask the same question for the virtual environment?

• Wyrd Smythe

“If you’re just a part of it, things might appear less arbitrary.”

Tegmarkian! Certainly if we were of the mathematics we would be bound by it. Just as we’re of the laws of physics and bound by them.

(As an aside, ever read Jack Chalker’s Well of Souls series? Doesn’t really apply, but somehow mathematical universes invoke the memory a bit.)

“But couldn’t we ask [what breathes fire into the equations] for the virtual environment?”

No doubt. What does it mean to ‘breath fire into’ an equation or VR?

• SelfAwarePatterns

Can’t say I’ve read Walker, although that series seems familiar. I must have heard about it before. Maybe from you?

What does it mean to breathe fire into the equations? I think that question is usually asking why all these mathematics aren’t just some abstract objects floating in platonic space. Why do things actually happen according to the equations?

Of course, the Tegmarkians say that’s actually all there is, and things happening is just part of the overall mathematical structure.

Personally, I’m not a Tegmarkian. I think physics are the primary reality, not mathematics. The math is just a tool, a description of the stuff that actually provides the dynamics.

• Wyrd Smythe

“Why do things actually happen according to the equations?”

Oh, yeah, that’s certainly a classic question.

(I’ve had a note on my post idea board for years now: “Reals are Platonic. Naturals are Aristotelian.” The problem I have with writing a post is that, as seems true with you, I’m kinda right on the 50/50 line there and keep changing my mind about it. Sort of the equivalent of “bobble” in analog-to-digital conversion.)

“Personally, I’m not a Tegmarkian.”

Nor am I.

(I file it under “Things That Almost Certainly Aren’t True” although it can be hard to justify exactly why. For me it has to do with time and dynamics.)

Which is all neither here nor there in terms of the post. Getting back on track:

“But couldn’t we ask [what breathes fire into the equations] for the virtual environment?”

So what would that entail? What question are we asking of VR?

• SelfAwarePatterns

In the case of VR, it seems like we know the answer: the physical computational system. The mathematics have no power without it.

In the case of reality overall? If mathematics do ultimately describe everything, then reality itself might be a giant computational system.

• Wyrd Smythe

“In the case of VR, it seems like we know the answer: the physical computational system. The mathematics have no power without it.”

If you’re saying the VR has to be executed in order to be experienced, absolutely, goes without saying. Software isn’t very effective when it’s still in the shrink wrap!

I would quibble over the mathematics involved being powerless, though. Even in the shrink wrap, the math used to define the software still orders the bits in a specific pattern (that would be effective if executed on the right engine).

Think of it, perhaps, as DNA or a blueprint for a house. Neither of those are effective until a physical instance is produced from them, but the plans they encode mathematically are potentially effective (compared to random data, say).

“If mathematics do ultimately describe everything, then reality itself might be a giant computational system.”

In a way, I kind of think it is and that mathematics does describe (just about) everything, but that turns on my view of what it means to “describe” something (opposed to “define” it). The way I look at it, a parabola describes ballistic movement, but it’s physics that defines that behavior.

And, in some sense, reality is using physics to “calculate” its next state, so it’s a “computation” in that (very broad) sense.

• Wyrd Smythe

We were talking about the concept of “now” a while back. One might define “now” as the point in the universe’s computation that it’s gotten to so far. It has already calculated the past, and has yet to get to the future.

(That whole need to compute what comes next is my central objection to the idea of a block universe. When was the universe’s structure calculated? And by what, since apparently not by the universe itself?)

• SelfAwarePatterns

On the power of software, DNA, and blueprints, my way of thinking about it is that these patterns have potential power due to their causal history. It’s that causal history, along with the causal history of the systems using them, that allow a pairing to combine into an effect mechanism.

On “now”, I think a block universe proponent might say that the computation is only relative to where we are in the overall structure, that when looking at the universe as a whole, there is no computation, just a timeless structure. But I agree that the urge ask about the origin of the structure is overwhelming. And simply being told “it’s timeless and eternal” isn’t very satisfying.

But as we’ve discussed before, cosmology always seems to bring us to an absurd condition.

• Wyrd Smythe

“…these patterns have potential power due to their causal history.”

Sure, that accounts for how they came to be and for what they refer to.

My point is just that those patterns encode all that.

“I think a block universe proponent might say that the computation is only relative to where we are in the overall structure”

But what’s doing the computing? In the “normal” view, reality itself does. In the block view, it can’t, because it already exists.

And, yeah, all cosmology is ultimately absurd. It boils down to which absurdity one can live with. 🙂

• SelfAwarePatterns

Within the block universe, the universe itself could be doing the computation. The computation would itself be a part and parcel of the overall block structure. Put another way, in the block universe, every computation exists along the timeline.

As I’ve said before, I’m open to the possibility of the block universe, but in and of itself, it doesn’t seem all that interesting. It doesn’t seem like anything we could ever test, and we, as patterns within the structure, can’t ever really take the block universe perspective since, for us, any perspective involves time.

• Wyrd Smythe

But isn’t part of the deal with a Block Universe that nothing happens? A computation seems like something happening, so I don’t see how the BU does it (or what it does it with).

(If we want to get into the Block Universe, we might want to jump back to my post about it?)

• SelfAwarePatterns

Actually, this response kind of ties in with our recent conversations.

So, when talking about nothing happening with the block universe, that statement would only be true when looking at the universe as a whole, that is, at the level or organization that includes the whole universe, including all of time. From that viewpoint, the computation exists, but it’s a static thing stretched along the entire timeline.

But from within the universe, embedded at a point along the timeline, things do happen, there is dynamism, including computation. As patterns embedded in the structure, we can’t take the perspective of the whole universe anyway, not really. We can imagine it, but it’s not anything we could ever experience, since experience itself requires time.

The usual metaphor (although flawed) to explain this is a picture book. The entire story already exists throughout the book. But if we’re a character in the book at the end of Act 1, it doesn’t feel like the whole thing is already laid out. It feels like things are happening dynamically. (I said “flawed” because I know you’re going to bring up the reader. That’s where the metaphor fails. With the block universe, there is no reader. (Well, unless God is there, or we’re in a simulation and the simulation owner is watching.))

But something to wrap your brain around, is that both the model of the block universe, and the model of a dynamic flowing universe, can be true, from particular vantage points and at particular scopes and levels of organization.

• Wyrd Smythe

I understand the BU and agree with everything you said there. My question remains. In the context of your metaphor: Who wrote and printed the storybook? Where did all that structure, which involves all that calculation, come from?

The storybook is a fait accompli to the characters, but who (or what) wrote the story?

Regarding the “now,” as you say, that’s the “reader” which seems to show the secondary flaw in the whole idea: what accounts for the reader?

So this storybook BU needs both a writer and a reader, and it accounts for neither. Which is fine if one’s belief entails that all that just is, but it doesn’t work for me.

(And, the point of that previous post, to the extent the BU is implied (let alone required) by Special Relativity, I think that’s just plain false. Possibly even contrary to SR. Which seems to pull the rug out from under the main reason people say they are into the BU idea.)

• SelfAwarePatterns

I can take or leave the BU. It seems like untestable metaphysics. I don’t remember your argument about SR, but SR usually is cited as one of the chief inspirations of the BU.

One big issue I see with the BU, is that the language used to describe it is often not carefully thought through, talking about everything throughout time happening “right now”, such as saying Caesar is alive “right now” somewhere in spacetime. To me, that is confusing the various levels of organization. Even Brian Greene, when he describes the concept in ‘The Fabric of the Cosmos’, falls into that mode.

• Wyrd Smythe

“SR usually is cited as one of the chief inspirations of the BU.”

Right. And since I think that argument is wrong (as explained in that post), the BU doesn’t have any real support in my eyes.

“…talking about everything throughout time happening ‘right now’, such as saying Caesar is alive “right now” somewhere in spacetime.”

Yeah, that doesn’t make sense to me, either. (It does remind me a little of how some SF authors have their time travel characters complaining about the difficulty of tenses with time travel.)