Post Pacific

Post Pacific (https://postpacific.mmorpg-game.online/index.php)
-   Lineage 2 Server Modifications ONLY! (https://postpacific.mmorpg-game.online/forumdisplay.php?f=28)
-   -   -- Deleted -- (https://postpacific.mmorpg-game.online/showthread.php?t=5576)

FidoW 27.08.2006 22:58

-- Deleted --
 
-- Deleted --

Drag 28.08.2006 07:00

FidoW i didnt check but i only add +30 to z coords and seems to be alright ^^

Thx Masta ;)

Anyway giving 'ready' data is not good as make short tutorial so people get learn it and at last we get leechers off x] xDDDD

Mirror 28.08.2006 11:30

the ziggurats' teleport PosZ is NOT wrong. the geodata shared aka 'fake geo' made by client generation with good meshes and awful terrain causes the problem. The tombs have 2 layers very close one to the other and the PosZ is between them so you get teleported to the lower one with the result of not being able to move from the first chamber. So one solution for this is to make the PosZ about 50 units higher in npcdata for each of enter_necro/catacomb.

Stazis 06.09.2006 11:00

Mirror - can you give some tips what should be corrected with terrain
do so i'll fix a convertor and release a new pack.

i already know that should use 8*8 blocks and calculate walkability flags for terrain too
only thing bothering me is an technique how client forms an triangles from heights - it is not formed regularly from left top to right buttom corner or vice versa - there is someth like diamond triangulation used to define ... if i find it - terrain will be perfect.

Domzelan 06.09.2006 11:58

Strazis if u fix your convector - it will be the best geo convector i think :)

MuNLoK 06.09.2006 12:26

Yes, I think it too

nish 12.09.2006 19:26

thanks fidow ;) works perfect

Mirror 12.09.2006 20:07

Quote:

Originally Posted by Stazis (Post 66621)
Mirror - can you give some tips what should be corrected with terrain
do so i'll fix a convertor and release a new pack.

i already know that should use 8*8 blocks and calculate walkability flags for terrain too
only thing bothering me is an technique how client forms an triangles from heights - it is not formed regularly from left top to right buttom corner or vice versa - there is someth like diamond triangulation used to define ... if i find it - terrain will be perfect.

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;
}

Sakumi 12.09.2006 20:43

Quote:

Originally Posted by Mirror (Post 67209)
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 ;)

Stazis 13.09.2006 12:36

Mirror looks like we are talking on different languages.
i know how it is stored and how to read it. i'm using 16-bit values directly from G16 texture.
the mess with a terrain you see is not couse of mispropreate reading or calculation of heights.

1. using high density blocks for any ground 128*128 points square is space-expencive a lot - blocks of geodata starting with 00 00 is not maden for nothing. just must define wich square of ground to represent as 00 00 block and wich should be more exactly presented with 40 00 blocks

2. i did not used terrain in walkability calculation - this is a main trouble all you see - couse square that have even single block-walkability flag would be automatically represented as 40 00 block ( changing this probably will fix first problem too)

3. as i sayd - same heights can give you totaly different relief - couse it depends on how you create triangles from it. (see images)
if you tace a look on ground in ///c_rmode 1 you will notice that method of triangulation of terrain is not constant (i mean not from north-west corner to south-east corner) - and the heights of terrain depends on it

Вложения из исходного сообщения (сами файлы в копии отсутствуют):
var_a.jpg — 1918 байт
var_b.jpg — 1850 байт

Mirror 13.09.2006 19:41

yes you use more space but i never bothered to make a optimization algo for flat terrain replacing 4000 with 0000 cuz i had 6gig ram in 2 boxes so i didn't consider necessary to bother with optimization and i always liked it 2048x2048.

about the triangulation of terrain when in ///c_rmode is just a matter of the engine since all 3d engines basic unit is not square but triangle it has not to do with geodata or flags

what we did to fix the geos was by making a terrain only 2048*2048 with flags and replace all the geos 0000 blocks with our terrain 2048*2048 blocks

edit :. im speaking about the pack where the meshes were good but all terrain was 0000 layers only ( except terrain over tombs or other underground buildings )

edit2 : as john karmack said 'it's all about triangles'


All times are GMT. The time now is 22:07.