[crossfire] Archetypes collection changes proposal
Nicolas Weeger
nicolas.weeger at laposte.net
Thu Jan 14 04:19:20 CST 2021
Hello.
I've committed my (massive) changes following the 1.75 release :)
It is now possible to run the server without "packed" archetypes, faces,
treasures, ... ("assets"). But you still can "pack" everything in single files
for speed or distribution reasons :)
There may be some issues yet, but the code has been running on invidious since
a few weeks, so major bugs are hopefully ironed out.
To correctly compile and install, you must symlink "maps" in the server/lib
directory, like the "arch" one.
I think the first "make install" (or "make") will fail in "lib" on the file
"crossfire.arc", in which case from the server root do
( cd lib && make do-collect )
to generate that file.
Note that "do-collect" has been changed to use the server (and not the Perl
script), and that it isn't (yet) totally efficient as it will run the server 3
times... I will fix that at some point in the future.
If you wish to run against the raw "arch" repository:
- rm crossfire.{arc,tar,trs,face} from the "share" install directory
- maybe remove those files from the "server/lib" directory and replace them
with empty files (through "touch")
- symlink "arch" in the "share" directory, along the "maps" one
Note that you may very well have both crossfire.{arc,...} along the "arch"
symlink, it should work (that's the aim of the no collect mechanism after all
:D so please report bugs if you find any), but it may be slower to start the
server.
The explanation for the slower start is that the server will first process the
"packed" crossfire.{arc,...} files, then the subdirectories. During so, it will
update notably its archetypes definitions, which may take some time (especially
when running in debug).
Of course the disk speed is also an issue, especially for reading all the PNG
files.
The packed "client images" is a tar file, uncompressed. In the future this .tar
may be extended to contain also arches, face, and such, and maybe compressed
too.
Too many technical changes were introduced so I won't list'em all :)
The major point about archetypes, faces, animations, treasures and others
("assets") is that their "get_xxx" function will NEVER return NULL anymore. If
you need to check for existence, there is a "try_find" (or "find") function.
Function documentation is hopefully updated to reflect that.
Internally, the code works by keeping assets' pointer valid all the time and
updating the underlying structure with updated version.
So during initialisation, if an archetype references a not-yet-known treasure
list, this treasure list is internally created empty. When the treasure list
is loaded (from the .trs file), this empty treasure is updated.
After loading all assets, the server will abort if one was referenced but not
defined (ie you ask for a treasure list that is never actually defined), except
for faces which may be left undefined (reason: too many existing faces aren't
defined right now). There's a command-line flag to allow going on, in which case
undefined items are blank (ie empty treasure list, empty face, and such) - the
server should not crash anyway, but you may have strange behaviours.
I'll of course reply to inquiries on technical questions :)
Best regards
Nicolas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part.
URL: <http://mailman.metalforge.org/pipermail/crossfire/attachments/20210114/c8c5744c/attachment.sig>
More information about the crossfire
mailing list