Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Skills as inventory items (Re: Merged proposal)





Tero (> >) and Brian (>) write:
> >                      [...] memory requiments have to considered.  If
> > they are handled as invisible inventory objects then it slows both the
> > normal inventory handling and skill handling code.  Since each skill
> > needs only about 16 bytes memory it also wastes memory.  The simple and
> > efficient method is make a pointer to a skill table or a pointer to table
> > of skills pointers.  This would need some own code for skills and looses
> > flexibility that object only solution offers, but also removes many
> > other problems, IMHO
>
>	Yeah. I have thought about creating a separate structure for skills,
>	and having a pointer to a linked list of skills in the object 
>	structure (so players and monsters can both use). Would improve 
>	speed and memory, but coding such a thing takes time [...]

How about a skills container object?  Make this always the first item in the 
inventory and it's easy to navigate to, and skipping over one item is going
to be faster than skipping the possible multitude of skills that would otherwise
clog an inventory list.

I don't think you'd have to do much work, since you can already customize 
containers to limit the sorts of things which they contain.

--Ken

+------------------------+---------------------------------------------+
| Ken Woodruff           | Most Latin words in -us have plural in -i,  |
| woodruff@cadence.com   | but not all, & so zeal not according to     |
+------------------------+ knowledge issues in such oddities as hiati, |
| Disclaimer: What tote  | octopi, omnibi, & ignorami; ...             |
| bag full of $20 bills? |     Fowler, "Modern English Usage"          |
+------------------------+---------------------------------------------+