logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic ReadSac.exe - Undying/Unreal Map & Package Reader (Read 2087 times)
Lurker
New Member
*
Offline


UnrealEd Modder, Mapper
& Coder since 1998

Posts: 38
Location: Germany
Joined: Mar 3rd, 2015
Gender: Male
ReadSac.exe - Undying/Unreal Map & Package Reader
May 19th, 2015 at 7:58pm
Print Post  
This week I have started developing the first one of a set of upcoming Undying Tools called ReadSac.exe, an UCC-inspired command-line tool which I have coded from scratch to read detailed Header information in Undying Maps (*.sac) and Unreal Packages (*.u,*.utx,*.uax,*.umx) of various UE-based Games in general. An exporter function will also be added soon, for the Name Tables and other stored data of Unreal Format Packages.

Screenshot of Alpha version 1 :



This and the other planned tools will be officially released and uploaded to my ModDB soon...

For a quick demonstration I used ReadSac to save the Package Infos of all the original Undying Maps in batch. You can download the archive (UndyingPackageInfos1.zip) of the txt files from my temporal cloud directory:

https://mega.co.nz/#F!JwUUGJKb!L1ILmBu-r-UKyMZkSiVSmQ
  
Back to top
WWW  
IP Logged
 
Lurker
New Member
*
Offline


UnrealEd Modder, Mapper
& Coder since 1998

Posts: 38
Location: Germany
Joined: Mar 3rd, 2015
Gender: Male
Re: ReadSac.exe - Undying/Unreal Map & Package Reader
Reply #1 - May 20th, 2015 at 12:57pm
Print Post  
Two further tools are going to be included in my Undying/Unreal tool pack.

xngf.exe : An UCC-type batchexporter for Undying's mesh models (*.ngf) stored in system packages (Aeons.u,Cutscenes.u)
xsac.exe : Another command-line tool to quickly export packed streams stored in Undying's map packages (*.sac)

NGF exporter of Undying's "New Geometry Files" is useful for fully recompiling the system packages afterwards since you can't batchexport the mesh models with UCC. And you need all the original files to fully recompile an existing system package ofcourse.

Take note that I'm talking about exporters here, not converters! There is currently no converter from .ngf to Unreal's .3d mesh format in existence, and no official plugin to create *.ngf model files. I googled for it in detail and didn't find anything. Same as the compressed data stream in *.sac files the NGF format is a completely unknown format, only known to the Undying developers themselves. I may however look into coding a converter for those files myself when I export and analyze the NGF file format. The compiled code for this format is located in \Undying\System\NGF.dll library. There is no source code for that though.

SAC exporter is no decompressor either! The tool is just meant to export the packed stream out of Undying's Package Container (*.sac) and save it to a raw file (e.g. *.x) for further processing and decompression attempts.

If you are familiar with using hex editors you don't require xsac.exe though and can export it yourself. I have analyzed *.sac files in detail to describe the simple structure. First comes the usual Unreal Package header information and then simply Undying's SAC header followed by the compressed stream itself. Here's my own specification and what I know about the format so far...

btw, notice that I call it "sacked", a funny wordplay on "packed". I don't know if that's the name which the developers used. Normally they could have named the extension ".und" for "Undying Map", but ".sac" seems to have some meaning and I don't think it's an abbreviation. It probably means "sack" indeed.  Grin

Code
Select All
Sacked Stream Header and File Specification (*.sac)

Offset      Type     Description
--------------------------------------------------------------------
0x00..3F             Unreal Package Header Info
0x40..43    DWORD    Sacked Magic Number (0x01234567 / 67-45-23-01)
0x44..47    DWORD    Sacked Unknown Value 1
0x48..4B    DWORD    Sacked Unknown Value 2
0x4C..4D    WORD     Sacked Stream Tag (0x9C78 / 78-9C)
0x4E..EOF            Sacked Stream Data (EOF=End Of File)
-------------------------------------------------------------------- 



ReadSac.exe also displays those numbers and values when reading *.sac files. (see screenshot)
  
Back to top
WWW  
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 517
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: ReadSac.exe - Undying/Unreal Map & Package Reader
Reply #2 - May 21st, 2015 at 10:46am
Print Post  
How are the *.ngf files stored inside?

For the *.sac packages it might be easier to just make up headers for undyings core package and resave the package (uncompressed) and thus letting the game handling the decompression.

Or you dynamic load the FArchiveFileReaderGeneric::DecompressBlock( FZTag const&, int ) and use that with an external program. ^^
  

HX on Mod DB. Revision on Steam.
Back to top
 
IP Logged
 
Lurker
New Member
*
Offline


UnrealEd Modder, Mapper
& Coder since 1998

Posts: 38
Location: Germany
Joined: Mar 3rd, 2015
Gender: Male
Re: ReadSac.exe - Undying/Unreal Map & Package Reader
Reply #3 - Jun 1st, 2015 at 7:59pm
Print Post  
han wrote on May 21st, 2015 at 10:46am:
How are the *.ngf files stored inside?


They are stored like anything else in common Unreal Packages. First in the order of their Object Names in the Name Table. And then by type attribution (Class, Mesh, Sound, Texture) which has to be given as a parameter in UCC.

But I have to study the Unreal Package Format in more detail first and need more time to code my own exporter tool for it.......

Common Examples of Unreal1 resource export with UCC:

Code
Select All
ucc.exe batchexport UnrealShare.u class uc c:\Games\Unreal\UnrealShare\Classes\
ucc.exe batchexport UnrealShare.u mesh 3d c:\Games\Unreal\UnrealShare\Meshes\
ucc.exe batchexport UnrealShare.u sound wav c:\Games\Unreal\UnrealShare\Sounds\
ucc.exe batchexport UnrealShare.u texture bmp c:\Games\Unreal\UnrealShare\Textures\
ucc.exe batchexport UnrealShare.u texture pcx c:\Games\Unreal\UnrealShare\Textures\ 



The proper UCC commandlines for mesh export in Undying:

Code
Select All
ucc.exe batchexport Aeons.u mesh ngf c:\Games\Undying\Aeons\Meshes\
ucc.exe batchexport Cutscenes.u mesh ngf c:\Games\Undying\Cutscenes\Meshes\ 



But it won't work and UCC will return an error, because there is no commandlet to extract ngf meshes in Undying:

"No ngf exporter found for SkelMesh Aeons.Meshes..."

I've already explained this in detail in my UndEd2 topic:
http://www.oldunreal.com/cgi-bin/yabb2/YaBB.pl?num=1430655361

Quote:
For the *.sac packages it might be easier to just make up headers for undyings core package and resave the package (uncompressed) and thus letting the game handling the decompression.


I don't quite understand what you mean by that. I don't think it will work. Please explain how this is done...

By the way, are you talking about Core.dll or Core.u ?
It is important not to confuse *.dll libraries with *.u system packages!
And not to confuse C/C++ "headers" and "sourcecodes" (*.h, *.c, *.cpp) with UnrealScript "classes" (*.uc)!

To modify and/or rebuild Core.dll and other hardcoded libraries we require C/C++ headers and sourcecodes, as you know best, since you release those for download on your website. Unfortunately we don't have any Undying headers and sourcecodes. You released a header/sourcecode pack for KHG recently. Perhaps you can make one for Undying aswell if that's possible...  Smiley

Too bad that the Undying developers themselves did not release any official Undying headers and sourcecodes.
  
Back to top
WWW  
IP Logged
 
Lurker
New Member
*
Offline


UnrealEd Modder, Mapper
& Coder since 1998

Posts: 38
Location: Germany
Joined: Mar 3rd, 2015
Gender: Male
Re: ReadSac.exe - Undying/Unreal Map & Package Reader
Reply #4 - Jul 12th, 2015 at 10:12pm
Print Post  
Since I haven't posted on the project for almost 2 months now I like to announce that it's still going. I will publish some sourcecode snippets and source libraries in my new code repository on GitHub before I compile the final project as .exe's and release it on ModDB.

https://github.com/LurkerCode/UnrealTools

This may be interesting for other programmers. So don't forget to follow me on GitHub aswell.
ReadSac and the other tools are written from scratch in Freepascal/Delphi, by the way.
But you may also find C/C++ sources in my new repository.
  
Back to top
WWW  
IP Logged
 
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 517
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
Re: ReadSac.exe - Undying/Unreal Map & Package Reader
Reply #5 - Mar 11th, 2017 at 12:55pm
Print Post  
zlib-1.1.3's uncompress is used by Undying to decompress the stored data.
  

HX on Mod DB. Revision on Steam.
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo