32
$\begingroup$

So it turns out the universe is a computer. Or at-least that is how it can be analogized to our puny mortal minds.

Human souls/consciousness are simultaneously the equivalent of emergent AI, players, and the dissociated fragments of the universe's creator depending on what theological interpretation you subscribe to.

Some souls, via lots of hard thinking and calculation, can start to notice this and can add some of their own code to make things interesting.

It's a fairly popular set up, and the topic of a magic system based off of mathematics and computer science is something I've read extensively about on this site.

However one issue with this set up and analogy is that it usually runs on an ad-hoc limiter. Mana or some kind of FP bar. A limited resource, typically sourced from a living thing or 'soul', that in order to run a spell, has to be expended.

But that's never entirely sat right with me. When I played minecraft as a kid, there were artificial limitations imposed on my resources. But I could also easily mod the game or just use command lines to move super fast, fly, alter the weather, daytime, or create new resources ex nihilo.

There technically shouldn't be a limit to how many spells can be spammed. Wizards could spew as many fireballs as they want. As the fireball spell already sticks a middle finger to thermodynamics. There's plenty of energy to go round afterall.

So if the universe is a computer, magic is programming, what exactly is mana supposed to be? Why do my metaphysical script-kiddies tire out after the tenth fireball?

$\endgroup$
14
  • 41
    $\begingroup$ If my experience in programming is anything to go by, the answer is coffee. $\endgroup$
    – biziclop
    Jul 6, 2023 at 12:05
  • 16
    $\begingroup$ It could be cool if overusing the compute power causes local lag. Surprise, Einstein didn't discover time dilation, he discovered FPS drop. $\endgroup$
    – Drake P
    Jul 6, 2023 at 12:42
  • 3
    $\begingroup$ In Eragon they "program" the spells so that there are backstops, otherwise the spell will use up all available resources including all the lifeforce of the caster. This leads to two resource scarcities: available force and the time it takes to cast a spell that is specific enough, it could be minutes or hours of incantation depending on the spell. $\endgroup$ Jul 6, 2023 at 13:41
  • 1
    $\begingroup$ And Black holes are like Bugs or glitches caused when Stars exploded so much that they crashed a specific part of the universe =) (Not the whole tho) $\endgroup$
    – Alastor
    Jul 6, 2023 at 14:19
  • 1
    $\begingroup$ In the Laundry Files it’s less about a limit on the amount of mana, and more about preserving your mental powers so you’re not casting while fatigued because creating a bug in reality opens the gateway for eldritch horrors to enter the world and consume your processor (I.e. brain) $\endgroup$
    – Dugan
    Jul 6, 2023 at 15:01

23 Answers 23

54
$\begingroup$

In this cosmology, envisioning mana as akin to the computational resources - CPU time, RAM, or other crucial system components - that a sentient program or a fragment of the universe's architect can leverage provides an apt analogy. This analogy becomes particularly pertinent given that these resources are finite.

If a program could monopolize all available system resources, much like an infinite loop scenario, it could trigger system instability or a potential collapse of the universe, our cosmic "computer". Thus, there is a critical need for resource allocation boundaries for each sentient program or soul to maintain universal stability.

Mana is the term we're using for these allocated resources. When a program exhausts its mana allotment, it must endure a mandatory latency period for resource replenishment. This regulation safeguards the universe while also providing a strategic and endurance test for the sentient programs.

Using mana as a metaphor for system resources brings a unique equilibrium to the power dynamics of the sentient programs. It prevents any one program from becoming overwhelmingly dominant and potentially threatening the stability of the universe. It also tests the strategic acumen and resilience of these programs, forcing them to intelligently manage their mana to strike a balance between their will to manipulate their surroundings and the risk of resource depletion.

The depletion of mana could lead to the sentient programs experiencing significant physical and psychological strain - much like a computer experiencing a system crash due to resource overload. This is because, when a program's mana is nearly depleted, the program starts utilizing its own physical and mental matrix as a substitute for mana, a mechanism reminiscent of the body consuming itself during starvation.

Each spell cast, each fireball thrown, is a line of code, a command that drains a program's mana. If a program does not manage its resources effectively, it runs the risk of burning out or falling into a state of temporary magical impotence due to extreme fatigue. This level of realism in the mana system introduces a challenging dynamic into the practice of magic, echoing the real-world limitations and challenges in computing and programming.

$\endgroup$
21
  • 26
    $\begingroup$ Story idea based on your answer: Some villain seems to be unlimited in "mana" but later it turns out that he was able to set his process priority to "system level" and he is not using the ressources of normal people but of the system level causing for example physics to crash when he casts a lot of spells. Suddenly gravity doesnt work anymore because the system is busy handeling his spells instead of calculating gravity forces. $\endgroup$
    – datacube
    Jul 6, 2023 at 7:05
  • 3
    $\begingroup$ To add to it, everyone can have a certain amount if resources allocated. If you are nearing 80% RAM you can already experience very significant performance problems that cannot be solved easily. Using magic more sparingly can then lead to more and better magic overall, as the RAM is better organised and less full. $\endgroup$
    – Trioxidane
    Jul 6, 2023 at 7:21
  • 1
    $\begingroup$ Your idea is nice in theory, but the analogy falls short. If someone casts a fireball a lot of resources are allocated because a lot of thermal energy should be released, but as soon as the "boom" is over the resources are freed again because the universe returns to its default state. The damage remains, but the next fireball can be cast almost immediately. Longer-lasting effects like a "curse" or telekinesis would hit a resource limit, but quick spells with a short duration of the actual magic effect would need a longer lasting limit. $\endgroup$
    – Elmy
    Jul 6, 2023 at 9:01
  • 2
    $\begingroup$ Doesn't this have the problem that some ultra destructive things are computationally simple; for example set gravitational constant to infinity across the entire universe. $\endgroup$ Jul 6, 2023 at 12:03
  • 5
    $\begingroup$ @RichardTingle changing a universal constant would include a complete recalulation of the whole universe. Only the admin (the creator residing outside the simulation) has access to so many resources. $\endgroup$
    – datacube
    Jul 6, 2023 at 12:35
25
$\begingroup$

Every computer should have an antivirus. Programs or systems looking for anomalies, anything that doesn't follow the the code (natural laws of nature), and deletes it.

So mana in this case would not be a hardcap, a fixed upper limit for what you could do. But a limit for how much alteration you could do before Mr. Smith (Matrix reference) comes looking for you.

Such a cap would be the same for everyone, though it might differ depending on location. But some people might be able to use it in a clever way. For instance if you create a large fireball, that's a large anomaly. But if you crack a gaspipe running under the street and ignite it, it's still a large explosion, but a much smaller alteration to the natural laws.

$\endgroup$
8
  • 2
    $\begingroup$ I like the threatening nature of this mechanism. Using magic is always dangerous, you could always be detected and sanctionized by the antivirus. Using too much mana might not inevitably lead to you being detected, but significantly increases the risk. There might be a lot of creative ways to trick the system and increase ones mana. $\endgroup$ Jul 6, 2023 at 8:49
  • 3
    $\begingroup$ I like this, partly because it explains where the higher mana pools of top mages come from - they learn how to push the limits. When you're starting, if you push the limits, you die $\endgroup$
    – lupe
    Jul 6, 2023 at 10:05
  • 1
    $\begingroup$ If it's a sort of agent that looks for improbable events, you also have a good mechanism for them working. It's not impossible that the right atoms collide in the right way and a jet of plasma shoots out of your hands, but it's super unlikely. So the universe is constantly monitored for wierd pockets of improbability, and excises them from existence. Do too much magic, and you vanish. Push the limits far too much and the universe neatly chops out the street you're on. $\endgroup$
    – lupe
    Jul 6, 2023 at 10:08
  • 1
    $\begingroup$ @biziclop - I was kind of inching towards that as a suggestion :P $\endgroup$
    – lupe
    Jul 6, 2023 at 15:16
  • 2
    $\begingroup$ This sounds a lot like ars magica magic. Where vulgar (improbable) magic is harder then coincidental magic (gaslight falls and blows up. Brick was weak and crumbles etc...) $\endgroup$
    – Questor
    Jul 6, 2023 at 20:11
23
$\begingroup$

API quotas

Nothing in business is free. When you are playing Minecraft on your PC you can mod costs away, but when you hire cloud services on the internet such as Azure, Amazon AWS, MongoDB storage etc. you pay for usage. It's usually done on a basis of an x amount of USD per y amount of data stored or transfered, z amount of calls to an API or whatever amount of virtual machine online time.

As far as I remember, for example, if you use the Google Maps API on your site the first 100,000 calls per month or so are free, then any extras only go through if you pay up and there are levels of membership with different limits. Actual numbers and costs vary over time.

So take a page for that. Whenever you cast a spell, you spend a certain amount of ManaCoin to pay up a little magic elf to actually do the spell for you (or something like that), with the costs varying by spell and how they are used.

$\endgroup$
3
  • $\begingroup$ what does "you can mod costs away" mean? $\endgroup$
    – Aaron F
    Jul 7, 2023 at 0:43
  • 3
    $\begingroup$ @AaronF you can modify the game code so that you can change the costs of any resource. Like getting 100 pieces of coal out of every dirt block removed, for example. Or just play in creative mode where every resource is readily available and infinite. $\endgroup$ Jul 7, 2023 at 0:51
  • $\begingroup$ thanks, now i get it :-) $\endgroup$
    – Aaron F
    Jul 7, 2023 at 0:53
19
$\begingroup$

Focus

Some souls, via lots of hard thinking and calculation, can start to notice this and can add some of their own code to make things interesting.

I'm a programmer in the real world and I can tell from experience: Focus is my limitting factor.

When I have good focus, I can grasp more complex issues, think ahead more, think outside the box better etc.
When I dont have good focus (eg bad night sleep) my performance drops. Automatic pilot takes over, I'm overwhelmed a lot easier. My ability to perform difficult tasks decreases, I become more sloppy.

My programming is already natually limited, by Focus. And sure, you can train focus, I can force myself into somewhat of a concentration-state when I have a bad day, this is a trained skill, but that does certainly have its limits.

If you need a reason they dont program more and more focus into themselves, all AI have a specified amount of resources. If the human/AI reaches that, thats it. You can optimise and use it more efficient (eg training, practice) but it will limit.

$\endgroup$
13
$\begingroup$

Magic is an in-game System, not a Hack

Mana makes a lot more since when you view magic as an in-game programming interface. The reason it feels like programming is because it works that way by design. Wizards are not actually accessing the simulation's base-code, but rather a framework that runs inside the game for the purpose of building spells. So a scroll of firewall might look like this:

function fireWall($size, $heat){
  $fireEffect = new fireball();
  $fireWall = $fireEffect -> burn();
  $fireWall.range = 5;
  $fireWall.length = 1;
  $fireWall.width = $size;
  $fireWall.height = 5;
  $fireWall.heat = $heat;
  $fireWall.burn.time = 60;
  return $fireWall;
}
cast fireWall(25, 500);

As you can see, the wizard can programmatically build a spell but it's all based on in-game spell classes. While a wizards can pass all sorts of parameters to a spell class, these spell classes are hard coded into the game, and can not be modified. Each class contains in it, rules for how mana is expended to cast the spell. Since the system has no way of creating an effect in the simulation without calling a recognized spell class, there is no way to write code that has an effect without spending mana to caste it. So in the case of the above firewall spell, a wizard can customize one spell to make something totally new, but it must follow the same mana cost rules as the original spells because these classes don't accept "manacost" as a parameter.

Why unlocking magic takes so much "hard thinking & calculation"

There are 2 possible reason why you'd have to be really cleaver to unlock magic.

Option #1: It is an exploit. It's possible that the Great Developer created the magic system, decided he did not want it to be part of the game yet/anymore, and tried removing it from the game by deleting all of the pointers to it. So, while it is theoretically dead-code, there may be an in-game exploit that unlocks it because the Dev missed a pointer in some obscure and forgotten function; so, through critical thinking and by doing something very unexpected, wizards can exploit thier way into the magic system.

Option #2: Magic is a level locked ability. If you are an out-of-shape couch potato, chances are you can not do a backflip or a chin-up. I don't mean you can't do them well, I mean you literally can't do them. It takes all sorts of other strength training to get up to the point were you can even do certain things badly. So these are like level-locked abilities that require you to build up to a certain strength level to even try. Well, magic is a level-locked ability for your mind. Until you develop a certain level of logic skills, it's something that you can't even sort of do. So, you have to learn a lot, and practice your intelligence in other areas before the laws of nature will allow you to "open up" your spell-scripting interface.

$\endgroup$
1
  • $\begingroup$ I'll definitely keep this in mind. As for the exploit thing, I've seen something similar in another fantasy series, the Second Apocalypse. Albeit it's not spelled out in CS terms. Basically Sorcerers are described as 'mimicking God's voice' when using magic. However they're using exploits they're not supposed to, and a major cost of sorcery is that the Gods send your soul straight to Hell after you die for using it. $\endgroup$ Jul 6, 2023 at 16:23
9
$\begingroup$

Similar to the other answers - but in most enterprise grade Cloud systems (Azure/AWS/GCP etc.) Every consumable resource (Read/Writes, CPU time, RAM, Data ingress/Egress etc. etc.) is charged for.

Now - firstly - it's because the big mega-corps don't want to be giving out any freebies, but on a more practical sense, it's to stop abuse.

I've seen a poorly secured Azure account compromised and a spammer spun up a large number of very expensive VMs to do CryptoMining. Which is essentially what you are worried about - people abusing the system.

For each 'tier' of plan, you get X number of resources. Sometimes, the resources are amalgamated into a single unit - for example for Azure SQL, there is the concept of DTUs (Data Transaction Units) that is specific to SQL, it's a combination of the CPU/RAM/Disk/Network/Power requirements to transact a bit of Data (duh...)

So.

All that written - let's now make it into a Magic System.

First and foremost - you will want hard limits - no one can access more than X at a time - we would call this a Rate Limit - and even in enterprise grade environments, there are upper hard limits (that is, limits that no matter how much you pay or how nice your account manager is, you can't exceed).

Below that, everything has a price.

How do you work Price into your system? Well... I would suggest that the Users Skill and Favour is how you would balance this.

Skill is self-explanatory. The more skilled the Wizard, the more efficient they can be with their resource usage. E.g. a Novice might need 100 Mana (which is in effect, like a DTU) to cast a Fireball, but an Expert Fire Wizard might only need 20.

You can justify this in that the more advanced the wizard, the greater their 'Code' is optimized.

Favour is where it gets fun. Think of it lik Stack Exchange Rep - if you do things that are percieved as good (or at least are rewarded by the masses as good...) then this increases your Favour - this allows you to access more than the average.

This isn't a formal system, it's based on Magical/programmatic perception. A Fire Wizard sees a young boy freezing to death in a lake, they use their fire magic to rescue and warm them up - the Boys family and a few onlookers think 'Gee! That Wizard was very nice' - they've just up-voted that Wizard, like we upvote questions and answers here or on Reddit or Twitter or...

Conversely, Our same Fire Wizard sees a Forrest Fire happening, he decides to create a fire break, by magically burning everything in a 100 metre wide gap, but that includes a few peoples homes.

Lots of people are grateful that he stopped the Forrest Fire, but the people that lost their homes are still angry - this is like a controversial answer that has a lot of up and down votes.

Then, we find out our Wizard has been doing this all for a Ruse and goes out and burns a village to the ground - this would be like a massively ratio'd post/answer and if it's bad enough, they'll be dropped down to the lower tier.

$\endgroup$
1
  • $\begingroup$ Thanks. Also the Favour system reminds me a lot of an Urban Fantasy called Pact. In their system, a cornerstone of magic is karma which is basically your credibility to the Spirits that make up the Universe. Mages basically can never lie, reveal magic to muggles, break promises or deal with demons that break the universe or they get downvoted and the world starts to turn against them. $\endgroup$ Jul 6, 2023 at 16:13
8
$\begingroup$

Unintended redirection of computation power

The universe is a computer. Or rather, a lot of small computer-like units, grouping together to emulate different aspects of reality. You need more units for certain tasks, depending on their size and complexity, but overall anything can be reduced down to their "personal" swarm of emulation units.

Now, what would happen if someone started to graps this concept, and even managed to influence the units emulating them? You get a wizard.

"Magic" is really the art of rerouting the computation power of your own units to other means. Releasing one or two routines of your existence for a few moments, in order to do something new. Each person makes it work in a different way, and it can have many different forms, effects and potencies, but the concept stays the same.

Some people may do this by releasing one of their 5 senses during the casting. More reckless casters could even stop major functions, like breathing, or even their blood flow. When you see that person closing their eyes, it isn't just for show, they're "turning off" their vision to reroute its computation power into a powerful spell. Why is this person so tired after casting fireballs? Because they've been releasing their control over some parts of their body, putting more stress over it just standing still.

Heck, some people with permanent conditions may even be able to continuously use magic. This deaf person? Since they cannot hear, they have a part of their unit swarm permanently available, meaning if they notice it, they could cast powerful magic just about all the time.

Even in this case though, a unit is a unit. If overexerted, it can overheat, meaning that the most powerful effects still cannot be used over and over without some cooling down.

Except... If you can get access to something else's units. By default you only have access to your own units, for security purposes. After all, if you could just rule over any unit you know about, you could just use this chair's units, or even your "friend", potentially sacrificing them in the process.

But what if there were hidden access panels? Debug panels, or other control nodes, hidden deep within specific swarms of units in remote locations. Panels which, if accessed and studied well enough, could grant access to other swarms of units. In the hands of the wrong person, those Panels could bring destruction like no other, since you could have individuals essentially capable of spamming spells with practically infinite mana.

This model brings the following :

  • An explanation to "mana", why it is limited and why you can't just siphon someone or something else's power.

  • Individuality in each wizard's "mana pool", the way they channel it, their limitations when casting spells and so on.

  • A MacGuffin in the form of objects or places granting access to what is essentially infinite mana and/or knowledge about the true nature of the universe, as well as ways to use units in different, more potent ways.

In the end, though, "Magic" as practiced is an unintended use of those units. Overusing your swarm of units in unintended ways could have unforeseen consequences. You could even go as far as to make the "creators" of the universe intervene in the events that the universe is made too unstable by those "exploits".

$\endgroup$
5
$\begingroup$

Electricity

Electricity is what makes the hard drives work. It's what makes the monitor light up with pretty colors. It's what makes your XBox controller shake and what makes sound. And if you don't pay your electric bill... your computer stops working.

There are all kinds of limiting resources when you think like a programmer. Clock cycles, CPU throughput, backplane capacity, memory... my favorite is IRQs. Those little honkers have been around since, what, the Intel 8086 or before? But in reality, none of these are consumables. In terms of your metaphor, they represent what limits the complexity of a spell or its power... but they're not the primary consumable you call Mana.

Electricity. Every other limitation still allows you to write a useful program. But without electricity, you're only option is something horrific like a Babbage difference engine. But at that point you don't have programming of the kind you're thinking about.

Yeah. Electricity.

$\endgroup$
2
  • $\begingroup$ I'll keep this in mind. Though the Universe being an electronic computer is more an analogy than a literal description of what it is. $\endgroup$ Jul 6, 2023 at 16:27
  • $\begingroup$ Electricity could be a useful metaphor though if your magic users are the conduits of magic. Too much magic (I.e. too high a voltage) through a user causes them to burn up. In this sense ability to use a lot of magic would be dependent on a person’s natural level of resistance. You could add magical elements that serve as insulators to improve efficiency, etc… lots of useful metaphors. $\endgroup$
    – Dugan
    Jul 6, 2023 at 18:31
5
$\begingroup$

It is Gas

Spells require computational processes, and the Universe has a limit on that resource. So in order to prevent users from abusing the system and expending all of the processing, the Universe Virtual Machine applies Mana fees that must be paid to execute spells.

Copying for Ethereum org:

Gas is essential to the Ethereum network. It is the fuel that allows it to operate, in the same way that a car needs gasoline to run.

[...]

Gas refers to the unit that measures the amount of computational effort required to execute specific operations on the Ethereum network.

Since each Ethereum transaction requires computational resources to execute, each transaction requires a fee. Gas refers to the fee required to execute a transaction on Ethereum, regardless of transaction success or failure.

Emphasis mine. Source

If you follow this logic, you can even do some interesting things. For example, in the Ethereum VM, you can pay extra (called Priority fee or tips) so your transaction is executed with priority. In your world, wizards could spend extra mana to override other spells.

$\endgroup$
2
  • $\begingroup$ Beat me to it by a minute. "obviously magic runs on a blockchain..." and of course, gas prices are going to go up if a lot of mages get together in one place and start unleashing the big stuff. $\endgroup$
    – hobbs
    Jul 6, 2023 at 14:17
  • 1
    $\begingroup$ This is very useful. Also I can't tell if the Universe being a component of a crypto-scheme is either pure unadulterated comedy or cosmic horror. $\endgroup$ Jul 6, 2023 at 16:25
5
$\begingroup$

Computer Science Calls This “Fuel”

Alan Turing famously proved that it is impossible, in principle, to prove that an arbitrary program halts, and Henry Gordon Rice extended this to prove that all non-trivial statements about an arbitrary program’s behavior are undecidable.

So, what do systems that want to be sure they don’t follow a dead end forever, do? They add a “fuel” parameter to their algorithm, the number of steps it is allowed to run, and subtract 1 from it at every step. When the fuel reaches zero, the algorithm is forced to stop.

This could actually be voluntary on the part of the casters: they’re warned to put in this kind of kill switch, lest their spell run out of control, but that’s on the honor system. It also implies that spells last arbitrarily long, but not forever.

If it’s enforced by the environment, it becomes very important to write spells that do as much as possible as efficiently as possible.

$\endgroup$
13
  • $\begingroup$ Sounds interesting but doesn't this mean that you can cast a succession of as many short spells as you want? Once say 'fireball' is cast, would a wizard not be free to just start up another fireball spell? $\endgroup$ Jul 6, 2023 at 19:08
  • $\begingroup$ @AllSeeingEye33 If the only limitation on the magic system is wizards’ ability to write new spells and their willingness to risk them having bugs, then yes. $\endgroup$
    – Davislor
    Jul 6, 2023 at 21:48
  • 1
    $\begingroup$ If you think of spells as going through validation process before they can be executed, it could be possible that the system scans and blocks any spell that do not have a fuel parameter that is within a certain spec. That way, it does not have to be an honor system at all. $\endgroup$
    – Nosajimiki
    Jul 7, 2023 at 13:10
  • 1
    $\begingroup$ @AllSeeingEye33 This assumes that code is reusable. If you imagine spells like a command line interface instead of a full word processor, then it may be that spells have to be "typed out" each time you use them. So you could queue up a spell by "pre typing" it, but once you execute it, you have to start over. So, you could instead of a mana limit have a spell slot limit more similar to DnD where you have have X number of command prompts open with various levels of system access. $\endgroup$
    – Nosajimiki
    Jul 7, 2023 at 13:15
  • $\begingroup$ @Nosajimiki An entity that could tell whether an arbitrary program has a fuel parameter at all could solve the Halting Problem. Which is impossible (not just physically, but logically). Programs could be limited to a certain strict format, but real-world systems that do something similar put the fuel requirement on the interpreter. $\endgroup$
    – Davislor
    Jul 7, 2023 at 16:26
3
$\begingroup$

I was somewhat surprised that these words are not in others answers, but:

Quantum fluctuations

The thing that makes black holes not so black.

It's a "local finite" thing, it's auto refreshing non stop, and it is absolutely present everywhere, even in "empty" spaces.

Normal nature is when the quantum fluctuations are disorganized static on TV tubes, and magic is when these fluctuations are organized into a coherent-directed signal that produces some image in the said TV tube.

In other words, magic is the computation process that quantum tunnels transform the quantum fluctuation state mana in one space, and at same time, change the very nature of that space. Air becomes plasma, and static plasma becomes moving plasma.

But the thing is that mana is a very tricky thing. It's small, it's unstable, and it will cause change. Magic users can do so much, without destroying yourselves. And so, it's very tiring for anyone to actually make this happen. A lot in magic making is about chasing some specific output while avoiding some other results at the same time.

$\endgroup$
1
  • $\begingroup$ I think I might need clarification. How does Mana in this explanation act like a battery or 'energy' to be spent or saved for casting spells? $\endgroup$ Jul 6, 2023 at 16:33
3
$\begingroup$

Raw data?

The type of spell is defined by the end outputs or results specified by the program (spell) in question, the type of data input and, to an extent the complexity of the programs impacted. Spells can either make changes to preexisting data to cause temporary effects e.g a teleport spell re-writes location data of a person (program) but changes no innate programming. Such a spell requires raw input data including the spatial data on the current and intended locations of the object or person being teleported.

A permanent effect spell, say transmuting lead to gold is more difficult but can be permanent or at least long lasting because the program defining the object being transformed has to be precisely altered. This also requires input data on the location and nature of the object but also data on what the object is to be turned into.

The power of the spell is defined by the amount of data to be input, the rate at which data can be processed in a given unit of time and, to an extent the complexity of the program.

The input data used as inputs for the spell is extracted from the universal memory of creation in which All data and programs in the universe are stored BUT (and this is important) the underlying programs of the universe include RAID controllers and related programs. These act to both maintain the underlying stability of the master program (the universe) and to format, compartmentalize and preserve important data.

The output data is the impact the spell has on 'reality' i.e. existing data sets and programs. The output data is an overwrite of preexisting data and programs caused by the spell. In the event the conditions listed below aren't violated this can now become input data for future spells and is stored in the universal memory as such.

The result is that there are limitations imposed on magicians/priests etc. These include but (depending on your wishes) may not be limited to:

  • access time; needed to locate and extract the data from universal memory
  • limitations on data manipulation. Spells are innately limited in both size and the ramifications of their impact because the universe tends to overwrite and return the universe to it's previous 'normal' (default) setting rapidly in the event a spell significantly destabilizes core underlying routines, settings or programs.

So casting a fireball quickly is one thing (the universe barley notices). Write and activate a spell designed to say make the Sun go nova? Not only is the amount of input data required enormous (requiring in turn huge amounts of time and effort to locate and extract) but activating the spell immediately causes so many changes to the Universe that self protection re-writes kick in. So when executed the 'nova' spell appears to fail. In reality it worked but the output data causes such severe and widespread changes to the starting conditions and programs that the results are immediately deleted and settings restored to the prior universal positions.

$\endgroup$
3
$\begingroup$

Obviouly computrons.

computron: /kom�pyoo�tron`/, n.

  1. [common] A notional unit of computing power combining instruction speed and storage capacity, dimensioned roughly in instructions-per-second times megabytes-of-main-store times megabytes-of-mass-storage. “That machine can't run GNU Emacs, it doesn't have enough computrons!” This usage is usually found in metaphors that treat computing power as a fungible commodity good, like a crop yield or diesel horsepower. See bitty box, Get a real computer!, toy, crank.

  2. A mythical subatomic particle that bears the unit quantity of computation or information, in much the same way that an electron bears one unit of electric charge (see also bogon). An elaborate pseudo-scientific theory of computrons has been developed based on the physical fact that the molecules in a solid object move more rapidly as it is heated. It is argued that an object melts because the molecules have lost their information about where they are supposed to be (that is, they have emitted computrons). This explains why computers get so hot and require air conditioning; they use up computrons. Conversely, it should be possible to cool down an object by placing it in the path of a computron beam. It is believed that this may also explain why machines that work at the factory fail in the computer room: the computrons there have been all used up by the other hardware. (The popularity of this theory probably owes something to the Warlock stories by Larry Niven, the best known being What Good is a Glass Dagger?, in which magic is fueled by an exhaustible natural resource called mana.)

source: http://www.catb.org/jargon/html/C/computron.html (The Jargon File, a public domain document)

It's interesing that there's a reference to mana there.

$\endgroup$
3
$\begingroup$

Garbage collection.

The universe is a simulation. Every program (i.e. person) is assigned resources when it starts. Magic is a workaround/hack/exploit - which means that it uses resources that were intended for other things. Unlike regular "clean" code, these don't get freed up immediately - because magic is a hack. Over time, garbage collection will eventually free this RAM or CPU or port locks, etc. up - which is why mana eventually replenishes. It's also why getting a good sleep helps replenish mana, because sleep is where the system is running most of the garbage collection.

A regular activity would be written with an allocate - use - free cycle. Magic being a hack is more of a steal-from-somewhere - use - drop-without-free cycle.

$\endgroup$
3
$\begingroup$

You're spending your own allocated system resources.

An individual entity in Simulated Reality is permitted a certain amount of system resources to do what it's meant to do.
A rock requires very little beyond the purely physics-based simulation.

A person requires substantially more to simulate a mind and memory and all manner of other things, and there's some margin for doing more mental heavy-lifting.

With that in mind, a wizard casting spells must use their own allocated resources to do so. The upshot is that casting spells maxes out the resources-per-cycle they're supposed to have very quickly.
The simulation isn't just going to lock up because some process is over-simulating though (There's no shortage of system resources, this is just a management thing), instead the person gets.. throttled.. Their system-resource allocation is reduced until they stop over-using it.

They're in debit with the universe until enough time passes without continuing to cast spells that it wears off.

This can manifest as tiredness, fuzzy-thinking, an inability to stretch past the bounds they're supposed to be able to manage (eg: They can't cast more spells) and in extreme cases, they get knocked unconscious because their system-resources for thinking are overstretched.
The most extreme case is that they die because the resources aren't allocated to allow them to keep their heart beating and lungs pumping, and once they die, the system won't replenish them so they can wake up again.

A common wizarding malady would be "Mage-Brain", where having begun casting spells, you aren't thinking clearly anymore. Which tends to manifest as a kind of drunk-with-power effect. Mad laughter, that sort of thing.

Meanwhile, many schools of wizarding advocate all sorts of Mental Discipline and Zen states. They believe this puts them in better contact with their magic, but the reality is that by thinking less, they have more system-resources to spend on magic..

Thus a beautiful paradox. To be a wizard, you have to be smart, but once you are a wizard, you become entertainingly dumb

$\endgroup$
2
$\begingroup$

Entropy. As things stand, any computation increases the entropy in the immediate vicinity of where it is carried out, which conventionally becomes heat which has to be removed.

Certain locations are either at a (temporarily) lower temperature so can support a brief spurt of high-intensity computation before becoming (temporarily or permanently) unusable, or have better heatsinking so can support sustained high-intensity computation.

In either case raw energy has to come from somewhere, and lower-grade energy i.e. heat has to be disposed of somewhere. These might be parallel universes, possibly inhabited: The Gods Themselves know :-)

But certain people might be able to harness more efficient means of computation, see https://en.wikipedia.org/wiki/Adiabatic_circuit as an example. A lot depends on whether the "gates and circuits" are some property of the Universe (i.e. some sort of computational substrate), or are a property of or carried around by a player or NPC.

$\endgroup$
2
  • $\begingroup$ So basically mana is something like fungible negentropy you have to pay out in exchange for the entropic fee induced by computation? $\endgroup$ Jul 6, 2023 at 16:17
  • 1
    $\begingroup$ Sounds like a good start, although I was thinking about it comprising a combination of environmental factors (after all, some cultures' temples look suspiciously like heatsinks) and personal coolness :-) $\endgroup$ Jul 6, 2023 at 16:43
2
$\begingroup$

Syntax and API knowledge, Time, Energy, clear mind, typing speed and logic. The more you have the more you cast good lines of code. But the universe is still universe cause programming is not code execution. If you are talking about running code = magic then mana is computer ressources the more you have the more code you can run.

$\endgroup$
2
$\begingroup$

Nanomachines

Reality is permeated by them, and they recharge slowly on their own, but they use energy to build and shape reality to the whims of magicians (programmers!). Some spells are more "costly" than others requiring more nanomachines (NM) to "cast", and stronger wizards are able to hold/accumulate more fully charged NM, allowing them to cast more powerful spells.

Some areas of the world have more or less NM in the ambient environment making it easier or harder for any mage to cast by drawing from their surroundings, in extreme cases (think a clean room) there might be no NM nearby meaning a mage could be severely limited in what they can do as most of the time spells rely on a mages "personal" NMs forcing cascading changes in the ambient NM to enact spells, and in low NM areas the biggest spells might not be possible to cast.

For opposed spell casting it comes down less to raw power, and more in ability to "convince" the ambient NM to work for your spell as opposed to your opponents. Similar to escalating battles between virus/anti-virus software whomever is able to better maintain control of the NM in an area will most likely ultimately win in a magical duel.

And of course, the slightest mistake can have catastrophic and unintended consequences just like programming computers in real life. Spells do exactly what you tell them to, which might not be what you wanted them to do, especially as most wizards don't actually understand programming, rather have learned it by rote.

$\endgroup$
2
$\begingroup$

Awesome question, thanks. I’m working on a world that hinges on some of these questions.

If your world-building demands for the magic to be based on a computational resource and for the magic users to have direct access to the simulation code repository, one way to restrict the magic is to require forking the main repository into an isolated side branch, making the desired changes (the magical effects) there, and then merging it back into the main branch to cause the effects to happen in the “base reality.” That could be limiting because you need to checkout, write, pull, merge either cognitively (which can be massively tiring) or due to design constraints (like needing approval for your pull request).

However, this may be a narrow issue. For this to be a metaphysical problem in a world, the world programmers would have to be at approximately the same technological level and close to the same cognitive level as the simulated entities who might use magic. If the world simulation was written with a higher tech/intelligence level, there is no reason why the simulated entities should be able to access or understand it. Your Minecraft example doesn’t apply because it is a controller of the simulator (the player), not a simulated entity, that is able to use the cheat codes. So that gets us back to Arthur C. Clarke’s “any sufficiently advanced technology is indistinguishable from magic” and back to square one.

$\endgroup$
1
$\begingroup$

RAM, you need it to cast spells,it limits how much/how complex your spell can be, Mana could be something that tells magic exactly what to do, the instruction you think is engraved into Mana which in turn can communicate with magic and pass on instruction, when you run out your exhausted and can barely think

Script kiddies get tired faster because they just copy a poorly optimized fireball spell that could cast 3 if properly done.

$\endgroup$
1
$\begingroup$

Frame Challenge

The primary characteristic of mana is that it is a reservoir of resources that recovers in a trickle over time. In the entire world of computing, the only place you have reservoirs building up is when you're talking about a backlog of things that need to be done. Backlogs are a negative resource. It's something that you aren't doing right now because you're too busy doing other things.

In computing, positive resources are static and assigned. Storage, processing power, and communications all behave that way. You don't store up MIPS and use them all at once when you need them.

The concept of mana suggests that engineering is like bricklaying, but it's really more like architecture. This is the difference between process and design. Process is when you actually make something work, whereas design is where you figure out what processes will have the results that you want.

$\endgroup$
1
$\begingroup$

CPU time specifically for the physics engine

Some background on how physics engines work

Most physics engines in games have the concept of active versus sleeping physics object. When an object is actively moving, it is active. Every step all the forces are simulated, collisions are checked, the object moves, all computationally intensive stuff.

On the other hand, sleeping objects are objects that have fallen on the ground. If all the forces on them stay equal we know they won't move so the physics engine does not need to simulate them until something interacts with them.

In a game, you may notice that, for example, knocking over a large stack of physics objects can cause a large drop in frame rate as lots of sleeping physics objects have now become active.

How magic could work

In physics, lots of things need not be simulated unless observed. To save computational power, the exact position of an electron, for example, is not actually simulated unless needed.

However, if one where to temporarily adjust the rules of physics, everything that was in a "stable" state now needs to be simulated till it reaches another stable state. During this time, computing the physics for the area suddenly becomes much more expensive, thus requires manna.

In general, that means a given "spell" would be more expensive if:

  1. It effects a larger area
  2. It causes particles to move chaotically
    • For example, a low gravity spell would be more expensive than a high gravity spell since it would cause lots of floating dust
  3. Things move in an unstable way for a longer time
    • For example, an explosion could keep draining manna as long as objects are flying around. On the other hand the high gravity spell could be kept going indefinitely since it doesn't really cost much to keep going after it starts.

This could lead to interesting aspects for your story where a spell can keep draining manna for a long time after being cast, and stopping it would require more manna. If you run out of manna the universe may choose to simulate you incompletely to save on resources which isn't very healthy.

$\endgroup$
0
$\begingroup$

I want to say passion, but given that when you burnout you can't easily do your "magic", I'm thinking that mental energy is your mana.

You'll need it at it's peak to work properly. Coffee can help, so can soda, but rest and relaxation, not thinking about code or doing anything mentally taxing, would be your best way of regenerating your "mana".

Doesn't sound too exciting, but I couldn't think of anything else.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .