JohnDecodes wrote:
This is really impressive, I know James has mentioned he has a method of exporting textured 3DS terrains, and syncing the original object co-ordinates into Unity, but I’d really love to know how he does it exactly, and if it’s possible with other engines.
The technique behind doing this is really quite simple. Get yourself a copy of TresED and do the following:
The Terrain1) Export the terrain to TPM. Don't export it to 3DS Max otherwise it'll be riddled with holes.
2) Look at the terrain in TresED and find the dominant terrain texture. You can then export the dominant terrain texture by flattening the decals layer and exporting the tile that contains said texture in TPM or 3DS format.
3) Once the terrain has been imported into 3DS Max via the TPM Importer, apply a "UVW Map" modifier and then apply the texture. You'll need need to lower the width and height values in order to adjust the tiling of the terrain texture.
4) Right click object and convert to editable mesh. Terrain is now ready to be exported to any game engine of your choice.
Objects/Trees/FoliageWhen exporting Objects/Trees and Foliage, I'd strongly recommend it's done in stages as it makes it far easier to manage the assets. One thing to bare in mind is you may wish to export to 3DS Max for these. Reason being is I observed that exporting instanced objects to TPM format has a tendency to screw up the co-ordinates.
Starting with trees:
1) Goto any tree in TresED, click it and then click select Sub Objects. This'll take you to the void where object instances are stored.
2) Now delete everything that isn't a tree that's in the instance void. Bare in mind that if you go back to the level terrain after you've done this, TresED will likely crash so I strongly recommend saving the level at this point (don't forget to make a backup. I think TresED does this automatically and saves original with an .orig file extension.
3) Click visibility then select all. This will now select all the trees in the level.
4) Click file, export selection to 3DS.
5) Make sure that "center objects around 0,0,0" is unchecked. It'll preserve the co-ordinates of all the objects. Also make sure "use grey instead of original transparency color" is checked
6) Go back into 3DS Max and import your tree 3DS file you just saved. As long as you don't adjust the scale/location of anything, everything should literally be in its original position verbatim.
7) In terms of transparency of the leaves, you can either do a batch job on it via GIMP to apply the transparency or you can apply the original transparency textures files manually (takes longer but is most accurate)
Foliage is basically exactly the same process.
The core objects (Buildings, barriers ect), I select each of these manually then export selection to either 3DS Max or TPM as before (Core objects like building don't tend to be instanced)
As before, as long as you don't manually adjust positioning/scale, everything should automatically go into the correct position.
Once I have each of these elements in 3DS Max, I export them to OBJ and then carry on my work in Blender by re-importing then into Blender. I have an old version of 3DS Max (2008) which is horribly inefficient.
The Decal process however is more tricky.
1) In TresED, use the terrain flatten button then press visibility, select all. All decals should be selected.
2) Export selection to 3DS Max.
3) Use same settings as the previously explained trees.
4) Import decals into 3DS Max
5) At this point, I'd strongly recommend you use a function called "collapse" in 3DS Max to join the same decals together. It's found in the utilities area with a button that has a picture of a hammer on it.
6) You now need to join up the decals together in groups. I'd recommend doing this in one of two ways. You can either use the find function and then type in something like "*road" and it'll select everything with the word road in it. If you do this with terrain decals it can sometimes mess with the texture assignments. To avoid this, click a decal then click edit, select similar. That should then select all the decals that share the same material. Once all decals are selected, you then click the collapse selected button. If you have 1000's of decals, bare in mind that there's a chance that 3DS Max can crash. If this is the case, do it in stages.
7) Once you have your decals grouped, export to obj then import into Blender.
8 ) Once imported into Blender, you now need to use a shrinkwrap modifier to make it so the decals "hug" the terrain like in the original game. Only drawback with this technique is you have to sub-divide the decals which massively increases the polycount. (not good for an older engine like BeamNG. More modern engines may be able to cope better.)
9) Like the trees, many decals will need transparency effects applied to them.
Hopefully, that's explained the underlying fundamentals of how my process pipeline has worked.

By doing this, it is possible to fully migrate the levels across in a 1:1 sense into other engines.