On races and classes....

Posted by Tseris on Sun 14 Oct 2007 02:13 AM — 8 posts, 30,594 views.

#0
No, Im not going to ask how to make new races and classes :) This is more of a design theory question. Im making a mud where the tables are turned, and players play the monsters instead of the heroes. Its roughly classless in the sense that if youre a Werewolf, you have werewolf abilities, not "werewolf warrior" abilities, etc. But I dont want to delete classes from the game as I still want to be able to use them for the goodly mobs, and Im of the opinion that the less I remove, the better chance there is of me not removing the wrong thing. Now I have two ideas as to how to go about this:

Option 1: I remove class selection from character creation, and all characters of a particular race are automatically given the one "class" that I assign to that race which has all of the skills/spells I want that race to have. But I remove all reference to that class in anything the player can see. Its only there for code purposes. This has the advantage that should I decide in the future to expand and allow different classes in a race I can, i.e. you can be a Werewolf Hunter, or a Werewolf Shaman.

Option 2: I do the opposite. Remove any reference to race in character creation and score, and all characters are of the same unnamed "race" that only the code is aware of, then I make a Werewolf class, Zombie class, etc. Though of course I dont call it a "class". I just ask what type of creature they want to be. This has the advantage that I can just use the stock Vampire class and not have to change that code since its pretty well developed.

I had a third option in mind a couple days ago but somewhere along the line I forgot it :) Heh, anyone have any thoughts about all of this? And what do I need to modify to change the options players have at character creation?
USA #1
Option 1 seems simpler and with more potential in the future for growth. If you make race generic and make class "werewolf", then when you want to have specialized werewolves, you're in something of a pickle. Option 1 doesn't have that problem.

You'd want to change the nanny function, which is what controls the options given to players as they create their character.
#2
Okay sounds good, but any ideas as to how I resolve the vampire issue? I want to keep the vampire code that is in stock, but will the game allow me to have players make a character that is race Vampire and class Vampire? Ive noticed that in the race file vampire is typed as _Vampire, which makes me think that using the word for both race and class causes problems.
USA #3
It can be used almost as is, in my mud a player can be vampire as both race & class. The biggest thing you have to do is change the part of the function nanny to allow vampire as a racial selection, then set up the vampire race.
#4
Heres the part that concerns me:

write_to_buffer( d, "\r\nYou may choose from the following races, or type help [race] to learn more:\r\n[", 0 );
buf[0] = '\0';
for( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
{
if( iRace != RACE_VAMPIRE
&& race_table[iRace]->race_name && race_table[iRace]->race_name[0] != '\0'
&& !IS_SET( race_table[iRace]->class_restriction, 1 << ch->Class )
&& str_cmp( race_table[iRace]->race_name, "unused" ) )
{
if( iRace > 0 )
{
if( strlen( buf ) + strlen( race_table[iRace]->race_name ) > 77 )
{
mudstrlcat( buf, "\r\n", MAX_STRING_LENGTH );
write_to_buffer( d, buf, 0 );
buf[0] = '\0';
}
else
mudstrlcat( buf, " ", MAX_STRING_LENGTH );
}
mudstrlcat( buf, race_table[iRace]->race_name, MAX_STRING_LENGTH );
}
}
mudstrlcat( buf, "]\r\n: ", MAX_STRING_LENGTH );
write_to_buffer( d, buf, 0 );
d->connected = CON_GET_NEW_RACE;
}

void nanny_get_new_race( DESCRIPTOR_DATA * d, char *argument )
{
CHAR_DATA *ch;
char arg[MAX_STRING_LENGTH];
int iRace;

ch = d->character;
argument = one_argument( argument, arg );
if( !str_cmp( arg, "help" ) )
{
for( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
{
if( toupper( argument[0] ) == toupper( race_table[iRace]->race_name[0] )
&& !str_prefix( argument, race_table[iRace]->race_name ) )
{
do_help( ch, argument );
write_to_buffer( d, "Please choose a race: ", 0 );
return;
}
}
write_to_buffer( d, "No help on that topic. Please choose a race: ", 0 );
return;
}


for( iRace = 0; iRace < MAX_PC_RACE; iRace++ )
{
if( toupper( arg[0] ) == toupper( race_table[iRace]->race_name[0] )
&& !str_prefix( arg, race_table[iRace]->race_name ) )
{
ch->race = iRace;
break;
}
}

if( iRace == MAX_PC_RACE
|| !race_table[iRace]->race_name || race_table[iRace]->race_name[0] == '\0'
|| iRace == RACE_VAMPIRE
|| IS_SET( race_table[iRace]->class_restriction, 1 << ch->Class )
|| !str_cmp( race_table[iRace]->race_name, "unused" ) )
{
write_to_buffer( d, "That's not a race.\r\nWhat IS your race? ", 0 );
return;
}


Why all the checks for RACE_VAMPIRE? This still being stock SmaugFuss 1.8, I know you cant start as a vampire race, so Im not sure whats going on here.
USA #5
Those checks are there so that you can't play a vampire as your race in stock SmaugFUSS 1.8, but you already knew that was the case before you started this, no?
#6
Yes I knew this, but also knew I that a vampire race is crucial to my game, so what I decided to do what leave the stock code alone and basically ignore the _Vampire_ race which is #5 on the race slots and gives so many people on here so many problems, and just setrace Vampire, to create a whole new race (which happens to be #20 on my mud) and go from there.
USA #7
That probably is the easy way, but race _vampire, #5, isn't that hard to use either. *shrug*