Advertisement

'Ultimate' magic system

Started by March 19, 2003 01:24 PM
13 comments, last by Shylock 21 years, 10 months ago
I am trying to create a game that is as player modifyable as possable, so that players can easily play pretty much any character. I have managed this easily in all respects, apart from the magic system. I want a magic system that can manage to use any spell that may apear in other games. I imagine this probably means spells seperated into fairly generic types (missile, heal ect.), but can anyone come up with a way to make spells do anything?
humm...
i think..

maybe some type of data file about the spell that would be loaded at runtime.. and you would have all the data about that spell in the file, like spell name, animation sequence, effect stregnth (damage, whatever), general effet(healing, attack, whatever), magic power used, range,special abilities given to the user, requirements, etc.

you could then make a utility to modify those files so the user could customize the spells.

note the user couldn''t make a spell that you didn''t code for, for example, if he wants a spell to make his health go up, then you would have to allow that in your code. it should be fairly easy though...

the only problem woudl be to get your program to recognise the file, no matter what the name is. you''ll figure out something.

Also, you may not want him to have a spell that''s too powerful, so you may have to restrict him to certain stats in the spell editor.

hope this helps...

Programmers of the world, UNTIE!
Advertisement
I was thinking that perhaps the game could have an inbuilt editor, it would be very little hastle. But the problem is that I am unsure of how to devide spells up. Should spells simply modify the targets'' statistics in varing amounts and under varing condtions (if they are withing a certain range for example)?

Can anyone think of any spells that do not simply, hurt, heal, speed up, slow down, wear out/ envigorate the target? There are some, such as summon and charm... are these important to people?
Thinking about it, just modifying the statistics I have would be easyily good enouth. I can just make it so that the player chooses which statistics of the target change in what way (health up for heal, down for hurt for example). The spell then wares off after a certain amount of time (making healing spells a little more interesting, as the target could suddenly die later), taking its effects back.

Because their are several statistics that could change, certain spells would be easy to produce with a little cunning (fear for example would reverse their direction and increase their speed to make them run in the oposite direction).

Sorry I started this post and came up with an answer so soon after. Is there a way to delete posts? I doubt this will be of much use to anyone.
you could use a scripting language, which could have access to any data in the game. while it would probably be a bad idea to let players just write scripts and run them, it would allow you to have any kind of spells.

you could change any player stats, change effects, edit the map, or whatever, and even throw in nifty particle effects and such.
--- krez ([email="krez_AT_optonline_DOT_net"]krez_AT_optonline_DOT_net[/email])
If you want flexable system, why don''t you allow the player to build spells within the game?

Say, by using magic runes. A spell can be defined as a sequence of runes that follow some logic. For example, you could have "target" runes like "self", "ally", "enemy" which are combined with "effect" (heal, damage, fire) and maybe "form" such as missile, sphere, line.

Then you give your magic language a grammar, with each spell representing a phrase, such as: TARGET + EFFECT + [FORM] + [MODIFIER], with FORM and MODIFIER being optional.

So a Heal spell could be SELF + HEAL or ALLY + HEAL.
A Fireball spell could be ENEMY + FIRE + SPHERE.
A Super-fireball spell could be ENEMY + FIRE + SPHERE + POWER.

You could even make the magic system as simple or as complicated as you wanted, by using a "Link" rune that could be used to combine spells, to produce new effects.

If properly implemented, this would just be a simple type of scripting system. Each spell could be seen as a sort of magical ASM instruction.

Anyways, just an idea, and I think it would integrate much better in a game than predefined, external scripts.
Advertisement
t-o-m-e uses a rune based magic system, perhaps taking a look at that would help?

tome website


My rather foulmouthed asteroids applet
I think a rune-based magic system could be _VERY_ flexable, because you can make the first rune pick a function from a scripting language (like use it as an index into a table), and then have other runes do things like pick the target, amount of damage, and any other parameters for the function. Maybe even have the second rune pick the special effect, so you can have spells that do the same thing but look different. You still need to make various basic spells, but really most spells fall into a few small categories, like healing, direct damage (that only varies in the special effect), timed damage (like poison attacks), delayed damage (like putting a trap on a chest), drain attribute (one rune would pick the stat to drain), steal (life, mana, strength etc chosen by a rune), disable (special effect varies, like a stun icon, or being trapped in a whirlwind, etc etc).

The reason to use a rune system as an interface to the scripting language is so you still have control over what is possible. If you let players script their own spells, they would find a way to do something like "enemy.health = 0" and make it cost the least amount of mana possible. With a rune system, you have more control over mana cost etc, and if you want to make spellcasting hard, you could even make runes dissapear after use, so you have to keep finding them over and over, and the powerfull spells would be rare because there would only be a few places you could find that rune instead of it being everywhere like the weak runes.

For example, you can buy the 'direct damage' rune anywhere, and you can buy the rune that makes it do '1' damage anywhere, but there is only one rune in the whole world that makes it do '1000' damage, so finding it would be a real treat, and it might be the only way to kill the evil dragon overlord. It makes for more exciting play (imo), and if it dissapears once you use it (maybe it teleports to a random place in the wilderness for another person to find), finding it is a big deal.

[edited by - Extrarius on March 20, 2003 10:59:29 AM]
"Walk not the trodden path, for it has borne it's burden." -John, Flying Monk
I seem to remember a few "pick and match" type magic systems in existing games. Wher basically, you pick a spell type, like missile, temporal, matter creation, or whatever categories you can come up with, and then add a damage type (Heal, fire, cold, lightning, and so on), and maybe a few other attributes like how powerful the spell should be, and maybe some kind of side effects too. That way, the player can pretty much pick what he likes (So you can make, say, a fireball by picking missile type, fire damage, and maybe some kind of burning effect (DoT))

The problem with that is that spells tend to become rather anonymous or dull, since every possible spell in the game is basically revealed to you from the beginning. (YOu get these spell types to chose from, these damage types, and later in the game, you''ll just be able to make them more powerful, but still essentially teh same spells)

---------
Life is like a grapefruit. It''s sort of orangy-yellow and dimpled on the outside, wet and squidgy in the middle. It''s got pips inside, too. Oh, and some people have half a one for breakfast
Wow. I had forgotten about this post . Thanks for your help everyone. It seems that some kind of rune system is very popular overall as a way to let player ''compose'' spells. I like the idea of runes ''disaperaing'', I''m just wondering... I don''t want to actually use ''runes'', as the system is a little over used in general. But somthing simalar, just a flimsy discuise for runes. Maybe familiars? Familiars could be collected of different types, and each could have a use in each of the different spell component types, so you could use the fire familiar and the slime ball to make a fireball.

Or you could give familiars items (maybe runes made of different meterials) and have them cast a spell depending on an item, a rune and themselfs.

This topic is closed to new replies.

Advertisement