How to expand the size of a level's terrain?

Creating new content for Trespasser!

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

Post Reply
User avatar
TrespasserGuy
Parasaurolophus
Parasaurolophus
Posts: 359
Joined: Sun Mar 08, 2015 9:54 pm
Location: North America

How to expand the size of a level's terrain?

Post by TrespasserGuy »

Is there a way to expand the terrain size of a level? For example, increasing the size of the terrain of minilev to a JPDS level size.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: How to expand the size of a level's terrain?

Post by machf »

Basically, you need to import a new terrain for that. Export the terrain as a .BMP greyscale heightmap using TresEd, then enlarge the canvas (not the picture) using some image editor (Paint Shop Pro, for example), leaving the original heightmap in the middle of the new image (or you can copy and paste it into a larger blank square, if you don't have the option to enlarge the canvas without enlarging the image). Then you reimport the new heightmap into the level using TresEd (but be sure to indicate the new coordinates for the terrain corners).

The Minilev (which is based off the TestScene) has an area of 128m*128m, while regular Trespasser levels have an area of 2048m*2048m. JPDS, OTOH, uses a single map which is 8192m*8192m, I think... (or maybe 4096m*4096m, can't remember right now, but it's larger than the retail levels).

SIDENOTE: exporting the TestScene level gives you a neat 128*128-pixel heightmap, but exporting the other retail levels gives you 1024*1024-pixel heightmaps, not 2048*2048-pixel ones. I think TresEd may have an internal limitation which forces it to use 1024 as the maximum size, or something like hat...
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
TrespasserGuy
Parasaurolophus
Parasaurolophus
Posts: 359
Joined: Sun Mar 08, 2015 9:54 pm
Location: North America

Re: How to expand the size of a level's terrain?

Post by TrespasserGuy »

Ok, but what if the .bmp I exported was already 1024*1024? I'm not using the minilev terrain file, I just said that as an example.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: How to expand the size of a level's terrain?

Post by machf »

Well, then you do the same with the new size... extend the canvas to 2048*2048, for example, and when importing, tell TresEd that the area dimensions are now 4096m*4096m (assuming the 1024*1024 bitmap was the result of exporting a level that was 2048m*2048m and now you want to double the dimensions of the square), and that the corner is now at a different position...

Going back to the TestScene/Minilev example, when you exported the terrain as a bitmpa, it also produces a companion .txt file which contains the following information:

Code: Select all

-64 -64 128 0.0804595
The first two values are the coordinates of the "lowest" corner of the level (since TestScene and Minilev are centered around 0,0,0), the third one is the size of the square (128m, which in this case matches the width and height of the .bmp file), and the third one is the height factor (which multiplied by the greyscale pixel value between 0-255 will give the "real" height of the map). So, if you had enlarged this to a 1024*1024 bitmap, with the original square at the center, when importing the new terrain heightmap with TresEd you would need to indicate the corner coordinates as -512 and -512 (still centered at 0,0,0), the size as 1024 and the height factor as 0.0804595, the same as before.

Remember, all terrains in Trespasser MUST be squares with the size of their sides being a power of 2 (1*1, 2*2, 4*4, 8*8, 16*16, 32*32, 64*64, 128*128, 256*256, 512*512, 1024*1024, 2048*2048, 4096*4096, 8192*8192...). I think the limit is 8192*8192, can't remember if anyone tried a larger level. If the size of the square .BMP heightmap is different from the size of the terrain, it means the terrain resolution is not 1m, but the result of dividing the terrain size by the bitmap width or height. In the example of retail Trespasser levels (which are 2048m*2048m) exported with TresEd as 1024*1024-pixel heightmaps, the resolution is 2048/1024=2m, which means they will have less detail than the TestScene/Minilev heightmap (terrain size=128m*128m, 128*128-pixel heightmap gives a resolution of 128/128=1m).

So, in the case of for example the Town level, the heightmap is a 1024*1024-pixel greyscale .BMP the accompanying text file looks like this:

Code: Select all

-1024 -1280 2048 1.03359
This means the level is centered around (0, -256, 0), and the resoluton is 2m.
x center coordinate = -1024 + (2048/2) = 0
y center coordinate = -1280 + (2048/2) = -256
terrain resolution = 2048/1024 = 2m

If you now enlarge your canvas to 2048*2048, keeping the original heightmap at the center, your new terrain size will be (2048*2m) = 4096m and the new corner coordinates will be:
x corner coordinate = 0 -4096/2 = -2048
y corner coordinate = -256 -4096/2 = -2344
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
tatu
-=TresCom Website Manager=-
-=TresCom Website Manager=-
Posts: 5088
Joined: Fri Jun 24, 2005 9:40 pm
Antispam: No
Location: Sweden
Contact:

Re: How to expand the size of a level's terrain?

Post by tatu »

Don't forget that imported heightmaps through TresEd is messed up and need to be exported to .TPM, into 3ds Max, exported to .TRR? and converted through GUIApp. :P
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."
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: How to expand the size of a level's terrain?

Post by machf »

Yes, but that part comes afterwards... ;)
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
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: How to expand the size of a level's terrain?

Post by Draconisaurus »

Soooo, bear in mind that grayscale heightmaps lose quality and detail when used as a terrain creation method. Machf should be able to talk you through a process of importing your original terrain into MAX, with full detail, then giving it a larger area around that, then exporting it with scripts, into GUIApp, etc. :nerd:
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: How to expand the size of a level's terrain?

Post by machf »

Actually, MAX has a worse (IMO) limit regarding terrain resolution (detail), too: since you can't subdivide a square in more than 1000*1000 smaller squares, and Trespasser MUST use powers of 2 for the terrain squares, that means the largest terrain you can generate by using displacement maps in MAX is 512*512 (as 1024*1024 is beyond what MAX allows you to use). If you use a 512*512-pixel heightmap, that will give you a terrain resolution of 1m; if you use a 1024*1024-pixel heightmap, it will give you a terrain resolution of 2m; 2048*2048 gives you a 4m resoltuon; etc. Whereas if you import a 1024*1024-pixel terrain with TresEd, indicating that it covers an area of 1024m*1024m, you'll still have a 1m resolution; or a 2048*2048-pixel heightmap indicating a 2048m*2048m area, etc. All you need to do afterwards is export the terrain as a .TPM file, import it into .MAX (it will take a long while, possibly), re-export it as a .trr file, and use GUIapp to generate a fixed .wtd file. Afterwards, if you want, you can use GUIapp to convert that .wtd into a .tri file and import it back into .MAX for safekeeping...
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
Draconisaurus
T-Rex Killer
T-Rex Killer
Posts: 14046
Joined: Mon Dec 06, 2004 5:21 pm
Antispam: No
Location: Isla Sorna
Contact:

Re: How to expand the size of a level's terrain?

Post by Draconisaurus »

No no no, I mean, export the original terrain from the level as a TPM file and put that into MAX. No approximated heightmap bullshit. Then encorporate that model with a bigger one inside MAX.
User avatar
machf
T-Rex Killer
T-Rex Killer
Posts: 12368
Joined: Thu Apr 24, 2003 11:20 pm
Location: Lima, Peru
Contact:

Re: How to expand the size of a level's terrain?

Post by machf »

I really wouldn't recommend going that way. Unless you only want to export a gresycale heightmap from within .MAX with higher resolution.
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