This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Opened 6 weeks ago

Last modified 6 weeks ago

#6943 new defect

Allow stripping XMB in release archives

Reported by: Stan Owned by:
Priority: Should Have Milestone: Backlog
Component: Core engine Keywords:
Cc: Patch:

Description

AFAICS XMB's goal is to replace XML everywhere in the game to offer a more efficient access version of the data.

This is analoguous to the PMP and PSA formats. When making an archive the DAE files are not copied to the archive. This represents a very significan space gain. In hyrule, the mod size went from 6GB to 2.5GB.

Now with XMB we don't expect that kind of improvements. However for template only mods, you could still save 30% of the size.

Adding the option to strip XMLs should be easy.

The problem lies in the fact that the game still seems to rely on the xml presence for some cases that needs to be fixed. If you take https://github.com/0ADMods/ponies-ascendant/releases/tag/v0.26.1

Then strip the mod of all its xml files, you will no longer be able to build anything, as the building panel will be empty.

Change History (1)

comment:1 by Stan, 6 weeks ago

From a forum post by Stan:

About that. We need to help modders, as packaging is not as straightforward as modding. I wish I had not wasted time earlier and started packaging because I found at least 3 major bugs with the game by doing so, and it could prevent things from working.

  1. .DELETED files for folders do not work when packaged.
  2. .DELETED files should not be empty, writing a 'a' is enough, but else they do not get packaged.
  3. Pyromod installs do not override existing mods so you have to delete the mods to update
  4. Pyromods are not prioritary compaired to mods, which means you have remove the folders from binaries/data/mods/ each time you want to test
  5. On windows you have to rely on external tools like https://docs.microsoft.com/en-us/sysinternals/downloads/debugview to see what's wrong
  6. There is literrally no way to know (on windows) how far you are in the packaging, and even in the logs there is no end message.
  7. We package a huge number of XMB files that are bigger than xml files though arguably faster, but are not being used (3MB of XML on a 30MB package is quite a lot for useless files) . to see that, try using this diff to remove xml files from the bundle (which would be nice for mods that do not want to be to big or share their templates) It would be nice to have a flag for it
Index: source/ps/ArchiveBuilder.cpp
===================================================================
--- source/ps/ArchiveBuilder.cpp
+++ source/ps/ArchiveBuilder.cpp
@@ -144,33 +144,37 @@ void CArchiveBuilder::Build(const OsPath& archive, bool compress)
 				writer->AddFile(cachedRealPath, cachedPath);
 			}
 
 			// We don't want to store the original file too (since it's a
 			// large waste of space), so skip to the next file
 			continue;
 		}
 
-		debug_printf("Adding %s\n", realPath.string8().c_str());
-		writer->AddFile(realPath, path);
-
 		// Also cache XMB versions of all XML files
 		if (path.Extension() == L".xml")
 		{
 			VfsPath cachedPath;
 			debug_printf("Converting XML file %s\n", realPath.string8().c_str());
 			bool ok = xero.GenerateCachedXMB(m_VFS, path, cachedPath);
 			ENSURE(ok);
 
 			OsPath cachedRealPath;
 			ret = m_VFS->GetRealPath(VfsPath("cache")/cachedPath, cachedRealPath);
 			ENSURE(ret == INFO::OK);
 
 			writer->AddFile(cachedRealPath, cachedPath);
+			
+			bool AreXmlArchived = false;
+			if(!AreXmlArchived)				
+				continue;
 		}
+		
+		debug_printf("Adding %s\n", realPath.string8().c_str());
+		writer->AddFile(realPath, path);
 	}
 }
 
 Status CArchiveBuilder::CollectFileCB(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData)
 {
 	CArchiveBuilder* self = static_cast<CArchiveBuilder*>((void*)cbData);
 	self->m_Files.push_back(pathname);

From another forum post by Stan:

  1. #5179
  1. #5159
  1. #5181
  1. #5182
  1. #5161
  1. #5161

This ticket

Version 1, edited 6 weeks ago by Stan (previous) (next) (diff)
Note: See TracTickets for help on using tickets.