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

Re: Ideas for speeding up



> IMHO, it is better to enlarge the archetype struct, because stronger
> goblin's (or whatever) can be made in the archetype-file (just create
> another monster (ex: gobling_strong) with the same graphics, but better
> hp, dam, etc..)

Yes, those monster, which can used all maps, but if you like make normal
goblin, which runs away from player and so that player must catch it 
before killing it. You could make all special monsters archetypes, but 
in other maps they would be quite useless. Crossfire seems to be moving
towards Ultima/Nethack style instead of Gauntlet, so all individual
monsters/items makes maps more interesting, IMHO.

> Yep, you're right, maps are _BIG_. The only way to reduce memory usage, is
> to reduce the size of an object. (a map almost totally consists of objects)
> That is done, as I already said, by moveing data to the archetype. Which
> is used via a pointer > only 4 bytes (+ sizeof(archetype) ) covering
> a lot of data.

One solution which allows special items on maps and also would reduce
size of object struct, would be divide object struct two part. Other
would contains all fields, which change during play like hp, exp and 
so on. Other part contains variables, which are static during objects
lifetime, like colors, animation. These variables could be behind 
pointer, which normally points all objects to archetypes one, but 
special items could have own struct. This struct could have allocated 
in load_map(), so it wouldn't change other code too much.

Somewhere flexible editing could even save memory, like setting 
no_magic on floors, so you don't need use that no_magic object.

> Thanx, patrick van logchem (v912152@si.hhs.nl)

 - Tero

PS. Those who needs dm-character for example playtest maps or
some other debugging, and are tired of fixing stats every time,
can try following: save some normal player, and then modify with
your favorite text editor player-file. Add following lines 
flying 1
was_wiz 1
wiz 1
and fix stats, exp and other so you are satisfied. And after 
saving fix permissions read-only (i.e. chmod 444 dm.pl).
After that you should have dm-character without different
going to dm mode ;) This works only if you don't use checksums.