PDA

View Full Version : [3.5]Programming Magic, Help!!!



Death Monkee
2010-05-29, 12:42 AM
Hi I was reading some of my old Fantasy books recently and thought it would be fun to try to homebrew something. So I started looking through my books and ended up finding my old copy of Wizardry Compiled by Rick Cook.

It is an awesome series that has people who program magic like you would a computer program. So I thought it would be cool to be able to do that in a DnD 3.5 game(4.0 sucks). I've been reading and tinkering for 3 days now and am stuck, I figured if I posted here either someone would suggest some stuff or just do it for me.....sue me, I'm lazy.

If anyone is interested I will post what I have so far and.....<shrug> go from there. Thanks!

Fortuna
2010-05-29, 01:04 AM
I recently stumbled across those books, and toyed with the idea as a magic system for 3.5. I came to the conclusion that it won't work, for the very simple reason that its entire point (making incredible magic simple) makes it unusable. But please, prove me wrong, because it's an awesome idea.

Death Monkee
2010-05-29, 02:55 AM
Thanks for the support, I'm not at my laptop so I can't access what I have so far but here is the basic run-down.

Well, I made a bunch of different magical programming languages, and made each one good at something.
Example being Hexen, which I made good at curses(In particular shape-shifting curses).
Im currently setting it up as a separate skill for every language, and using skill checks for learning, coding, and running spells.
Im making programmers tools as feats.
Im also working on a Programmer base class.
I came up with rules and stats for magical languages, each language having three stats. Two kinds of complexity, and what kind of syntax(closest word I could find) it has. One kind of Complexity governs how many different symbols are in the language, the other how many different meanings each symbol can have. Syntax governs what the symbols look like and how you string them together(or if you even do) to form a coded spell.
The more complex a language, the longer it takes to code something, but the faster it runs. Also as I said above, different languages will give bonuses to different kinds of coded spells.

So far what I have is rough Alpha Phase so any ideas will be very welcome.

Fortuna
2010-05-29, 04:28 AM
I would need to see exactly what you've got, but it sounds interesting. You might want to consider, though, that a "cursing" language and a "buffing" language or whatever actually doesn't make that much sense fluff-wise. Also, be wary of piggybacking and singularities: if you can build a program builder, or a self-sustaining loop (like in Wizardry Compiled with the scout things) then your power begins to grow extremely quickly. That was, as I recall, the reason that Wiz was so powerful.

Essentially, I recommend that you outright ban indefinite loops, because they'll cause you no end of grief.

Death Monkee
2010-05-29, 04:38 AM
Hm....I agree with the banning infinite loops thing, and don't all computer programs become corrupt and stop working after too long running? I know mine do.....

And as for the program builder, something like that would be a BAD idea, too much chance to go wrong. Now a program that simply duplicated a simpler program.....that would be fine for a high level end game ability.

And as for making a language for cursing and one for buffing, its not much different then computer languages being designed for something. Example being Java which was developed for the purpose of being able to be run on anything, or DarkBasic Classic which was written specifically for 3d game models which it can do with less code than say....C++.

Fortuna
2010-05-29, 04:49 AM
I'll submit to you on this one: my experience extends only to Ruby and a tiny bit of dabbling in C and C++.

As to the loops and builders: that's the entire basis of Wiz's system. They work entirely on simple spells marshaled to a single purpose, and his first big spell (which admittedly went wrong) was simply one tiny spell, repeated over and over and over...

How I think of it is that you might have a basic spell, like "bippity-boppity-boo" for setting things on fire. That can be applied in itself, or you can build a fairly simple program that duplicates it at (perhaps) one minute intervals. So now you have a fairly useless flamethrower that anyone can use, and I'm guessing that since the thing it produces is essentially one "command" or "method" it won't need to be more complicated than about twenty (assuming the absolute most awful structure for looping) lines to run for up to a day or so.

If we assume, then, that the principle can be extended, then we simply need a reference material which has the flamethrower written into it in an unchangeable way, and a program which can cycle through. Assume that the cycle through and cast each line is another twenty-one lines, and that it's a whole ten lines to end the spell. That's what, sixty lines to produce a constant flamethrower, good for one day then recast a spell that you are becoming ever more familiar with? That's pretty scary. Even if you assume a similar length of spell to "write" the memory, that's less than 200 lines to make a flamethrower. Loops need to be very carefully controlled.

O'course, take anything I say on the subject with a grain of salt.

Death Monkee
2010-05-29, 04:55 AM
Well from the sound of it you know more about programming then me. I havent touched it in years. And even then all i did was java and python.
(dont think html really counts)

I would leave the programs for like level 12+, and just allow coded spells before that.....idk. Now you see why I was having trouble. ick.

At least it would be easy to for WoD.

[Edit]
And to be honest I was thinking about just glossing over the actual programming with a couple skill checks, but if you can think of a way to actually include some programming then it would awesome and a good way to learn programming.

playswithfire
2010-05-29, 06:57 AM
And as for making a language for cursing and one for buffing, its not much different then computer languages being designed for something. Example being Java which was developed for the purpose of being able to be run on anything, or DarkBasic Classic which was written specifically for 3d game models which it can do with less code than say....C++.

This is true, but the alternative is to think of the different types of spells as different packages within the same language, rather than different languages. Java, for instance has the packages
javax.swing for creating GUIs
java.sql for talking to databases and
java.math for, well, math among many others
each of the packages contains related classes that perform a certain category of tasks, but they can also all work together. In your case, if you had the packages spell.curse and spell.buff in the same language, I could write spell using both that, for instance, gave an enemy a penalty to an attack roll and boosted my attack by the same amount.


I came up with rules and stats for magical languages, each language having three stats. Two kinds of complexity, and what kind of syntax(closest word I could find) it has. One kind of Complexity governs how many different symbols are in the language, the other how many different meanings each symbol can have. Syntax governs what the symbols look like and how you string them together(or if you even do) to form a coded spell.
The more complex a language, the longer it takes to code something, but the faster it runs. Also as I said above, different languages will give bonuses to different kinds of coded spells.


I don't know if this is the sort of advice you're looking for, but either for the players or for whatever program you're planning to use, have you considered writing a spell Context Free Grammar. You're already using terminology consistent with it. If you're not familiar, you'd basically write a set of rules like
SPELL = HEX or BUFF
HEX = bestow penalty to STAT or turn enemy into SHAPE
BUFF = ally gains BENEFIT DURATION
STAT = strength or dexterity or constitution
SHAPE = a newt or a pile of goo
BENEFIT = 5 hp or an increase to speed
DURATION = instantly or for a number of rounds
and any series of valid substitutions results in a valid spell. In your thing above, the all-caps words would be your runes and the or-separated values would be the different values of those runes. The rules are how you build the spells with the language.

Death Monkee
2010-05-29, 03:39 PM
I think I see where your going with this, but to be honest idk.....Hm.....

What I really want to do is actually write a brand new, easy to understand computer language just for this. But I suppose it would be easy enough to just pick one and have people actually code their spells.

Any suggestions on what would be a fairly easy to understand computer language?

[Edit]
After a bit of thought, I do really like the packages idea.....perhaps either as feats or just as the programmer gets a few every couple of levels. I'll have to think about it some more.
[Another Edit]
I'm currently taking the advice given and re-writing everything. For the Programmer base class I am going to tinker with the Expert NPC class.
I haven't yet decided on what language to use. Any suggestions?

Fortuna
2010-05-29, 08:41 PM
I recommend Ruby for ease, personally, but that's partly because I like it.

Maerok
2010-05-29, 11:20 PM
Try older stuff like Basic or Fortran? Or maybe an object-oriented approach.

Death Monkee
2010-05-30, 12:48 AM
Well basic is a very common language and close to a universal one....Hm......I gonna take a look at the languages suggested and see how they code.