Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Programming spells

22 views
Skip to first unread message

MikeB22198

unread,
Nov 30, 1995, 3:00:00 AM11/30/95
to
How would you program spells in a game?

Individual code for each spell?

Alex Schroeder

unread,
Dec 1, 1995, 3:00:00 AM12/1/95
to
On 30 Nov 1995 17:34:17 -0500, MikeB22198 wrote:

> How would you program spells in a game? Individual code for each
> spell?

That's what I did. Some spells can be grouped tho, since their effect
only varies in quantity (eg. killing up to 10 people, or killing up to
1000 people). In these cases the spells can be put into an array with
the respective name, level, cost, description and effect, and this
group of spells can be handled by the same functions (using the array
index). In my game there are several groups of spells: combat spells
killing people, combat spells healing people, and a lot of indiviual
spells such as water poisoning, fire infernos, teleportation etc. The
individual spells are all coded individually (one big switch
statement). Before the switch which makes alle the effects, there is
one common part, checking for the ability of the unit to cast the
spell, deduce the money needed etc.

My game is a translated, improved version of Russel Wallace's game
Atlantis 1.0. (I hope that I got his name right, from the top of my
head).

Alex.
--
Grofzg! Mofzg! NagaNnaga! NnnaAARGHGAA! Agha! Naganahhagga!
PGP public key available on request from al...@zool.unizh.ch

Larry Smith

unread,
Dec 1, 1995, 3:00:00 AM12/1/95
to

In article <49lbh9$1...@newsbf02.news.aol.com>, mikeb...@aol.com (MikeB22198) writes:
>How would you program spells in a game?
>Individual code for each spell?

Time for someone to post mage2mage again, I guess. =)

Magical programming languages are neat in theory but
I've found they don't usually work well in practice.
Few people are of the particular bend of mind to whip
out a notebook and pen in a game situation and start
roughing out code for a new spell - and frankly, alpha
code spells are enough to really scare you. I've gen-
erally found them useful only for a gamemaster to create
new spells for a particular game milieu - it helps avoid
killer spells and other such balance problems. In nor-
mal use, I find spell lists win, hands down. Interested
in hearing from others about their experience, though.

Not that I haven't diddle up a spell language or two in
my time, you understand. They _are_ compelling things.

Anyone here read Cook's Wizardry series? The Wizardry
Compiled, the Wizardry Cursed, and one other whose name
escapes me now?

--
Larry Smith - My opinions only. Killfile slac...@ix.netcom.com, tau...@ni.net
The attempt to justify an evil deed has perhaps more pernicious consequences
than the evil deed itself. The justification of a past crime is the planting
and cultivation of future crimes. -- Eric Hoffer Digital Unix: 64 bit _now_.

Robert Casey

unread,
Dec 1, 1995, 3:00:00 AM12/1/95
to
> On 30 Nov 1995 17:34:17 -0500, MikeB22198 wrote:
>
> > How would you program spells in a game? Individual code for each
> > spell?
>

Either that, or if you are into object oriented programming, you
could classify spells and create separate objects for each.


-----------------------------------------------------------;------------
Robert Casey, Data Control Technician |\
IRIS Data Management Center ..... .. .,^ /\ | \ /\ .....
1408 NE 45th St. ~ ~ ' \| ! ~~
Seattle, WA 98105 ;
------------------------------------------------------------------------
(r...@iris.washington.edu)


Wolverine

unread,
Dec 2, 1995, 3:00:00 AM12/2/95
to
Larry Smith (lar...@enemax.zk3.dec.com) once had a thought :

: In article <49lbh9$1...@newsbf02.news.aol.com>, mikeb...@aol.com (MikeB22198) writes:
: >How would you program spells in a game?


: >Individual code for each spell?

: Time for someone to post mage2mage again, I guess. =)

I think so! What version is it up to now? the last one I saw ( and that
was a while back) was v0.88...

Can someone post it or at least point to a ftp/web site!

Ta!

Mike...

--

Larry Smith

unread,
Dec 4, 1995, 3:00:00 AM12/4/95
to

In article <49pp2t$e...@goanna.cs.rmit.EDU.AU>, s931...@arcadia.cs.rmit.edu.au (Wolverine) writes:
>Larry Smith (lar...@enemax.zk3.dec.com) once had a thought :

>: In article <49lbh9$1...@newsbf02.news.aol.com>, mikeb...@aol.com (MikeB22198) writes:
>: >How would you program spells in a game? Individual code for each spell?

>: Time for someone to post mage2mage again, I guess. =)

> I think so! What version is it up to now? the last one I saw ( and that
>was a while back) was v0.88...

That's the latest. It can be had from Games-request. Send
this message:

To: Games-...@monosys.com
Subject: archive

READ tar.gz (or tar.Z or zip - whatever you like)
m2m.dir
END

John Connors

unread,
Dec 5, 1995, 3:00:00 AM12/5/95
to
Robert Casey <r...@iris.washington.edu> wrote:

>> On 30 Nov 1995 17:34:17 -0500, MikeB22198 wrote:
>>

>> > How would you program spells in a game? Individual code for each
>> > spell?
>>

> Either that, or if you are into object oriented programming, you

>could classify spells and create separate objects for each.

Interesting, you could build a logical spell system this way. Call a
proto-spell the Philosophers's Stone, let it inherit properties from
other spells, let the inheritance rules of a new spell and the
properites of the spells it inherits from determine the properites of
this new proto spell.

This might be a way to bulild a totally - logically consistent but
rich and detailed as well as infinitely extensible spell system!

>-----------------------------------------------------------;------------
>Robert Casey, Data Control Technician |\
>IRIS Data Management Center ..... .. .,^ /\ | \ /\ .....
>1408 NE 45th St. ~ ~ ' \| ! ~~
>Seattle, WA 98105 ;
>------------------------------------------------------------------------
> (r...@iris.washington.edu)


-------------------------------------------------------------
jo...@bitscorp.com | My employer pays me to code
joco...@cix.compulink.co.uk | *not* to express his opinions!
--------------------------------------------------------------


Damian O'Dea

unread,
Dec 7, 1995, 3:00:00 AM12/7/95
to
lar...@enemax.zk3.dec.com (Larry Smith) wrote:
>
>In article <49lbh9$1...@newsbf02.news.aol.com>, mikeb...@aol.com (MikeB22198) writes:
>>How would you program spells in a game?
>>Individual code for each spell?
[snip]

>Magical programming languages are neat in theory but
>I've found they don't usually work well in practice.
>Few people are of the particular bend of mind to whip
>out a notebook and pen in a game situation and start
>roughing out code for a new spell - and frankly, alpha
>code spells are enough to really scare you. I've gen-
>erally found them useful only for a gamemaster to create
>new spells for a particular game milieu - it helps avoid
>killer spells and other such balance problems. In nor-
>mal use, I find spell lists win, hands down. Interested
>in hearing from others about their experience, though.

Mind you, there's nothing to say that you couldn't knock up an OO
spell system as the basis of your magic system for a campaign
world. The spells as presented to the players are generally just in
lists with the effects generated. When players get to the point of
wanting to perform magical research, you can look at the sort of
thing they want to do, and attempt to place it into your spell (class)
hierarchy. The required extensions to the contemporary magical
practices can give you an idea of how far out their spell concept is,
and how much research is required to "create" the new spell. Of
course, this technical and formal system of magic would probably
be best left in the background of the mechanics, with a more
evocative and flavoursome Magical Theory mirroring the actual
workings of the mechanics.

ODie...
--
=== Damian O'Dea Damia...@dsto.defence.gov.au ===
=== Information Management/ITD ph:(08) 259 5839 fx:(08) 259 5619 ===
=== DSTO - Salisbury, P. O. Box 1500, Salisbury, SA 5108 ===


James R Yingst

unread,
Dec 13, 1995, 3:00:00 AM12/13/95
to
Replying to my own post, to fix an error.

In article <4ahtcs$d...@news.ccit.arizona.edu>,


James R Yingst <yin...@bonaire.ccit.arizona.edu> wrote:

>>Larry Smith (lar...@enemax.zk3.dec.com) once had a thought :
>

>>: Time for someone to post mage2mage again, I guess. =)

>Loren Miller has kindly archived it at:
>
> http://hops.wharton.upenn.edu/loren/Links/grass/mage2mage.rules
^^
I erred. The correct URL is:

http://hops.wharton.upenn.edu/~loren/Links/grass/mage2mage.rules

... stupid tilda!... :-)

Jim Yingst
yin...@u.arizona.edu

0 new messages