TresCom Forums

TresCom : The Trespasser Fan Gateway...
It is currently Wed Jul 15, 2020 12:07 pm

All times are UTC




Post new topic Reply to topic  [ 10 posts ] 
Author Message
PostPosted: Sat Dec 14, 2019 8:00 pm 
Offline
Brachiosaurus
Brachiosaurus
User avatar

Joined: Sun Mar 08, 2015 9:54 pm
Posts: 165
Location: North America
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.


Top
 Profile  
 
PostPosted: Sat Dec 14, 2019 8:54 pm 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 11801
Location: Lima, Peru
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


Top
 Profile  
 
PostPosted: Sun Dec 15, 2019 12:30 am 
Offline
Brachiosaurus
Brachiosaurus
User avatar

Joined: Sun Mar 08, 2015 9:54 pm
Posts: 165
Location: North America
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.


Top
 Profile  
 
PostPosted: Sun Dec 15, 2019 4:00 am 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 11801
Location: Lima, Peru
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:
-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:
-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


Top
 Profile  
 
PostPosted: Sun Dec 15, 2019 4:40 pm 
Offline
-=TresCom Website Manager=-
-=TresCom Website Manager=-
User avatar

Joined: Fri Jun 24, 2005 9:40 pm
Posts: 4057
Location: Sweden
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

_________________
"...there used to be more benches, but InGen's workers removed them during the evacuation in the name of framerate."

"The main laboratory and administrative buildings. This is where we made our work, where the real magic trick happen. When they are in need of height fixing, they'll come here." - Hammond


Top
 Profile  
 
PostPosted: Mon Dec 16, 2019 5:55 am 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 11801
Location: Lima, Peru
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


Top
 Profile  
 
PostPosted: Sun Dec 29, 2019 12:09 am 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Mon Dec 06, 2004 5:21 pm
Posts: 12247
Location: Portland, OR
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:

_________________
T-Script Reference / Trespasser Millennium / JP Dark Secrets / Tres File Box / Chaotician Drac Youtube Channel


Top
 Profile  
 
PostPosted: Sun Dec 29, 2019 4:47 pm 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 11801
Location: Lima, Peru
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


Top
 Profile  
 
PostPosted: Mon Dec 30, 2019 8:12 pm 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Mon Dec 06, 2004 5:21 pm
Posts: 12247
Location: Portland, OR
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.

_________________
T-Script Reference / Trespasser Millennium / JP Dark Secrets / Tres File Box / Chaotician Drac Youtube Channel


Top
 Profile  
 
PostPosted: Tue Dec 31, 2019 7:23 am 
Offline
T-Rex Killer
T-Rex Killer
User avatar

Joined: Thu Apr 24, 2003 11:20 pm
Posts: 11801
Location: Lima, Peru
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 10 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron

Powered by phpBB® Forum Software © phpBB Group