t3d to obj

External tools, software and sites for creating or editing UT99 resources.
kmar
Novice
Posts: 18
Joined: Sat Jan 25, 2020 12:18 pm
Location: Czech Republic

t3d to obj

Post by kmar »

Hi,
I made a t3d to obj converter for old Unreal maps.

The link is here (VirusTotal clean).
http://www.crabaware.com/Utils/t3d_to_o ... to_obj.zip

How to use:
simply run UnrealEd, open a map and export as t3d as is, no transform permanently, no intersection necessary
then run t3d_to_obj.exe <exported.t3d>, obj and mtl files will be generated automatically relative to where exported.t3d is placed.

(note that only world geometry is exported, movers are ignored)
there will be to up to 3 groups in the obj file, one for structural (solid) faces, one for detail (semisolids/nonsolids) and one for bothsided detail faces
(invisible zone portals will be skipped)

the obj file doesn't contain vertex normals so you'll have to generate them in your modeling software
faces are not triangulated but will contain collinear T-vertices to fix T-junctions, so triangulation may be necessary as well
(the faces are always convex though)

That's it unless you want precise UVs.
For precise UVs, you need to supply textures in png/pcx format, put them into t3d_tex subfolder relative to the converter,
no subfolders.
This is necessary because old engines didn't use normalized UVs because they originally used software rasterization.

(UModel (UE Viewer) seems to be doing a great job at exporting png textures from multiple packages, except for animated textures)

The CSG is done using my routines, so there may still be some problems.
I found one map, Area51 bunker in DeusEx, where a tower doesn't carve the same way Unreal does due to brush misalignment
(because my engine's coplanar epsilon is smaller than Unreal's)

I havent tested sheer part of scale much, but it doesn't seem to be used much.

Hope you find this useful, even if it's 2020 already.
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: t3d to obj

Post by Chamberly »

An .exe file, I'm scared.
Image
Image
Image Edit: Why does my sig not work anymore?
kmar
Novice
Posts: 18
Joined: Sat Jan 25, 2020 12:18 pm
Location: Czech Republic

Re: t3d to obj

Post by kmar »

You don't have to be, but I understand. 1st post and already posting a link to a zip file (not to an executable though).
The zip file and the executable have been checked with virustotal.com, none of the 71 AV engines found anything malicious
(you can see for yourself as downloading the zip file doesn't run anything)

I think there are better ways to bait people to download malware rather than to use a functional t3d to obj converter for old Unreal.
But I can't force anyone to download my converter. If you're really afraid, it may be possible to run in a virtual machine.

To prove that the program actually works, if you could provide me with a link to a t3d file then I can upload the converted obj and mtl files if you wish.

=MERGED=

Here's an example exported map (Liberty island from DeusEx) in Blender:
Image

(I forgot to write that the exported units are metres, not Unreal units)
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: t3d to obj

Post by Feralidragon »

Yes, people are wary of executables nowadays, especially from "untrusted" sources (such as a new user like you said), but VirusTotal is indeed a good tool to check whether or not an .exe is harmful.
Another good way would be to provide a link to the source (github or other), that is if the project is open-source at all of course.

I didn't try it myself, but seems like an interesting tool, however the only utility I can see right now would be to be able to preview maps in 3D, or even to be able to preview 3D prefabs (among all the ideas I had thus far in general to develop in the future, a 3D prefab library with BSP stuff is one of them, but the preview would be tricky due to all the CSG to calculate).
The conversion to .obj makes it far more simple to do something in a site using a WebGL library for example.

Either way, it's always very cool to see new faces around doing stuff like this, so welcome, and great job. :tu:
kmar
Novice
Posts: 18
Joined: Sat Jan 25, 2020 12:18 pm
Location: Czech Republic

Re: t3d to obj

Post by kmar »

Maybe this tool is indeed obsolete, best would be to somehow RE and extract the final geometry from maps directly.
As for visualization, I think it's hard to beat Unreal editor and engine itself, as you also get proper lighting.

I was thinking more along the lines like maybe porting old maps to other engines/use the geometry as a base to reimagine old maps;
this might be also useful to engine devs so that they can test some real old-school levels instead of things like Sponza.

The CSG part is tricky, I use raycasts instead of BSP (I still use BSP to cut fragments though), because this way I get less cuts (imagine a BSP plane cutting unrelated geometry far away).
But maintaining robustness is hard, also proper handling of coplanars is not so easy with CSG.

I have found some maps that violate manifold rules though they still build somehow fine within UnrealEd (luck?)
(AS-HiSpeed has one flipped face in the rail brush, I found a map in Clive Barker's Undying that has a brush with self-intersecting faces, one map in Deus ex contains concave polygons,
another uses misaligned brush where it's cut as expected only due to UnrealEd's large coplanar tolerance and so on)

Another problem with UnrealEd brushes in that the solidity is stored per polygon instead of per brush and I've seen inconsistencies where a solid brush contains semisolid/nonsolid polys
and I don't know how to handle those cases properly (currently I force non-solid brush if a non-solid polygon is found).

The core part of the converter is an oldschool engine I'm working on in spare time, so I do not plan to go open source.

I simply thought such a tool might be handy to some people (I would be happy for this like several years ago, when I was working on BSP portalization and visibility culling,
to have some manifold B-Rep of large oldschool levels to play with)

Almost forgot - I've just uploaded a new version with improved CSG robustness.
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: t3d to obj

Post by papercoffee »

@kmar
Please avoid double posts within a 24 hour limit.
When no one after you has answered in that time use the edit button on the right to add more content.
___
Novice
Posts: 7
Joined: Sun Jan 26, 2020 2:48 pm

Re: t3d to obj

Post by ___ »

Yeah running random exes from the internet is generally not a great idea, but I was feeling adventurous and can confirm that this one at least seems to do what it claims.

Here's a couple of quick renders from Blender. I didn't try converting the textures yet, can you guess the map :)
kosov1.jpg
kosov3.jpg
kmar
Novice
Posts: 18
Joined: Sat Jan 25, 2020 12:18 pm
Location: Czech Republic

Re: t3d to obj

Post by kmar »

well now it's apparent that this is not some random executable. I wonder why so much fuss though,
because from what I've seen many people here upload exes/dlls and nobody has ever complained...

it's obviously a CTF map with water, so I'm guessing CTF-Kosov, glad it works for you
User avatar
papercoffee
Godlike
Posts: 10443
Joined: Wed Jul 15, 2009 11:36 am
Personal rank: coffee addicted !!!
Location: Cologne, the city with the big cathedral.
Contact:

Re: t3d to obj

Post by papercoffee »

kmar wrote: Sun Jan 26, 2020 6:02 pm well now it's apparent that this is not some random executable.
An one time poster (without a real username) confirms that the link of another one time poster is legit :mrgreen:

Anyway ... VirusTotal confirms everything is ok with the zip.
The .exe got one scanner ringing the bells. But I don't know how relevant "Qihoo 360" is... I've never heard of it.
kmar
Novice
Posts: 18
Joined: Sat Jan 25, 2020 12:18 pm
Location: Czech Republic

Re: t3d to obj

Post by kmar »

papercoffee wrote: Sun Jan 26, 2020 7:43 pm
kmar wrote: Sun Jan 26, 2020 6:02 pm well now it's apparent that this is not some random executable.
An one time poster (without a real username) confirms that the link of another one time poster is legit :mrgreen:

Anyway ... VirusTotal confirms everything is ok with the zip.
The .exe got one scanner ringing the bells. But I don't know how relevant "Qihoo 360" is... I've never heard of it.
Well, I'm not sure what to say. First time posts happen. If you're implying I created a fake account, then I don't think that's even funny :)

As for Qihoo, that's some chinese AV, no idea how relevant it is (I trust my Kaspersky). It's curious because I always upload both the zip and executable to VT first
and I don't remember seeing anything, but now I do...
I used to work for AVG (left before it was acquired by Avast), so I know that false positives do happen.
One needs to detect as much as possible as quickly as possible while reducing FPs, needless to say those goals go against each other.

I can't do much about Qihoo's detection, I'm afraid...
Issuing a certificate for the executable might work (or might not, those can be faked as well AFAIK) and I'm certainly not going through all the trouble.

So answer yourself: why would someone go through a lot of hassle to develop a complicated tool just to supply malware to a handful of UT99 enthusiasts?
That would be a waste of time. Also - fooling 69 different engines except for one, that'd be a very hard task to accomplish.

Anyway, I'll probably release a new version soon (a couple of days?) with more features, right now I'm debugging another CSG robustness issue with one map and it's driving me crazy :?
User avatar
Feralidragon
Godlike
Posts: 5489
Joined: Wed Feb 27, 2008 6:24 pm
Personal rank: Work In Progress
Location: Liandri

Re: t3d to obj

Post by Feralidragon »

I feel you're starting to become a bit too defensive, despite the lack of any real accusations whatsoever.

If you really used to work for AVG, then people being wary of .exe files from an unknown person should make you glad, as somewhat a security expert, that people are learning and being careful, given that people are usually the weakest link of any security system, so this shows that people in this community are at least well educated.

After all, you apparently knew this even before you joined, that's why you linked immediately to VirusTotal, and suggested to even try it in a virtual machine, in your very first post, and clarified later that the code is not open-source, so you knew what to expect already.
Trust is something earned, not immediately acquired.

So, all you have to do is to keep making releases, participating, and simply give time to people to try it out on their own, rather than defending yourself.
Let your stuff speak for itself.

It won't happen overnight, but if you keep making releases and if people around keep validating them well, then you will simply come to a point that this community will trust what you release, it's that simple.
It won't be a nameless new user, with no credit whatsoever, which only registration purpose was only to validate your executable, that will immediately validate what you did and will make the community trust what you release.

Therefore, stop focusing on whether or not the executable is legit, and just focus on its strengths, features, etc, and just let the community try it out.
I, for one, think this is something interesting, and the only reason I didn't try it out because I currently have no use for it.

Like I said before, it's always very cool to see new faces introducing new things into this game, and the more the merrier.
kmar
Novice
Posts: 18
Joined: Sat Jan 25, 2020 12:18 pm
Location: Czech Republic

Re: t3d to obj

Post by kmar »

ok :)

I've uploaded a new version (0.5)
what's new:
- can import movers if desired (default position only), arg -m
- added custom prescale (before CSG) and postscale (before export), args -s and -p
- added the ability to prefix materials with a custom string, arg -x

please see readme.txt for more details

with prescale and postscale, you can virtually control CSG epsilon:
-s 0.125 -p 8.0
makes the geometry 8x smaller first (=virtually 8x increased epsilon) and post-scales back 8 times to get the same final scale.
these args fix Area51 bunker (DeusEx) tower CSG

the robustness issues I was mentioning in my previous post turned out to be yet another non-manifold in one of the maps in Undying - not something I can fix
User avatar
Chamberly
Godlike
Posts: 1963
Joined: Sat Sep 17, 2011 4:32 pm
Personal rank: Dame. Vandora
Location: TN, USA
Contact:

Re: t3d to obj

Post by Chamberly »

I'd prefer review from a known admin/mod to validate this .exe lol not no 1 time poster that I never heard of before especially with lack of name.

I can stick around without the tool though, not like I do this kind of stuff all the time so I'm alright. I'll check back later for follow up and see what changes.
Image
Image
Image Edit: Why does my sig not work anymore?
SC]-[WARTZ_{HoF}
Adept
Posts: 426
Joined: Tue Feb 21, 2012 7:29 pm

Re: t3d to obj

Post by SC]-[WARTZ_{HoF} »

I find these tools very useful. I've been converting Counter Strike maps too UT99 but I would also like too take a stab at converting other Unreal 1 engine game maps as well.
So keep up the good work and thanks for your participation here.
Image
Image
Image
___
Novice
Posts: 7
Joined: Sun Jan 26, 2020 2:48 pm

Re: t3d to obj

Post by ___ »

Well, I've been lurking on this site for a while now but never bothered to register until now. The name is because I just wanted to make a quick account lol

But anyway, textures are working and most importantly, the UVs are not messed up which is a problem I had with previous tools like this.

I managed to export all the textures with UModel, but noticed that subdirectories in t3d_tex aren't searched during the conversion. So basically it seems to assume a flat hierarchy of files, but this is a bit of a problem since package X and package Y can both have a texture with the same name which causes a conflict. The .t3d file actually doesn't seem to specify the texture package either so maybe this is a limitation of the format?

Thanks for creating this by the way! So far it's working pretty well.
kosov_tex.jpg
Post Reply