springcontent update mechanism

springcontent update mechanism

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
User avatar
SpliFF
Posts: 1224
Joined: 28 Jul 2008, 06:51

springcontent update mechanism

Post by SpliFF »

I've made a gadget that I run on replays to extract combat stats for an AI. Because I dl'ed the replays I can't add the gadget using the normal process (because replays CRC check each current mod against those active when the recording happened).

As a workaround I removed the CRC checks and added my gadget straight into springcontent.sdz, which worked a treat.

However I quickly found that updating the sdz archive after each change was a hassle. I tried creating springcontent.sdd but unlike normal mods the springcontent.sdz path is hardcoded. I edited the source again to create the following:

rts/Game/PreGame.cpp + tools/unitsync/unitsync.cpp

Code: Select all

// always load springcontent
logOutput << "Loading Spring content archive\n";
hpiHandler->AddArchive("base/springcontent.sdz", false);
// update VFS with springcontent development files
hpiHandler->AddArchive("base/springcontent.sdd", true);
I only put the files I'm changing / adding in the sdd directory.

This isn't quite the same as the normal mod ArchiveScanner process but it has the advantage that the game starts faster (theoretically at least since archives require less disk accesses than directory traversal).

Anyway I'm posting it here as a suggestion for making spring development a bit easier. Hopefully something like it or the normal mod loading process can be incorporated into trunk if there's enough demand.

Comments welcome.
Post Reply

Return to “Engine”