GUIapp importing terrain from max

Creating new content for Trespasser!

Moderators: TresCom Support Team, TresCom Board Managers, TresCom Developers

Teromen
Parasaurolophus
Parasaurolophus
Posts: 258
Joined: Sun Jun 25, 2017 11:48 pm

GUIapp importing terrain from max

Post by Teromen »

I knew how to do this years ago but time... you know. Can anyone give me some tips?

When converting I get the error
Critical assertion failed!

Also I seem to remember you import the terrain wtd file somewhere in tresed right?

Edit: I was reading some of my old posts and I know I just rename the terrain to the lvl name. But what I can't remember is how to get rid of that error. GUIapp crashes every time. I know there is something I need to do in 3dsmax but I can't remember what. Anyone have any ideas?

Edit: I tried a super low poly terrain and it worked. I think its a 128x128 optimized with prooptimizer set to 5 percent. I don't rememebr having to do that before. Weird.

I think the problem was that the mesh was scaled too small in 3dsmax. Its slowly converting right now. After I figure this out im gonna do a write up on the forum for the future :)
User avatar
tatu
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 5100
Joined: Fri Jun 24, 2005 9:40 pm
Antispam: No
Location: Sweden
Contact:

Re: GUIapp importing terrain from max

Post by tatu »

There is this I wrote a few years ago:
https://www.trescomforum.org/viewtopic. ... 45&t=10879

If you use the script from the source or machf's script to export the terrain, it shouldn't matter what scale the terrain is. GUIApp will automatically add if is not a correct size.
What can cause issues is if the quads on the terrain is not square and "equal". Not sure how to explain it.

And I am unsure if you use the GUIApp that comes with CE or the original one, but the CE one contains some fixes so I recommend that GUIApp version. :)
Active project: Trespasser: Isla Sorna
Status:
BE-PH1: Released
PH2-IT: Pre-released
PL-SUM: In production

"...there used to be more benches, but InGen's workers removed them during the evacuation in the name of framerate."
Teromen
Parasaurolophus
Parasaurolophus
Posts: 258
Joined: Sun Jun 25, 2017 11:48 pm

Re: GUIapp importing terrain from max

Post by Teromen »

From what I can tell GUIapp doesn't like 1024x1024 terrains that aren't optimized. I'm not real sure how to optimize them properly in 3ds max though. Nothing keeps it as squares.
I tried different cache settings in GUIapp.

I'm pretty sure I used to convert large terrains years ago on a much slower computer so im just doing something wrong.

My problems may come from the fact that im exporting a mesh from World Machine... I'm gonna try a displacement in max with a heightmap and see if the terrain looks right in game. I suspect my quads aren't right.

Edit: Ok. I made a plane at different resolutions and up to 512x512 converts fine in GUIapp, but 1024 wont :( must be a memory issue.
Last edited by Teromen on Sun Nov 15, 2020 12:40 am, edited 1 time in total.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GUIapp importing terrain from max

Post by machf »

Teromen wrote:From what I can tell GUIapp doesn't like 1024x1024 terrains that aren't optimized. I'm not real sure how to optimize them properly in 3ds max though. Nothing keeps it as squares.
I tried different cache settings in GUIapp.
I've had the same problem. The thing is, 1024*1024*2 (because each quad is divided into two triangles) is too many triangles for GUIapp to handle. I wonder what optimization plugin was used by the original devs that made neat squares...
So, what solution did I use? Use the original 1024*1024 (or higher resolution) heightmap to import it with TresEd first, then after that, export it as a .tpm file, import it back into 3DS MAX and follow the other steps tatu mentioned in that guide/tutorial...
I'm pretty sure I used to convert large terrains years ago on a much slower computer so im just doing something wrong.

My problems may come from the fact that im exporting a mesh from World Machine... I'm gonna try a displacement in max with a heightmap and see if the terrain looks right in game. I suspect my quads aren't right.
Beware, 3DS MAX won't allow you a plane with a 1024*1024 quads, it has a limit of maximum 1000*1000 subdivisions, so you'd have to use 512*512... or apply a TurboSmooth modifier BEFORE the displacement to get 1024*1024 (or 2048*2048) quads, but then you'll have again the same problem with GUIapp...

Some time ago, we were discussing the possibility of just writing a new program that would do the same thing that GUIapp and TresEd do (import either a heightmap or a .TRR file exported from 3DS MAX) in order to generate a terrain .WTD file directly, but without those limitations... but we haven't had a chance to do it yet.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
Teromen
Parasaurolophus
Parasaurolophus
Posts: 258
Joined: Sun Jun 25, 2017 11:48 pm

Re: GUIapp importing terrain from max

Post by Teromen »

I got a 1024x1024 to convert. I had to move the mesh to the lower left corner in 3dsmax. I used square quads, no lines/triangles in them.
Now I'm gonna try scaling down the terrain in max and also try higher resolutions :)

edit: I made a 128x128 plane and then applied tessellate at numbers 2 or 3. 2 calculates to 512x512 and 3 should be 1024x1024. I made sure the squares had no lines in them. First I tried a 512x512 plane and applied tessellate and it was taking forever so I tried 128 for the starter plane. That works pretty fast. I wanna do a write up on this for future reference.

I'm using tpass-ce_edtools_v107e version of GUIapp.

I'm willing to bet if you don't allow it to separate the squares into triangles it wont use as much memory on conversion. But I'm not sure. My 1024 is converting fine. The textures are messed up though. I need to figure out how to place the mesh properly I guess.

Edit: Of note, I had to use photoshop to add a black outline to the heightmap.

Image
cool huh

Ok I placed it like this in 3dsmax and it worked great. Top-center. I tried different resolutions and they all work.
Image
User avatar
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14077
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: GUIapp importing terrain from max

Post by Draconisaurus »

Tatu:
"Oh you're making a terrain from scratch, yeah that might be the issue.
Otherwise GUIApp CE can convert 8192x8192 terrains fine, if a big portion is low quality or flat.

Not sure if many people have tried to import a terrain directly from 3ds Max. Usually we go through a heightmap through TresEd and then into 3ds Max and back."

EDIT: AGAIN SORRY DRACO. I miss-clicked the edit button instead of the quote button and made this my reply. :( - Tatu

EDIT: It's all good! Happy to... make post slots for people? XD
Teromen
Parasaurolophus
Parasaurolophus
Posts: 258
Joined: Sun Jun 25, 2017 11:48 pm

Re: GUIapp importing terrain from max

Post by Teromen »

Hmm. I wonder if I can...

1. Import a bmp to TresEd.
2. Optimize the quads.
3. Import a flat bmp.
4. Export this to 3dsmax. Maybe with GUIapp?
5. Apply a displacement.
6. Export from max and convert with GUIapp.

To retain full detail and edit-ability. This way I could make rather high detail large maps and still convert with GUIapp and edit in unreal engine with the brush tools. This is the only way I can think of to get around not having a good optimize plugin for max.
I tried optimizer and pro optimizer and it glitches up bad. I don't know how to make them use squares.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GUIapp importing terrain from max

Post by machf »

I don't think you get it...

In order for GUIapp to optimize the terrain, it already has to have a certain limitation on the number of triangles. And yes, the .trr files (which GUIapp then converts into .wtd files) contain triangles.

I already told you the best workaround possible as long as no proper optimization in 3DS MAX is found: import the heightmap with TresEd (which will optimize the triangles, but the resulting .wtd won't be a proper one), export as .tpm, import the .tpm into .3DS MAX, export it as a .trr file, then use GUIapp to make a new .wtd file from it. That way you can work with larger terrains.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GUIapp importing terrain from max

Post by machf »

Looking at the maxscript included with the source, I see that aside from a displacement map for the terrain, they also used a tessellation map... which was to be selected from a previously established list.
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
Teromen
Parasaurolophus
Parasaurolophus
Posts: 258
Joined: Sun Jun 25, 2017 11:48 pm

Re: GUIapp importing terrain from max

Post by Teromen »

I got it to work. I imported a 128x128 terrain, optimized it with the quad tool. I couldn't export a flat optimized terrain from TresEd so what I did was export the normal terrain and in 3dsmax applied an editable poly and made planar flat along the z axis. Tesselated it, applied displacement with a high res heightmap. Exported it as a trr to GUIapp and then converted that and copied it the level folder. Works like a charm.

I used 128x128 to start because it was a lot quicker to use the quad tool. After re-importing it can be further optimized on the out of player space areas obviously. But it did work.

Now I can import high detail terrains with GUIapp. This used 1.6mb of an available 64mb of memory in GUIapp.

Image
Image
Image
Image
Image
Image
cartoon
Last edited by Teromen on Sun Nov 15, 2020 11:33 pm, edited 2 times in total.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GUIapp importing terrain from max

Post by machf »

If you can post images of the steps of the process, that would be the most interesting part...

EDIT: also, interestingly enough, the original devs also used 128*128 planes, according to what can be found on old MAX files...

The order they used is:
  • A 128*128 subdivision plane (2048m*2048m in size)
  • An "Edit Mesh" modifier
  • A "Displace" modifier with the main displacement map (Strength=489.777m)
  • An "UVW Mapping" modifier
  • A second "Displace" modifier containing additional detail (Strength=-20.0m), probably for carving riverbeds or such
The mesh has had a material applied which uses another bitmap, which is most likely the tessellation map
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
Teromen
Parasaurolophus
Parasaurolophus
Posts: 258
Joined: Sun Jun 25, 2017 11:48 pm

Re: GUIapp importing terrain from max

Post by Teromen »

Sorry about the lag of updating the post with images.

This is really the only way I can think of to optimize terrains for external editing with apps like world machine and using the brush tools in Unreal engine or equivalent. But it does seem to work just fine. I just hit me before bed that this may work. I was too tired to try it out heh.

You just start with a low poly example of your landscape in TresEd. Then add the detail later with a higher res height-map, in 3dsmax. To edit the heightmap you just use a full high resolution Landscape in unreal engine(or your choice, ue4 has good brush tools and is free). When you apply the heightmap to the mesh in 3dsmax it will align just fine and retain Trespasser optimizations.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GUIapp importing terrain from max

Post by machf »

See my latest edit of my previous post...
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
Teromen
Parasaurolophus
Parasaurolophus
Posts: 258
Joined: Sun Jun 25, 2017 11:48 pm

Re: GUIapp importing terrain from max

Post by Teromen »

Tessellation map? Now that is interesting. I need to get around to getting the dev tools.

I wish I could make a nice heightmap right now but I did this mainly to test the phys-x painter tool. Can't wait try that out. See how I can optimize the mesh's as far as rendering and memory usage in Trespasser.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: GUIapp importing terrain from max

Post by machf »

Unfortunately the MAX file in question didn't come with the corresponding bitmaps to look at how they were used...

I'm going to try your method now with some maps I've got lying around (though mine are 2048*2048).
Visit The Carnivores Saga - a forum devoted to modding Action Forms' Carnivores, Carnivores 2 and Carnivores: Ice Age games
Tres WIP: updated T-Script Reference and File Formats documents
Sound name listings for the Demo (build 117), Retail (build 116), Beta 103, Beta 99, Beta 97, Beta 96, Build 55, PC Gamer Alpha (build 32) and E3 1998 Alpha (build 22) TPA files
Post Reply