Company of Heroes 3 was announced on July 13th, 2021. A public pre-alpha build of the game was made available via https://companyofheroes.com/ for 3 weeks. The public pre-alpha is distributed via Steam.
History
SGA format, which is the archive format used by Relic games for game assets. Dawn of War 1 used version 2 SGA files, Company of Heroes used version 4 and Dawn of War II uses version 5 (for completeness, I think Impossible Creatures used version 1, some unreleased project or The Outfit used version 3, and Company of Heroes Online used version 4.1). 1
Version | Products |
---|---|
10 |
Company of Heroes 3, Age of Empires IV |
9 |
Dawn of War III |
8 |
Unknown 2 |
7 |
Company of Heroes 2 |
6 |
Unknown 2 |
5 |
Dawn of War II |
4.1 |
Company of Heroes Online 1 |
4 |
Company of Heroes |
3 |
some unreleased project or The Outfit 1 |
2 |
Dawn of War I 1 |
1 |
Impossible Creatures 1 |
Tools
Official Company of Heroes 2 modding tools include Archive Viewer , which allows browsing and extracting the contents of SGA archives between versions4
and
7
. The Archive Viewer is a
.NET
application. This makes decompiling the application into source code that can be recompiled, with possible modifications, relatively easy. Sometimes the decompilation process is not perfect but usually it’s good enough to at least view the decompiled source code.
One of these .NET decompilation tools is https://github.com/dnSpy/dnSpy .
Research
Archive Viewer parses the contents of SGA archives viaRelicCore.dll
. This library is also a .NET binary.
Luckily Company of Heroes 3 Pre-alpha files contain a similar .NET library:
\steamapps\common\Company of Heroes 3 - Pre-Alpha Preview\dev\mstest\TestProjects\Essence.Rpc.FunctionalTests.Anvil\Essence.Core.dll
. The namespaces have been changed but the API for reading SGA archives seems to have remained unchanged when compared to Company of Heroes 2’s
RelicCore.dll
.
This should make it possible to modify the Archive Viewer to use use
Essence.Core.dll
instead of
RelicCore.dll
.
Modifying Archive Viewer
Archive Viewer was first exported to a Visual Studio project using DnSpy. The decompilation process wasn’t perfect which lead to having to manually fix tens ofxaml
related issues.
Once the decompiled Archive Viewer successfully recompiled and worked, the reference to
RelicCore.dll
was replaced with
Essence.Core.dll
.
After changing the referenced library all changed namespace references were made to various source files to work with
Essence.Core.dll
.
The final result was a successfully compiling and starting version of Archive Viewer.
Downloads
- Releases: https://github.com/Janne252/coh3-archive-viewer/releases
- Each release contains
CoH3.ArchiveViewer.zip
which is a .NET4.7.2
application.
- Each release contains
- Source code: https://github.com/Janne252/coh3-archive-viewer
Tips and tricks
You can assign CoH3.ArchiveViewer.exe
to be default application for .sga
files by doing the following:
- Right-click any
.sga
file and selectOpen with
->Choose another app
- Check the
Always use this app to open .sga files
- Click
More apps
and browse down the list until the optionLook for another app on this PC
becomes visible, and click it - Browse to where you’ve extracted
CoH3.ArchiveViewer.exe
and select it - Done! You can now double-click any
.sga
file to quickly open it inCoH3.ArchiveViewer.exe
Commenting is based on https://disqus.com/ - a commonly used 3rd party commenting service for websites and blogs. It will most certainly add cookies to your browser and track you. It will not be loaded until the user clicks the button above.