PDA

View Full Version : Possibly interesting magic system idea



Biophysicist
2010-04-22, 06:10 PM
I think I've got an idea for an interesting magic system. In some fantasy stories, magic is mixed with programming. What I'm thinking of is taking that idea and actually writing up a system for it. There will be a few basic "opcodes" that make the spell do various stuff, ranging from doing damage to allowing a saving throw, as well as programming constructs such as if and while blocks. (It is worth noting that these "opcodes" only describe the effects, not the method used to accomplish them: a stunning opcode, for example, could stun the target by putting it to sleep or freezing it in ice instead of a "traditional" stun.) I will also provide a system for balancing these program-spells (which will be the hard part). Your thoughts?

magic_unlocked
2010-04-22, 07:16 PM
The idea is interesting... but, I don't see how you will implement this. You need more information than what you have for people to critique accurately.

Biophysicist
2010-04-22, 08:34 PM
You have various "opcodes" that do stuff. You arrange them in a certain way to obtain the effect you want. There will be rules used to determine the power of a spell and the associated cost - for example, a damaging opcode set up to affect everything in a particular range will cost less than one that only damages foes in the same range.

Here are some example spells: (The opcode names, syntax, etc. are not final, of course. Everything in italics isn't part of the spell, but text I'm adding to explain it.)


Example 1: A direct damage spell (eg. Magic Missile)
slot1 = getTarget() Sets "target slot 1" to a single target of the player's choice.
slot1.damage(5) Does 5 damage to the creature/object in "target slot 1".

Example 2: A direct damage spell with splash
slot1 = getTarget() Sets "target slot 1" to a single target of the player's choice.
group1 = getNearby(slot1, 2) Sets "group 1" to all creatures/objects within 2 squares of the creature/object in "slot 1".
group1.damage(5) Does 5 damage to all creatures/objects in "group 1".

Example 3: A damage-over-time spell
slot1 = getTarget() Sets "target slot 1" to a single target of the player's choice.
turnLoop(10) Executes all opcodes until the next "end" opcode once per turn.
slot1.damage(1) Does 1 damage to the creature/object in "slot 1".
end() Ends a loop or if statement.

Example 4: A direct-damage spell with splash that allows saving throws
slot1 = getTarget() Sets "target slot 1" to a single target of the player's choice.
group1 = getNearby(slot1, 2) Sets "group 1" to all creatures/objects within 2 squares of the creature/object in "slot 1".
groupLoop(group1, slot2) Makes "slot2" loop through all creatures/objects in "group 1".
if(slot2.save(Con, 15)) Skips all opcodes until the next end statement if the creature/object in "slot2" makes a Fortitude save against DC 15. (I'm not going to use the D&D stat system in the end, but it works for this example.)
slot2.damage(5)
end() Ends a loop or if statement.
end() Ends a loop or if statement.

DMofDarkness
2010-04-22, 09:41 PM
so, they get a certain number of lines per day, to mix and match as they want?

while x < 10
slot1 = getTarget()
slot1.damage(5)
x-- /*I use java, so I don't know it this actual line would be included in the program*/
end()

Biophysicist
2010-04-22, 10:07 PM
Not really. The "energy cost" or whatever of the spell isn't based on the number of lines used, but on a set of rather complicated rules. I'll use the spell you posted as an example. First, I'll convert it into a more accurate syntax:

repeatLoop(10)
slot1 = getTarget()
slot1.damage(5)
end()

That spell's cost would be affected by the fact that it affects 10 targets and can do up to 50 damage, making it quite an expensive spell at early levels. By contrast, the following would be slightly cheaper:

slot1.getTarget()
slot1.damage(50)

because it's less flexible.

Kamai
2010-04-23, 12:13 AM
With more explanation, this seems like it would be fun. However, it seems strange that the spells you have listed so far just work. Are there other things that could make the spell fail, or do you just intend for commands to allow saving throws or attack rolls to reduce the cost?

mikeejimbo
2010-04-23, 09:09 AM
I've considered a system similar to this, actually. I even wrote up a language for it once, but it was for a freeform game with no real limitations, except that I had to write up every spell as a program. And the character had to write them on scrolls, then "execute" the scroll.

Biophysicist
2010-04-23, 01:14 PM
@Kamai: There are opcodes for saving throws. Here's an example:

slot1 = getTarget()
if(slot1.save(Fort, 15))
slot1.damage(5)
end()
slot1.damage(5)

That will do 10 damage to a target, but allow a Fortitude save against DC 15 to avoid 5 damage. Of course, I'm not going to be using D&D's stat system, but for now it works as an example.

@above: It sounds like you let people do whatever they want with their programs as long as it wasn't obviously overpowered, because you said "but it was for a freeform game with no real limitations". My system will have very definite limits on what you can do, in the form of a list of probably rather complicated rules.

Roderick_BR
2010-04-23, 01:59 PM
I'll suggest looking up Ars Magica. If I'm not mistaken, they did make a "Verb + Noum" kind of spell system. For example, you combine "create" and "fire" to cast a fireball, or something like that. I did see a few systems based on that, and they work pretty well. The hard part is assigning some D&D effects to them, since they'd be more "complex" "programs"

Tyrrell
2010-04-24, 11:45 AM
I'll suggest looking up Ars Magica. If I'm not mistaken, they did make a "Verb + Noum" kind of spell system. For example, you combine "create" and "fire" to cast a fireball, or something like that. I did see a few systems based on that, and they work pretty well. The hard part is assigning some D&D effects to them, since they'd be more "complex" "programs"

Ars Spells are easily as complex as D&D spells so I wouldn't think that this would be a problem.

However, from the original poster's descriptions it sounds like he's trying to recreate Hero system. I think that giving a character a themed variable power point pool in Hero would do exactly what he wants and have 25 years of playtesting to shore up some of the more egregious holes.

mikeejimbo
2010-04-24, 03:01 PM
@above: It sounds like you let people do whatever they want with their programs as long as it wasn't obviously overpowered, because you said "but it was for a freeform game with no real limitations". My system will have very definite limits on what you can do, in the form of a list of probably rather complicated rules.

Yeah, though I was the player, not the GM. I was self-policing. I've always wanted to write one up for an actually stat-based game, too, though.

Kamai
2010-04-25, 02:12 PM
@Kamai: There are opcodes for saving throws. Here's an example:

slot1 = getTarget()
if(slot1.save(Fort, 15))
slot1.damage(5)
end()
slot1.damage(5)

That will do 10 damage to a target, but allow a Fortitude save against DC 15 to avoid 5 damage. Of course, I'm not going to be using D&D's stat system, but for now it works as an example.



What I was trying to get at with my question is if there is any benefit for putting in the line that allows the spell to be defended? I know its possible to add a way for it to be defended, but is there any reason to? Also, in trying to get a sense of balance, how strong would a character need to be to use the spells you listed in post #3?

LurkerInPlayground
2010-04-25, 03:58 PM
The thing is that it's usually assumed that spells involve formulas like this and that your character does all the work needed to achieve the effect. They study for hours on end to account for the phases of the moon, the level of humidity, puzzling out the syntax of incantations and so on.

In which case, it's largely a matter of fluff. Spells are then merely the end-result of all the programming work. There are only so many acceptable strategies for achieving the same effect. So regardless of how you customize your coding, you're still more or less achieving the same effects (Mac and Windows are operating systems at the end of the day). Since it's a matter of pure fluff, then it's easy for me to just take D&D in any edition and just say that spells and magic are the byproducts of programs being run on some all-powerful universal computer.

In practice, from a roleplay perspective, measuring magic by its effect condenses the spell description down into the pre-defined effect you need to resolve in a game. It's a quick and easy judgment call for the DM to make.

But since your effects are not as rigidly pre-defined, how is a freeform system like Mage distinguishable from what you want? Is the code jargon even necessary when that same information is presented long-hand in the manual? D&D 3e already has some simple tweaking involved in the metamagic system, and I fail to see the distinction between that and what is being proposed here. It's just customization. Only more so.

Extra customization takes a lot more time on the table to resolve. The more complicated your mechanics, the more time gets spent bogged down in book-keeping. Customizing your effects on a case-by-case basis is going to take a lot of time, unless you have your players prepare their effects beforehand.

I'd also question whether being able to make a trade-off between [insert two parameters of your choice] really adds more depth to the game . If the customization choices you give the players are nigh-meaningless most of the time, then having those choices in the first place just slows the game down without any purpose. "A long list of complicated rules," isn't a phrase that makes me think that you've considered this problem.

mikeejimbo
2010-04-26, 05:04 PM
I generally agree with Lurker. I would go on to iterate that "a long list of complicated rules" is not a good design goal.

However, I do think that a system could be fun, but it might require that the group all be spellcasters and all be programmers in real life. In fact, the ideal game of "Program your own spells" might be more like a boardgame than an RPG, where it is the focus and goal of the game.

magic_unlocked
2010-05-06, 07:14 PM
I have to agree with mikeejimbo and Lurker. Having a long list of complicated spell making rules not only slows down the game, but lessens the fun other players will have if they have to wait every time the opcode is used because the character in question invoked some obscure opcode rule.

If you want complicated rules, then look at the Epic Spellcasting system in the ELH. While it might not be what you want, it does have rules to go with it which might help you get what you want out of these... opcodes.