[CF-Devel] Spell list

Michael Toennies michael.toennies at nord-com.net
Fri Mar 2 11:02:20 CST 2001


Hi

I had wrote a spell list menu.

Because we have 20 (+NULL) spell path, i create a spell panel.

pressing 1 - 0 brings you in one of the 10 pages.
In every page are 2 (or 3) spell path listed, left wizard spells, right
priest spells.

You can browse with cursor keys through the list.

Every page has 2 * 26 entrys - from a to z.

Pressing 'a'-'z' will invoke/cast the wizard spell in the page.
Pressing SHIFT 'a'-'z' will invoke/cast the priest spell.

This means, you can with a 3 keys combo invoke/cast ALL spells in the game.

you can see this in this demo picture:

     
     http://mids.student.utwente.nl/~michtoen/spelllist/spelllist.png
     
     

You bind a command like '?spelllist cat' to a key, this will open the
spell list in cast mode (TAB will also change the mode if the menu is open).
Now you can press 1 - 0 to open the page, and a - z to invoke the spell.
Same with invoke. So no need to bind a cast command to any key anymore.

Here are pics from all 10 pages with all spells i had included.

     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page1.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page2.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page3.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page4.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page5.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page6.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page7.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page8.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page9.png
     
     
     http://mids.student.utwente.nl/~michtoen/spelllist/sl_page0.png
     
     

Also, i draw for all spells a icons. Blue one for wizard spells, green one
for priest.

I put the icons here online.
     
     http://mids.student.utwente.nl/~michtoen/spelllist/icons
     
     

Peter will work through spell list text file i droped here
     
     http://mids.student.utwente.nl/~michtoen/spelllist/cfspell.txt
     
     

Every spell entry has a name, data values for type (w,p) row in a page (a-z)
and the
page (1 - 10). Then you can add a spell icon name and 4 text strings with
spell
descriptions and informations.

This kind of list can hold 10*26*2 spells = 520 spells. At this time we have
around 200
spells, so it should fit for long time.

At this point, whole thing is client side.

Means, i can't really decide, how on server side is the status of spells.

Of course, i can use 'cast' and parse the spell list, but there can change
many
things on server side, i never will notice on client side - or i have to
parse many
things (god gives spells, denied spells, you learn spells, you lost spells,
etc).

Also, with every change in this areas on server side, the client will then
be outdated.

Whats about to make this stuff server side?
It will be not many work.

Adding the icons as faces are trivial and it will fit in what we have.

For the spell data, means

<name>, <spell list data>, <description>, <data (level, path)>

we can create on small text file for each spell (like an arc file). This
text file

Now, when a player open a spell list or do something with the client, the
client
can ask the server for this data.

We use the checksum for it!

Means, the server had the spell data as little text file saved/loaded and
generate a checksum for it.
Now the client saves a spell entry as little text file (like a arc on server
side) and generate for it
his own checksum.

When a player now log in a server, the server collect all spells the player
knows and send AT GAME START
cmd like this:

SPELLLIST <nrspells> <spelltextfilename> <checksum> <spelltextfilename>
<checksum>

Now the client init for a player the spell list. Means, the client try to
load the spelltextfilenames!

If the text file not cached or the checksum is invalid, he sends a GETSPELL
<spelltextfilename> to
the server. When the spell is new, he must/can ask for the face too - the
number of the face is
in the spell text file data.

Thats all!!!

Now we have a unique spell list for every player!!!

Means, the player sees all time really the spells this character can cast.

Now, when a player gets/learn a new spell, the server sends simply a new
SPELLLIST cmd... only with
the new spell, its a simply add.

For losing a spell, we need a REMOVESPELL cmd or a SPELLLIST
<spelltextfilename> <checksum == 0),
this will work too (the checksum is when valid never != 0).

Great is, that we can now change spells like faces. Update will work
automatically.
If we add new spells, the player SEE it and can read the description.
Also, when we change spell behaviour, we can update it on the fly with
changing the
description.

What we also need, is a SPELLSTATUS cmd. Means, we can send the client the
actuell data as
the spell is denied, how much mana it cost etc.

This is not really needed but it will make the thing perfect.

The nice thing is, that when we include it in this style, updating and
changing will start be
very easy.

Also, we can skip sending the whole spell list after we send a invalid
cast/invoke cmd to the server.
A level >25 char has some spells - the list you get with cast is long!
Pressing a key with a invalid
spell will cause sending the server this list a few times per second. For a
list of 1kb text data
this is not nice.


    
    


More information about the crossfire mailing list