12.09.2006, 20:43
|
#6
|
|
Архивный участник
Join Date: Apr 2005
Posts: 555
|
Quote:
Originally Posted by Mirror
about terrain if you open utx with UTPT you will see the BMP size is a bit more than 131072 bytes ( 16 bit accuracy ) and has also an offset. the corect size is 131072 bytes. the more bytes are useless header you just need to read 131072 bytes, calculate from the end and remove the difference. you will have a one channel 16but accuracy .raw ( or .bmp if you wish but reading a .raw is much easier ). you can make this 256*256 .raw into 2048*2048 via photoshop and then just read and write heights to a terrain only geo and voila you have PERFECT TERRAIN, we also used to add 32 units height to geo and then shift the terrain two small ( 2048 ) blocks in x and y. we use zdiff 24 for flags but you in some cases even 16 is good
so it's not true you cant make perfect terrain from .bmp you just need not to open it with UTPT cuz it discards 8bit info
p.s. catacomb of branded for some reason has serious problems and also terrain over tombs when it is 4100 layer has no flags ( devastated castle front of it, EG tomb ). i also think in some geos you frame it with flags
utxreader.c
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char *argv[]) {
FILE *fi, *fo;
unsigned long int counter = 0;
unsigned char dummy,height;
unsigned int offset,size,realoffset;
unsigned int x,y;
if (argc != 5) {
printf("Usage : utxreader 'UTX file' 'RAW file' 'OFFSET' 'SIZE'\n");
exit(0);
}
offset = atoi(argv[3]);
size = atoi(argv[4]);
realoffset = offset + size - 10 - 131072;
if ((fi=fopen(argv[1],"rb"))!=NULL) {
for (y=0;y<=realoffset-1;y++) fread(&dummy, sizeof(dummy), 1, fi);
if ((fo=fopen(argv[2],"wb"))!=NULL) {
for (x=0;x<=131071;x++) {
fread(&height, sizeof(height), 1, fi);
fwrite(&height, sizeof(height), 1, fo);
counter++;
}
}
fclose(fo);
}
fclose(fi);
printf("%lu heights were written\n",counter);
return 0;
}
|
Just to note, I can verify the issues around CoB. It looks ok in the geoviewers, but occasionaly a player running to CoB will just fall through the ground and land in the catacomb lol. I attempted to regenerate it but of course, since it was the same tool, same problem
|
|
|