Re: Mobs and player_specials

From: George Greer (greerga@circlemud.org)
Date: 03/12/01


On Mon, 12 Mar 2001, Garringer, Mark wrote:

>> If you really wanted to give your mobs a player_special_data,
>> then go for
>> it.  It's just a waste of (a lot! of) memory though.
>>
>> greerga@moving:~/mud/circle30bpl16$ gdb bin/circle
>> (gdb) p sizeof(struct player_special_data)
>> $1 = 324
>> (gdb) p sizeof(struct char_data)
>> $2 = 300
>
>I assume this is done for giving mobs skills? That is what I have done in my
>MUD, and not being familiar with gdb I tried the above and got:

Mobs don't have a player_special_data so you save 324 bytes over including
it. If you wanted to give them individual skills then you'd have to suck up
the extra 324 bytes to do it.  The idea is that there are enough mobs that
saving 324 bytes (or more) is worth it.

>$1 = 324
>$2 = 528
>
>What does that mean, exactly?

It means every player/mob takes 528 bytes (+ strings, which aren't
counted) and you save 324 bytes per mobile that would have otherwise been
allocated without dummy_mob.

--
George Greer
greerga@circlemud.org

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/04/01 PST