• Create Account

Interested in a FREE copy of HTML5 game maker Construct 2?

We'll be giving away three Personal Edition licences in next Tuesday's GDNet Direct email newsletter!

### #48CGameProgrammer  Members   -  Reputation: 640

Like
Likes
Like

Posted 22 August 2000 - 02:27 PM

The idea of scripting your own spells seems cool. I might try it myself (programming the system into my game, I mean), but not the way some of you have illustrated.

I don't think many people will like having to type long lines of text to cast spells. I think they should be able to script their spells, either using a text or graphical scripting system, within constraints dictated by what disciplines they chose to learn, and of course their own experience level. Each spell would then have its own button in a spell-selection window, which you can hotkey.

So if you write a text script like this:
FistOfFlame # The name of the spell is "Fist of Flame"{    if( stillactive )        cancel; # Spell is already cast; don't cast it again.    cast fire Flames;    Flames.SetSource( RightHand, Attached );    Flames.SetDamage( 10.0 );    Flames.SetDuration( 30.0 );}

The game might scan the script, and based on the damage and duration specified, it will determine the spell requires a Fire Mastery of 4 and uses 20 Energy (mana) to cast. And each time the mage punches something, the creature he punches will recieve 10 damage points.

But if this slightly different script is written:
Fury{    cast fire Flames;    Flames.SetSource( RightHand, Attached );    Flames.SetDamage( 10.0 );    Flames.ApplyForce( Caster.Orientation.Forward, 1.0 );}

No duration is specified, meaning it's an instant spell, which is also why the stillactive line is unnecessary. It will be continuously cast as long as the user holds the Cast button down. Anyway, since it applies force to the flame, an Air Mastery of 2 might be needed along with the fire requirements. This spell should create a flamethrower-like spout of flame from the caster's right hand.

Then I might have a spell like this:
FireBall{    if( time - lastcast < 1.0 )        cancel; # Fire delay is one second.    cast fire Flames;    Flames.SetSource( RightHand, Loose );    Flames.SetDamage( 20.0 );    Flames.SetPhysics( Floating ); # Instead of falling, bouncing, etc.    Flames.SetDuration( 5.0 ); # Flies for 5 seconds.    Flames.ApplyForce( Caster.Orientation.Forward, 2.0 );    Flames.DestroyOnHit( );}

...and that would create a typical fireball that fires no faster than one fireball per second. Due to the damage and force, it will have higher Fire and Air requirements than FistOfFlame or Fury. The actual rules governing fire, such as how applied force affects it when it's attached or loose, will be built in to the engine.

With a system like this, the user can experiment beyond the usual spells seen in games, to see what is possible. Of course, plenty of playtesting will have to go into this before such a thing will be released.

Edited by - CGameProgrammer on August 22, 2000 9:35:23 PM

### #49CGameProgrammer  Members   -  Reputation: 640

Like
Likes
Like

Posted 22 August 2000 - 02:45 PM

Actually I changed my mind. It''s probably not good to let the user set the damage, duration, or rate of casting; those would have to be determined by the engine based on the user''s mana supply and elemental masteries.

~CGameProgrammer( );

### #50Solthar  Members   -  Reputation: 122

Like
Likes
Like

Posted 22 August 2000 - 03:08 PM

I tend to disagree - what about you being a high level mage, and wanting to cast a weak spell? Did, in you learning of the ways of magiks, cause you to forget the weaker spells?

Basically, doing somethign strongly does not make it better, doing something intelligently does.

### #51dwarfsoft  Moderators   -  Reputation: 1217

Like
Likes
Like

Posted 22 August 2000 - 05:36 PM

SantaClaws: You state that players would hide their spells from others. There is another way that I can think of that would remove the chance for this to work. Make the spell casting routine unique to the player. i.e. You make symbols or power words random for each spell. You could also keep track of whether the player had learned this or not. This way, you can also add in a possible danger in that the player casts a spell that hurts them... A more effective way of controlling cheats .

It also makes it just as hard the next time around when the player already knows spells from their other characters

-Chris Bennett ("Insanity" of Dwarfsoft)

Check our site:
http://www.crosswinds.net/~dwarfsoft/
Check out our NPC AI Mailing List :
http://www.egroups.com/group/NPCAI/
made due to popular demand here at GDNet :)

### #52Solthar  Members   -  Reputation: 122

Like
Likes
Like

Posted 23 August 2000 - 03:51 AM

That is an interestign idea....

Is there any way you know of that would work with the aforementioned ''spell scripting system''?

### #53Whirlwind  Members   -  Reputation: 134

Like
Likes
Like

Posted 23 August 2000 - 04:18 AM

Instead of scripting, why not a drag and drop screen - you drag some spells in the order you want to cast them onto a scroll, then read the scroll to try your new spell.

### #54pax  Members   -  Reputation: 122

Like
Likes
Like

Posted 23 August 2000 - 05:46 AM

A lot of these ideas are in my system already (brag, brag). The interface for creating spells would be graphical. The player strings together a series of elements that are translated into the spell script. The player never writes the script (possible option for advanced players).

As for power, the cost of the spell will be directly related to the magnitude of the spell (damage, range, duration, etc.), so if I want to cast a fireball as a newbie, I can only afford to make it go so far and do very little damage, but as a higher level mage, I just up the values and suddenly I''ve got the Gates of Hell Fireball up my sleeve. Same spell.

The results of spells are based on the caster and the environment, so not only will the same recipe respond somewhat differently for another mage, but the same recipe for the same mage may respond differently based on the magical nature of the environment. Your fireballs will be unnaturally powerful when cast near the elemental plane of fire, while they may fail altogether near the elemental plane of water. Caves, forests, mountains, oceans all have an elemental effect on the spells. As the mage progresses, she learns to sense the environmental differences and compensate automatically. But a newbie with a complex spell is taking a risk every time he tries to cast that spell in a new area.

Magic is dangerous, and much of that is lost in CRPGs today.

Pax

### #55Solthar  Members   -  Reputation: 122

Like
Likes
Like

Posted 23 August 2000 - 08:00 AM

Pax, Do you mean that you have actually implemented these ideas?
if so - do you have a d/l link, I''d love to see this...

### #56CGameProgrammer  Members   -  Reputation: 640

Like
Likes
Like

Posted 23 August 2000 - 02:10 PM

It may be a good idea to allow the user to set duration, fire rate, and damage, but my thinking is that newbies will have difficulty finding a working combination of values. Also, it is definitely a bad idea to make the values constants, since then to create, say, fireballs of different damage you''d have to make many copies of the same exact spell. It would be better to use some sort of sliders in-game to change these values at run-time, but then people would often be fiddling with them.

In short, I''m not just thinking of what would work for me, but what would work for other people without being too complex or repetitive.

~CGameProgrammer( );

### #57Solthar  Members   -  Reputation: 122

Like
Likes
Like

Posted 23 August 2000 - 05:06 PM

I was looking at BOTH of our systems (mine and pax''s) in depth tonight and have come to one astounding, but true, conclusion.

We are not writing a script, but setting variables.

Look at it! Where''s the loops and the ifs? Certianly, this makes it easy for the player to make spells! But for that extra functionality, give the players an option, if they are greater than a specific mastery in the selected spheres/atoms/aspects to give there magic a limited ai!

Here''s what I propose:

If the mage elects to choose to include a limited ai within his spell (mage compensating for known scenarios), make it cost him. First off - I suggest using a binary tree to hold this elementary AI -- for each decision there''s two, and only two possible outcomes. It would be something like this

.(true)...../Spell.SetState(explode);
IfEnemyNear............./Spell.SetState(explode)
.(false)....\IfMagicNear
........................\Spell.DoNoAi();

or in todays c code it would look like:

if (IfEnemyNear)
Spell.SetState(Explode);
else
if (IfMagicNear)
Spell.SetState(Explode);
else
Spell.DoNoAi();

Make it so each node, or decisionmaking process, of the enemies ai increases the overall cost of the spell, by say 1.5x its normal cost, which means that the aforementiond decisionspace for the spell would increase its cost by 2.25x (1.5 * 1.5 = 2.25)
As you can see, it would add to the power, and it can be kept simple ingame by doing a drag-and-drop on a image of a binary tree.

what do you think?

### #58Dæmin  Members   -  Reputation: 128

Like
Likes
Like

Posted 24 August 2000 - 01:18 AM

Well in terms of spell power I had an idea that the longer the user holds down the casting trigger hte more powerful the spell becomes, and the more proficient that the caster is at that particular sphere the faster the power would rise for the same amount of mana.

Also for the casting of spells (this is from d&d 3rd ed) that casters at the start of the day memorise all the spells that tehy are going to use through out the day, then when they need to they just recite the keyword of the spell that they chose for the day and cast it. this could be easily integrated with the above idea in that when the caster is casting it they say the magic word (hehe) and click on a location target etc, and depending on how long they hold the mouse button down is how powerful the spell gets.

Also I reckon that the caster should have to stay still during the casting of the spell otherwise "the magical energies will be too unfocused" and some sort of mishap would occur, i.e. in the case of fire magic, i.e. casting a fireball while moving the energies would spread around the area where the caster had travelled and therefore there would be an inferno instead etc. and the caster would get injured. This would make casters very wary and fearful for their lives... and remain passive until they can either afford or create someone or something to fight for them...

That''s why you don''t see any powerful wizards fighting with a sword and axe on the battlefield, rather they command great amounts of minions to do the bidding for them.

Dæmin
(Dominik Grabiec)
sdgrab@eisa.net.au

### #59ahw  Members   -  Reputation: 263

Like
Likes
Like

Posted 24 August 2000 - 02:41 AM

Solthar said :
quote:
I was looking at BOTH of our systems (mine and pax''s) in depth tonight and have come to one astounding, but true, conclusion.

We are not writing a script, but setting variables.

I don''t want to be like nagging, but I think we are three people to have told you so already (granted it was on the other thread on Game programming).

As you say, you don''t have any conditional, or loop structure, you only have to set attributes, eventually in an embedded manner (if a spell can call another spell).
And even if you have conditional structures, I don''t think it would be that hard to do (if you don''t allow too complicated conditions).
As I said in the other thread, if you read the Flipcode article on scripting engines, you will see that most of the work goes in the verification, translation and other stuff that a good compiler do. But if you use a graphical interface (a bit like the one in MAcormedia Flash ?) you can make a foolproof system (well, at least you can try more succesfully).

So now, the main problem is how do you generate a spell ?

Personnaly I like the grammar view about it.
A spell is like a sentence.

You have a Verb, an Object, and adjectives and complements to specificy things like size, direction, special effects, etc.

Say a fireball use a verb Create
then in a list of Objects, you choose Elemental, the Fire, then you add adjectives like Shape (ball), Speed (it''s moving) and whateve other things you can add a complement to your sentence "To" which then asks for an Object, you would choose Target, Other (you have to designate a target that the fireball is going to be sent to)

Of course my example is messy and confused, but I am just typing this on the fly, and besides, I just want to give you an idea on what I am taking about.

hope it helps.

youpla :-P

### #60Kylotan  Moderators   -  Reputation: 3338

Like
Likes
Like

Posted 25 August 2000 - 03:36 AM

quote:
Original post by ahw

Solthar said :
I was looking at BOTH of our systems (mine and pax''s) in depth tonight and have come to one astounding, but true, conclusion.

We are not writing a script, but setting variables.

I don''t want to be like nagging, but I think we are three people to have told you so already (granted it was on the other thread on Game programming).

I was one of the others So, is it really all that astounding? Just work out the attributes you need to model, and off you go.

Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

PARTNERS