Re: Proposal for the skills array

From: Tseran (
Date: 11/04/02

> MAX_SKILLS is further defined as 200, and I expect that many coders
> increase that number.  Thus, the skills array takes 201 bytes of memory
> for each player--not a big deal.  However, stock CircleMud further
> loads
> some 1397 mobs (of 569 different types).  At 201 bytes of memory each,
> that's a 274kb increase in the MUD's memory foot print.  Add more
> mobs/skills, and that will get even larger.  One of the coders I work
> with
> actually did this (with MAX_SKILL defined at about 500), and the memory
> footprint went up by almost 3 megs.

Which is why I was thinking give it a struct all its own, and for those
mobs that don't use skills you can assign a "dummy_mob" to it, so that
it doesn't eat up the memory, just take the memory of those that need
it.  However....

> A better approach is to use a simple linked list of skills that each
> mob
> knows.  This increases the memory footprint of each mob by:
>   sizeof(void *) + sizeof(skill_level_type) * num_skills_known_by_mob

THIS idea looks a heck of a lot more feasible and useful, especially
since even the most talented mobs will at most have a small number of
skills.  The only thing that will need to be worked with is the copying
of the struct from the protos, but that shoudln't be too hard.

Thanks for the idea, it will be a lot easier to implement and set
forward, and use a lot less memory....although on a system with 768
megs, a couple megs to the MUD isn't much....unless I am playing my 3d
games on it at the same time ;)
Now with PGP Encryption!  Ask for your public key TODAY!

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT