Page 1 of 1

Extract map Actor properties and store them in a database

Posted: Sat Apr 09, 2022 6:15 pm
by Barbie
The topic already tells it: I'l looking for a possibility to extract all properties of all Actors in a map (for a lot of maps) and store them in a database in order to filter certain things. I guess DestinationUnreal must have such because of the detailed map information on their web site (see example screenshot).
DU-Example4Mapinfo.jpg

Re: Extract map Actor properties and store them in a database

Posted: Sat Apr 09, 2022 6:39 pm
by Feralidragon
Well, probably @Shrimp has something like that, given his work on UnrealArchive (coincidentally, he's also the author of that map in your screenshot).

There may be other stuff: I know at least there's some stuff written in Delphi I believe, not sure if there is much stuff around in other languages that you could use for that effect.

I have also built a PHP package to do that, since at the time I wanted to do exactly what you're aiming to do now and what Shrimp is also doing currently with UnrealArchive, and it should work in general, but it's incredibly old, it's incomplete (you cannot get everything) and the code quality isn't great, to put it mildly, so it's likely for there to be bugs and/or maps/packages that it may not be able to open correctly, but you can check it if you want:
viewtopic.php?f=15&t=4796&p=50728

Re: Extract map Actor properties and store them in a database

Posted: Sat Apr 09, 2022 7:18 pm
by Buggie
Any external solution which not use UT engine is always lead to info loss. Just because Unreal package highly depends from Actor tree and not store properties which is same in superclass.
So you need work with UCC.

Code: Select all

>system\ucc batchexport dm-deck16][ level t3d ..\export_tmp
=======================================
ucc.exe: UnrealOS execution environment
Copyright 1999 Epic Games Inc
=======================================

Loading package dm-deck16][...
Exported Level dm-deck16][.MyLevel to ..\export_tmp\MyLevel.t3d
Success - 0 error(s), 0 warnings
Here you can in automated way convert any map (which able to load OFC), to t3d.

t3d is really simple text format. now you need only parse it and store it in some DB.

It is easy task, which can be done in any lang what good for you with any DBMS what you know.

For example it can be PHP + MySQL. Or VBA + Access. :loool:

Re: Extract map Actor properties and store them in a database

Posted: Sat Apr 09, 2022 9:09 pm
by Barbie
Thanks for hints, exporting to t3d in first step and then analysing the text file with such as perl was in my mind, too.

Re: Extract map Actor properties and store them in a database

Posted: Sat Apr 09, 2022 10:51 pm
by Feralidragon
Buggie wrote: Sat Apr 09, 2022 7:18 pm Any external solution which not use UT engine is always lead to info loss. Just because Unreal package highly depends from Actor tree and not store properties which is same in superclass.
So you need work with UCC.
Not necessarily.

While using UCC is indeed much easier and can be used when possible (which isn't always), as long as you have all the package dependencies, you can simply load them as well, and from there doing the necessary inheritance logic of data.
It's actually not that complicated at all.

The hardest part is only to load and parse a single package correctly, because there's barely any documentation around it at all.
But once you get that part done, everything else is a walk in the park.

Re: Extract map Actor properties and store them in a database

Posted: Sun Apr 10, 2022 12:08 am
by Shrimp
My unreal-package-lib will let you do this, if you use Java. See https://github.com/shrimpza/unreal-package-lib

You can get access to all actors and their properties within any package. As Firalidragon mentioned, this is what Unreal Archive uses to parse maps and things. It has some limitations like it doesn't let you export inline code, for example, because it's just not something I've needed yet so it hasn't been implemented.