Advertisement

Spellcasting system

Started by July 17, 2003 02:28 PM
35 comments, last by Platinum314 21 years, 5 months ago
Anyone play Arx Fatalis?

They used a sequence of mouse gestures for magic spells. You had to find a rune in the shape of the corresponding gesture before you could use that particular gesture in a spell.

If you paid attention, you realized that certain runes corresponded to certain effects. Like Aam Yok was "create fire", Nii Yok was "douse fire", Aam Yok Taar was "Create fire projectile", Nii Movis was "paralyze" and Mega Movis was "haste".

The in-game spellbook listed a bunch of patterns for you, but you could try out whatever you wanted, and you would sometimes come up with unlisted spells... it was rather sweet.

[edited by - Nypyren on July 18, 2003 4:45:27 PM]
It''s like cyclic amnesia, where an old idea gets brought up and everybody is unable to remember that it was already used before, enthusing about how original it is. Arx Fatalis was based on the Ultima Underworld series, which did the rune combination thing a mere 11 years ago. Even before that, there was The Four Crystals of Trazere/Legend/Empire which let you combine arbitrary runes in different orders and quantities to achieve different effects.

If a programming language is too awkward for your players (and it will be), then think about what a programming language was originally based on - natural language. All of us know at least 1 natural language, so it''s a good basis to work from.

eg.
"Spells can cast other spells (Function calls)" = verbs.
"Spells can have parameters (numbers, direction, other spells)" = adjectives and adverbs.
"Spells that can do damage, heal, protect, teleport, etc." = nouns.

[ MSVC Fixes | STL Docs | SDL | Game AI | Sockets | C++ Faq Lite | Boost
Asking Questions | Organising code files | My stuff | Tiny XML | STLPort]
Advertisement
Having to "program" a spell might be a bit of a turn off for many of your less technical audience. A better idea might be to follow the natural language suggestion or (even better in my opinion) a graphical representation. Allow the user to earn/find runes which can then be combined into any pattern they wish. Certain runes (corresponding to Kylotan''s nouns) can be given different "natures" like fire, water, ice, etc. This way a rune combonation might be created like:

1 Freeze rune with 2 Explode runes with the nature of fire.

Freezes enemies in their tracks then blows ''em apart.

You''d also want to allow users to save their spells in a list for quick access in the future.
7|-|3 p057 @b0v3 i5 c3/^7i|=i3|) 1337!100|< |=0/^ j||3|/|7
i am trying something very similar. in order to explain this effectively im gonna have to give some background. this reply will be programming-free (im not at that level of development yet)...

this game takes place on earth, 300,000 years or so in the future, after our civilization was wiped out by an extra-terrestrial impact. this impact brought with it new, exotic elements and a new energy field surrounding the earth (ala electromagnetism) which allows for the use of magic. so far i have two different types of magic (and i would like to add a third). the first is element based, the second is energy based (there will also be an alternate "energy view", which will allow you to see the energy around you directly (colors correspond to types of energy, brightness corresponds to concentration and charge [black = negative, white = positive, gray = nuetral).

in the element based system characters must procure, either through purchase, theft, or search, any number of different elements which each have unique magical effects. once they get these elements they can either use them raw, or they can be refined and mixed in any number of ways (the best way to do this would be during a period of rest, although i would like to make it possible to do so in the heat of battle as well). thus new effects can be created by combining and refining these elements in different ways. if you take a vial of acid, and add it to an element that creates rain, then you have acid rain.

furthermore, these elements can be refined in order to make them more effective, thus slightly altering the outcome. most elements acquired directly from nature will have a moderate quality because of a natural mixing with other elements and molecules, while those bought from a store will have higher qualities (and thus higher prices). certain elements could also be cast into items like weapons and armor, either by a knowledgeable ai character (ie; smiths), or by your own character provided that you have learned such techniques. thus an element that has, say, a negative gravitational field could be cast into a sword, making it much more powerful (enemies could be blown away without ever coming in contact with it).

the energy magic system is a newer idea and i have yet to work out the details of that system. as of now energy magic is dependent on elements as well, although usually in the form of metals (rings, bracelets, etc.), and medicines. different "spells" (these really aren''t spells, but i''m using this term for lack of a better one) can be created by stringing together different methods of energy manipulation (concentration + conduction = lightning).

thus, each element and each energy manipulation technique has it''s own properties which can be combined with other elements and techniques to produce new and different effects. all that it comes down to is organizing well the singular magical effects that you want to be able to produce. just break every spell down into its most basic components and use those components as building blocks towards larger and more powerful spells (and like you said, "larger" spells are not necessarily more effective than "smaller" spells).

i know that this probably doesn''t help you in your situation, but this is just how i chose to deal with the problem that you are describing. now dont go stealin my ideas, ehe heh.
ill find me a soapbox where i can shout it
You know instead of making something as complicated as that you could just create a sub. and within it write your spell creation program. You could allot a certain ammount of points to add to attributes such as Casting time, damage, %of success. They could include a description, assign the type of damage it does if you doing that like.. Fire ice etc. Then the type of spell like you were saying, teleport, heal, damage enemies, summon and so on. And then Depending on what language your doing this in you could have an option for different colors and Shapes, things along those lines. The system you were talking about seemed really complex.
-Trying to sound smart-Check out:www.digitalvigilante.comwww.crash.to/crashware
quote: Squaresoft made a game that was never released in american specifically because of it''s magic system. You had to hook up a keyboard to the SNES, and type the name of the spell you wanted to cast. Now, here''s the trick, it had six characters, and hundreds of Kana symbols, leading to a couple of million spells. Most didn''t work, or the effects were odd.

Rather then produce a programming language for spell casting, why not try something similiar. You could also take the basic key words and weight each one with an MP cost. Then, adding together words eats up MP. Your fire arrow attack thing,

FIRE ARROW DOUBLE
5mp + 2mp + 10mp = 17mp for a long distance fire attack that hits twice.


(Nods sagely ) Rudora no Hihou. Good game, that... I plan to learn written Japanese someday, in great part because I HAVE to play that game properly. I have a copy, but it''s damned hard to play if you don''t understand Japanese. ...although, I did make one or two REALLY cool spells, just typing in random things.

How about charging more MP (or whatever) for how complex the spell is? Reward the player for clever and simple combos that have great power, and punish him for using ten lines of pseudocode for a basic attack spell! Show them what it''s like for us programmers!

A sub-idea I just got is that certain commands might cost more than others, to help balance things.

Mind you, you''d have a NASTY balancing job ahead of you assigning MP costs to a bunch of pseudocode commands, but I''m sure it''s possible to get a satisfactory result this way.

As for avoiding infinite loops... don''t give them a BASIC-like GOTO equivalent. Only give them a FOR...NEXT STEP 1 equivalent, and charge them for the commands within as they are executed on each loop. And if you allow functions/subroutines, don''t allow them to be self-calling. That''s fairly easy to prevent: the "program" simply aborts if it tries to run a function that''s already up and running.
Advertisement
Thanks for all the replies.

I am not saying this idea is completely original, Ultima Underworld I/II and 4 Crystals of Trazere/Ledgend are some of my favorite games. Arx Fatalis looks quite interesting too, but what I am looking for is not programming a couple dozen spells and making each spell have its own combination of runes, or something quite as simple as Trazere.

As I said I want my system to be more like a language with its own rules and can be understood, like a program being compiled. Unfortunately, as the way it stands right now it is too ugly and complicated.

I have been experimenting with other ways of representing it, such as nouns, verbs, adjectives and adverbs.

I have also been experementing with a graphical method which is probably my best bet. Spells can be made of icons with arrows pointing to other icons, kind of like a flowchart. Then you can make an icon for that spell, so you can use it when you make other spells. It still has some of the same problems, sonce it is the same language after all.

My dilemma with infinite loops and recursion is that they can be very useful, but it has too much potential to unbalance the game.
The sentence below is true.The sentence above is false.And by the way, this sentence only exists when you are reading it.
you could solve recursion/looping by decreasing the cur_effect amount each time you go to the next spell instruction... until it gets below a certain threshold at which the spell fizzles.
Some other possible solutions to the recursion/looping problem:

If every word in the spell takes a certain amount of magical power to use and you get stuck into an infinite loop (or a big loop), the spell caster would run out of magical power and the spell would fizzel/spellcaster fall unconscious/etc. (remember magic has traditionally been fickle)

Limit the number of loops that a spell caster can have in a spell based on his magical power.

Third and prbably easiest solution. When was the last time you were reading a book (other than those choose your own adventur) that had a line that said "Read the next paragraph 5 times then goto page 60 if the third word is train". When I think of magic the words loops or recursions never come to mind at all, so don''t allow them.
KarsQ: What do you get if you cross a tsetse fly with a mountain climber?A: Nothing. You can't cross a vector with a scalar.
Natural language would be awesome. Create a complicated, but logical grammar. (A friend did this in a pen&paper rpg, where the "magic language" was Turkish.) Using the grammar of some odd language will give you the logic automatically. This way the player really has to learn magic, reading scrolls and books.

Imagine the player having only two spell scrolls in the beginning, one that says "Muk Para" and one "Tuk Goot". The first would heal himself, the other burn an enemy. He might try "Muk Goot", and burn himself. This way, the player has already learnt a few words of magic, and feel like a really elite wizard apprentice. Awarding the player would be easy and logical and fun, giving random words or sentences, that he could study and mix into his own spells.

And put in a lot of evil words, to stop the brute forcer. A few accidental times of "Summon Sheep Suicide" should cool down anyone.

The spell interpreter must be a good one. Not one with hard-coded spells, but one that really parses the spell, and creates the effect.

You game sounds like it has potential, and when you have a playable version, please put in in the Announcement forum .

This topic is closed to new replies.

Advertisement