Re: Magic System - Parsing

From: Dhrydan (dhrydan@NS2.DEATHSTAR.NET)
Date: 05/05/98

Greetings all...Bit-of-a-time lurker, first time poster...

I do hope no one minds me clearing my throat and jumping right into the
issues at hand, but the topic caught my eye as the rewriting of the magic
system is a current project on the MUD which I'm currently working
me disclose in the beginning that I know how to code pretty well (I'm a
graduating and soon-to-be-employed CS student/Programmer), but I'm new to
the Circle community.
  I'm not quite sure what proper 'response ettiquete' is on here, so I'm
going to hack-and-edit, and hope no one gets to annoyed...

Ghost Shaidan once formed the pixels to read:

: > ->Are there any plans to revamp the magic system in circle?
: >
: > I doubt there are any plans for rewrites or revamps of major systems
: > in the code at this stage in development.  However, if you come up
: > with some good reasons why it should be done, it may (or may not)
: > happen (eventually).

It's a shame it is the way that it is. I personally looked over
DIKU's/Circle's implementation of skills/spells and really wasn't too
with it. On the MUD I'm coding on, we've removed the original code for
skills and spells, and are rewriting it from the ground up. In the
we've begun parsing out both skills and spells in the same routine instead
of treating skills as ACMD's.

  As a whole, the act of consolidating the systems allows much more
flexibility in the SS (Skill/Spell)code, but it's cropped up as a huge
in the parsing/interpreting phase of the code. As it stands currently,
had to make special exceptions for multiple-argument skills (ie, steal) as
the old interpreter was set up to parse multiple-word spells fine, but not
multiple-word arguments.

  On the positive note, consolidation does wonders for controlling the
from a central location, allowing for a lot of code reuse in SS assigning
pre and post-"lag" and working into a sphere/school/category system
design aspect). In addition, we dumped the "learn/practice" system, and
working with a SS-centric acquisition which losing the spell/skill
distinction does wonders for simplicity and makes the code much more
elegant. :-)

As a form of discussion, I was wondering if anyone had input into the
parsing issue. I am currently thinking about designs to allow for a very
elegant spell parser and executor. My first hurdle is the parser...In
particular, how to deal with multiple-word spells and multiple-word
arguments. At current, I'm thinking about either tokenizing the input in a
fashion similiar to C's argc and argv[] main parsing technique, or
hashing the SS list in a manner similiar to the way a UNIX shell does.
  Is there anything out there on command hashing/alternative parsing in
relation to Circle? I've never really set up a hash table in C (PERL's
associative arrays does it for you *grin*); anyone have pointers and
warnings in regards to hashing in Circle that they'ld be willing to share?

: Categories of spells, Call the schools and spheres if you want, but an
: extra bit in the spello to identify the type, healing, protective,
: firedamage, acidamage, magicdamage, etc.  This will allow eq and mobs to
: offer/have resistances against certain affects.  Forexample, that nifty
: ice shield is probably going to melt very quickly when you get hit by a
: fireball spell...

This part of the code has a lot of promise, I would throw in
*grin* As a side note, I've also found spell 'typing' very useful for
flow-control functionality (ie, type="damage"; func = "ss_damage()").

>Further development/rewriting of the spell-component code.  Not for all
>spells, just for some of the more powerful ones.  Also something to do
>with different levels of holy symbols perhaps.

This would be very interesting. I had also had the thought on specifying
'verbal' vs 'non-verbal' casting. Although the reason for this was the
of adding in 'silence' room flags which could be effected by spells ('Cone
of Silence' or perhaps on characters with a 'Mute' effect).

Last (Side) Question:
  I'm having a problem with gcc ("truncation of literal"s)...What would be
the best forum/targeting for the question?

Clifford Skalaski
Last Year Computer Science Undergraduate
  University of Pennsylvania, School of Engineering

     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST