Battlezone 1

Community Forum
Home Page Home Page Home Page
  Register
Login 

Delete all board cookies


Contact Us | All times are UTC



Welcome
Welcome to Battlezone 1 Forum!

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. Registration is fast, simple, and absolutely free, so please, join our community today!


Home Page Home Page  [ 4 posts ] 
 
Previous topic | Next topic 
Author Message
Offline 
 Post subject: where can I find maketrn source code?
PostPosted: October 11th, 2010, 5:37 pm 

Joined: September 29th, 2010, 5:18 pm
Posts: 13
I am trying to port BZ1 maps to UDK and I need the maketrn source code to understand how the map files(not map textures) are used together so I can accurately port BZ1 maps to the Unreal Development Kit.

Thanks,


Top
 Profile  
 
 
Online 
 Post subject: Re: where can I find maketrn source code?
PostPosted: October 11th, 2010, 11:08 pm 
User avatar
senior member

Joined: June 1st, 2008, 9:16 pm
Posts: 4003
I don't think it exists where anybody can find it. It's as easy to find as the RO source code, UNZFS source code, etc. We were lucky enough to have Ken Miller with the BZ source code making a patch. :|


Top
 Profile  
 
Offline 
 Post subject: Re: where can I find maketrn source code?
PostPosted: October 12th, 2010, 5:11 am 

Joined: September 29th, 2010, 5:18 pm
Posts: 13
Mainly I need the format of the *.mat file. Do you think if I asked Mr Miller extra nice, I could at least get the format specs?


Top
 Profile  
 
Offline 
 Post subject: Re: where can I find maketrn source code?
PostPosted: February 14th, 2011, 3:44 am 
User avatar
BZ programmer

Joined: November 20th, 2009, 8:17 pm
Posts: 2406
From what I can tell based on the source code, the terrain is organized as an array of "zones". Each zone consists of a 128x128 grid of 12-bit height field entries (the .hgt file) and a 64x64 grid of 16-bit material entries (the .mat file). The material entries are a bit complicated since they pack a lot of data into a very small space.

From least-significant bit to most-significant bit:
2 bits at shift 0 (0x0003): Variant
2 bits at shift 4 (0x0030): Rotation
1 bit at shift 6 (0x0040): Flip
1 bit at shift 7 (0x0080): Cap
4 bits at shift 8 (0x0F00): Next
4 bits at shift 12 (0xF000): Base

If Base and Next are the same, it's a Solid tile
If Cap is 0, it's a CapTo tile where Base touches Next on only one side
If Cap is 1, it's a DiagonalTo tile where Base touches Next on two adjacent sides
Variant selects from several similar textures for the tile (_A0, _A1, _A2, and _A3)
Rotation, Flip, and Cap combine to select the texture coordinates for the tile:
0: (u, v) cap 0
1: (-v, u) cap 90
2: (-u, -v) cap 180
3: (v, -u) cap 270
4: (-u, v) flip across z
5: (-v, -u) flip across -x/z diagonal
6: (u, -v) flip across x
7: (v, u) flip across x/z diagonal
8: (u, v) diag 0
9: (-v, u) diag 90
10: (-u, -v) diag 180
11: (v, -u) diag 270
12: (-v, -u) flip across -x/z diagonal
13: (u, -v) flip across x
14: (v, u) flip across x/z diagonal
15: (-u, v) flip across z

Fun, eh? :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Home Page Home Page  [ 4 posts ] 

Contact Us | All times are UTC


Who is online

Users browsing this forum: No registered users and 0 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
Jump to:  

Donate Now
Donate Now


Powered by Skin-Lab © Alpha Trion
suspicion-preferred