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

Ideas for speeding up



> Well, coding the AMIGA-port of Crossfire, I had a nice time finding any
> speed-ups and here is what I found (contributions are welcome) :

> - Place all gates and handles in 'object *map->gates'.
>   This results in far faster handling of handles/buttons, because only
>   map->gates has to be checked for corresponding gates (not the whole map!)

Yes, I think this was even TODO list.

> - put all ALIVE, MONSTER and ANIMATE objects in 'object *map->alive'.
>   This way we only parse the needed stuff, not all the passive treasure,
>   handles, food, etc...
>   (This REALLY speed up the amiga-version!)

This is probably even more efficiently, when all walls are changed
objects.

> - Place more data in the archtype.
>   Not for the speed, but more for the memory-usage.

I'm not quite sure, if this is good idea generally. I would like in
future versions see more 'individual' objects, so players can't
assume that when you have seen one goblin, you have seen them all.
Maybe these special items could be implemented some other way, but
currently it seems easieast way just add editor support allowing edit
objects. Another way save memory could be try organize object struct
better (hp have meaning only monsters), but this probably won't help
much, since those variables are already used other meanings too.
unions might help or good documentation and few defines (crossfire.doc
is good, but even it misses special meanings some variables)

I'm not tried compile crossfire in Amiga, so I don't know how
important it to reduce memory usage. True problem might be size of
maps, since crossfire keeps only currents maps in memory.

One thing which might speedup loading and saving maps is binary files,
but I'm not sure if it's a good idea has two different map formats.
Original maps should still be in text format, since it much more
portable and easier read. If I remember right, most time in loading
is used parsing mapfiles, which would not be problem with binary files.

These were only my opinions,

 - Tero