| 
  • If you are citizen of an European Union member nation, you may not use this service unless you are at least 16 years old.

  • You already know Dokkio is an AI-powered assistant to organize & manage your digital files & messages. Very soon, Dokkio will support Outlook as well as One Drive. Check it out today!

View
 

BNumbers and UNumbers

Page history last edited by Bill Maya 14 years, 10 months ago

Storytronics uses a special kind of numbers called Bounded Numbers. BNumbers save you a lot of trouble when you're Scripting, but they take some getting used to. Let's examine why they're so useful.

 

Bounded Sum

 

As explained in the Actor section, an Actor Trait can be anything between -1 and +1, not including. This helps keep things in balance, but it might lead to problems. For example, suppose Joe's Sad_Joyful is currently 0.6. What would happen if you increased it by 0.6? That would make 1.2, which is greater than the maximum allowed. Now, a computer is not a flexible creature - it must have maximum limits on everything, and when these are exceeded, it crashes. This causes a great deal of trouble for programmers, but storyworld authors don't have to worry about it - BNumbers obviate this problem. No matter what you do to them, they can never go out of bounds. Returning to our example, in the BNumber world the calculation would go like this:

 

 0.6 + 0.6 = 0.75

 

I hear you say: “HUH?! That doesn't make any kind of sense! The value should have doubled - instead it increased by only 25%!” But I assure you, it did double. In the BNumber world, 0.75 really is twice as large as 0.6. This is because, as a BNumber gets bigger, it starts getting condensed. This concept is a little tricky, so let's explore it using a topic we all know: kisses. Specifically, the memory thereof.

 

Like many people, I have a strong recollection of my first romantic kisses. The very first one, of course, is an overpowering memory. The next few kisses are also powerful memories, and at the time I could and did keep a running tally. As that grew, however, I started losing interest in exactly how many times I'd kissed. Today, looking back, I remember few individual kisses apart from the early ones - the rest have become a blur, a general feeling of “kissitude” that accompanies my romantic memories. In other words, they have become condensed.

 

But what was it that set my early kisses apart? Simply that they were the first. They had the strongest impact on me because I had no prior kissitude that they could blend with. Let's try to express this with BNumbers. We'll set a basic unit of kiss measurement: “k.” We'll define 0.1k as the amount of kissitude generated by my very first kiss. Here's what it did to my kissitude:

 

0.0k + 0.1k = 0.1k

 

Now came my second kiss. It was just as intense as my first kiss, so it was also worth 0.1k. But its impact was, say, 20% less than the first one, simply because I had already kissed before. In other words:

 

0.1k + 0.1k = 0.18k

 

Now came my third kiss. It still packed a punch, but as I was more experienced it affected me less than the previous two. In numbers:

 

0.18k + 0.1k = 0.25k

 

So I had three kisses of equal intensity: 0.1k. The first of these increased my kissitude by an actual 0.1. The second increased it by 0.08. The third increased it by 0.07. Each subsequent kiss would have less and less effect on my kissitude. This is summarized in the following table.

 

Kiss # Total Kissitude Change From Last Kiss
0 0.0 N/A
1 0.1 +0.1
2 0.18 +0.08
3 0.25 +0.07
4 0.31 +0.06
5 0.36 +0.05
6 0.4 +0.04

 

 

 

 

 

 

 

 

 

 

 

Here, again, we see the phenomenon we saw above. My first three kisses raised my kissitude to 0.25. I had another three kisses, which raised it to 0.4. So 0.4 represents twice as many kisses as 0.25. But it represents a different kind of kisses - ones where I had prior experience. Ones which have been condensed. In other words, as I grow more experienced, my kissitude becomes less malleable. It took a standard 0.1k kiss to raise my kissitude from 0 to 0.1; it took two such kisses to raise it from 0.31 to 0.4. It would take even more to raise it from 0.4 to 0.5.

 

Bounded Difference

 

Now to add some negativity to this discussion. BDifference is how you subtract one BNumber from another, and it's really quite similar to BSum. To see how it works, let's imagine for a moment that I were abducted by aliens. Let's further imagine that, for their own inscrutable purpose, they began removing my past kisses from my memory, starting from the latest and going back to the very first one. In other words, they subtracted six kisses from my memory, each worth 0.1k. This process would be a mirror image of the process for BSum described above, as shown in this table:

 

Kiss # Total Kissitutde Change From Last Kiss
6 0.4 N/A
5 0.36 -0.04
4 0.31 -0.05
3 0.25 -0.06
2 0.18 -0.07
1 0.1 -0.08
0 0 -0.1

 

 

 

 

 

 

 

 

 

 

 

Now, what if they wanted to reduce my kissitude to -0.4? Easy! They would use BDifference to subtract six more 0.1k kisses from my memory (their alien minds would be oblivious to the fact that I couldn't possibly have had less than zero kisses). This process would be almost identical to the one for BSum:

 

Kiss # Total Kissitude Change From Last Kiss
0 0.0 N/A
-1 -0.1 -0.1
-2 -0.18 -0.08
-3 -0.25 -0.07
-4 -0.31 -0.06
-5 -0.36 -0.05
-6 -0.4 -0.04

 

 

 

 

 

 

 

 

 

 

 

Lastly, they might take pity on me and restore my original memories. To achieve this, they would have to add twelve 0.1k kisses to my memory - six to counteract the “unkisses” they had installed, and six more to compensate for the six they had removed. This process would be a reversal of the “unkiss” installation described above, followed by the original BSum process which gave me my natural memories. Here's a table to sum it up:

 

Kiss # Total Kissitude Change From Last Kiss
0 -0.4 N/A
1 -0.36 +0.04
2 -0.31 +0.05
3 -0.25 +0.06
4 -0.18 +0.07
5 -0.1 +0.08
6 0.0 +0.1
7 0.1 +0.1
8 0.18 +0.08
9 0.25 +0.07
10 0.31 +0.06
11 0.36 +0.05
12 0.4 +0.04

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Next: Bounded Multiplication

Previous: Script Types

 

Comments (0)

You don't have permission to comment on this page.