Post Pacific  

Go Back   Post Pacific > Восстановленный архив > Темы без сохранившегося раздела
FAQ Community Calendar Today's Posts Search

Notices

 
 
Thread Tools Search this Thread Display Modes
Old 02.04.2005, 08:08   #1
Digital
Архивный участник
 
Join Date: Nov 2004
Posts: 1,405
Default Current developments on Geodata

ok.. here's wat so far... (major contributions from yellowperil)

ok first 3 bits of file
10 19 = 16_25 file description (map ref)
80 00 10 00 next 4 always the same
^ ^
128 16 translates to these values

in dec 128,0,16,0 (looks like a starting point)

d8 72 03 00 19 ff 00 00 57 f2 00 00 00 00 is the next hieght
next info is for the WHOLE map for that level

(more will be included soon if we worked it out correctly)
some pics below
Digital is offline  
Old 02.04.2005, 08:15   #2
yellowperil
Архивный участник
 
Join Date: Mar 2005
Posts: 114
Default

further info.

The above only seems to be valid for external areas

the first 6 bits of info

17 0c 80 00 10 00 always is the same

Working out HOW they store the data,

Now my thinking is they have stored the data in the format they read in, eg ENGLISH read left to right downwards.

What do the people that coded this read, right to left downwards, upwards ??????

Yellowperil

NOTE, I noted that the values for hieght seem to be always the same for a hieght eg ΐνΐν always seems to be a value with zero, eg black on the hieght image.

more to follow

more I look at it the data is being read in from right to left

----------------------------
Height DATA is not in UNR

IT IS IN .UTX files

open it with UTPT
you will find there G16 Heghtmap texture and some alpha-layers textures.

All you need - get first G16 texture - take mipmap section with UE or any other HEX editor -and you have 131072 bytes of row height data directed line per line from left to right and from up to down
-----------------------------------------
ok we need the data for each layer.
from more digging it looks as if each layer is put into the conv, depending on its point in the package.

for example t21_17 even though no conv exists look at 21_25conv
anyway it looks like each layer is needed in the way its in the package, so we know layers for certain areas, not so important for outside, but for inside very important, each utx has at least 3 layers
21_17_G (ground)
21_17_g16 (overall hieght)
21_17_C (I am thinking this is a block, you can get past it)

each package can have UPTO 9 layers, with the hieght anywhere in it.

more to come
yellowperil is offline  
Old 05.04.2005, 01:49   #3
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

Ok here we go. i wrote a simple utility to load heightmap from greyscale image. just simple stuff nothing especial and worth to be downloaded
http://vaskes.primorye.net/Geodata.rar

and now i need a formulas to convert my heightmap to conv. if some one have much time to compare valid conv and heightmap for this conv - you are welcome.


conv header
17 19 80 00 10 00 00 00 00 00 00 00 01 00 00 00 01 00 00 00 <data block>

data block:
D0 ED D0 ED 00 00 D0 ED D0 ED 00 00 D0 ED D0 ED 00 00 D0 ED D0 ED etc
or
4F 01 6F 3F 00 00 4F 01 6F 3F 00 00 4F 01 6F 3F 00 00 4F 01 6F 3F etc

so who knows meaning of this 4 bytes ?

OFFTOPIC Digital - can you increase attachment quota? i cant attach anything
vaskes is offline  
Old 05.04.2005, 03:09   #4
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

shit shit shit,
have conversion problems. from DEC to HEX and finally writing all this stuff to binary file. can anybody help?
need procedures for conversion from hex to int and from int to hex.
vaskes is offline  
Old 05.04.2005, 04:23   #5
Digital
Архивный участник
 
Join Date: Nov 2004
Posts: 1,405
Default

how big do u need the attachment size to be?
hex is like 0 -> 9 then A -> F
so 16 values for each hex

there's probably a math calcuation for it tho.. could find it if u need it
Digital is offline  
Old 05.04.2005, 04:43   #6
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

problem solved thankyou
vaskes is offline  
Old 05.04.2005, 07:37   #7
Digital
Архивный участник
 
Join Date: Nov 2004
Posts: 1,405
Default

thx to bfwd

送一个 LV1 的 娃伊SF地图给大家吧 ^_^


这是 LV1 娃伊伺服端的地图 (中心塔部份)
能在中心塔部份水平面附近刷怪、传� �与掉落物品啊~



不过如果要在塔上刷怪,或使用全个� �伊地域,就要LV 2 的地图才行了





建议在奇岩与娃伊各加一个传送守门� �,那玩家就能在往返两地了~~


请在安全区域内刷传送守门人与增加� �送点


娃伊中心塔的安全区域

N: 82826, 248553, -10879
E: 86056, 250996, -10879
S: 80701, 254739, -10879
W: 79582, 250838, -10879








LineageII C2 Map
--------------------------------------------------
Region: 22_25
MapType: LV 1 [Single Layer/Single Surface]

Available safe transfer point:

N: 82826, 248553, -10879
E: 86056, 250996, -10879
S: 80701, 254739, -10879
W: 79582, 250838, -10879

click here
Digital is offline  
Old 05.04.2005, 10:17   #8
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

ok guys now i can write a binary file with header an other stuff. But still no have a formula to conver z coord from height map to conv file format.
cmon - somebody export a well known location and gimme formulas. i have no time for this.
vaskes is offline  
Old 05.04.2005, 12:44   #9
yellowperil
Архивный участник
 
Join Date: Mar 2005
Posts: 114
Default

ok can u explain what u are trying to do, it sounds as if your trying to convert one layer (map height) into the conv file.

I have been looking at the data and there are several layers

g, g1, g2, s, s1, r

each of these I belive are set heights

what I think in the header after the basic what area it is we ned to have this info (also if you notice the map areas are different aswell for certain layers, eg hieght is usually a 256x256 image, while layers are mostly 1024x1024).

I am thinking we need to have the header of each of these files as the layer ref, eg r (road) and the gird size(maybe) then its a case of on and off values.

Maybe even this each type of layers is set to a specific size so we dont need to say how big it is, dependant on the type of layer, eg dxt1, g16 or p8, this is maybe were it get the height info from.

Not 100% sure, but looking at the other geo file, you can see the same sort of value repeated over and over.

even looking at external only maps they have layers, eg road, etc, so I beleive ALL layer info is needed.
yellowperil is offline  
Old 05.04.2005, 22:58   #10
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

I'm exactly know theat all layer info is needed. Because using one layer geodata we cant add mobs to multilayered locations . Now i'm trying to do just one layered conv. This is much better then simble plain location, isn't it? After this will be done - we will research further.
vaskes is offline  
Old 06.04.2005, 01:14   #11
Stazis
Архивный участник
 
Join Date: Feb 2005
Posts: 200
Default

Ok - maybe this will help.
yellowperil - really there should be all layers but lets get a single at first.

vaskes - why have you decided that DATA BLOCK starts with 19th byte but not 18th - i assumed that it started with 00 00 because in your version maps with flat sea bottom should ends by 00 00 but they do not.

So it is 6 bytes structures (i think 3x16bit words).
Notice that all data in 00 00 starting strustures can be divided to 8
means 8 16 24 32 40 etc

my researches almost gave me the formula but it was based on experimental comparisions of random points from many maps and random lines.

Data in conv never changes if difference between neighbour points in heightmap is lower than 64 otherwise it changes +-8

As known hightmap is 16bit greyscale which means 0-65535 range of axis with step +-1

conv.dat (i took only first word of three e.g 00 00 C0 ED C0 ED 00 00 C0 ED C0 ED)
is 16bit scaled axis -unknown to + unknown with step +-8

every step more than on 64 in heghtmap asix gave step 8 in conv.dat

NOTICE. It is all related 00 00 starting structures. There is also 40 00 starting 64 words lenght blocks (probably that is another layers from heightmap)

so my formula was C=Z+8*(H%64)

where C - resulting coordinates for conv.dat
Z - thouse -unknown (lower limit of conv dat axis)
H - heightmap coordinate
% integer result of division.


vaskes - if have any ideas or wanna read all this in russian - PM me.
Stazis is offline  
Old 06.04.2005, 03:26   #12
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

Quote:
vaskes - why have you decided that DATA BLOCK starts with 19th byte but not 18th - i assumed that it started with 00 00 because in your version maps with flat sea bottom should ends by 00 00 but they do not.
yes yes i know it. it can be 00 00 or 40 00

Quote:
So it is 6 bytes structures (i think 3x16bit words).
Notice that all data in 00 00 starting strustures can be divided to 8
means 8 16 24 32 40 etc
yes. there are three 16bit words. first - unknown, i think this is water level, second one - unknown, i think this is terrain level. and third always equal to 00 00.

Quote:
As known hightmap is 16bit greyscale which means 0-65535 range of axis with step +-1
nope. there are very short color range on grayscale (from 63 to 128).

Quote:
so my formula was C=Z+8*(H%64)
where C - resulting coordinates for conv.dat
Z - thouse -unknown (lower limit of conv dat axis)
H - heightmap coordinate
% integer result of division.
this is wrong H/64 => [1,2] so there are only two meanings on your fulmula z+8 and z+16

my formula was c:= -H*32+65536 - wron too.

ok. my icq is 335916424. lets talk about it.
vaskes is offline  
Old 06.04.2005, 06:13   #13
badjoe
Архивный участник
 
Join Date: Feb 2005
Posts: 72
Default

there are more than the 00 00 or 40 00 structures.

you have structures beginning with XY 00 followed by XY sub-structures.
sub structures can be one of these
01 00 followed by one height coord
02 00 followed by two height coord
03 00 followed by 3 height coord
04 00 followed by 4 height coord

so we have 3 types of structures, 4 types of sub-structures

there are a total of 65536 structures (256x256 square maps)


may not be very clear, I need some sleep ^^
badjoe is offline  
Old 06.04.2005, 08:10   #14
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

lazy shrugs i think i did one layered conv file. here is a file for testing. test it and say is it ok? no reports - no further work.
cheers

so we need the following:
1. dig a header
2. dig how layer described in header
3. dig how layer starts in a conv file
4. dig how its ends in a conv file
vaskes is offline  
Old 07.04.2005, 03:56   #15
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

Some stuff fixed.
vaskes is offline  
Old 07.04.2005, 06:23   #16
badjoe
Архивный участник
 
Join Date: Feb 2005
Posts: 72
Default

tested it, seems like heights are about 1300 too high
badjoe is offline  
Old 10.04.2005, 05:33   #17
Digital
Архивный участник
 
Join Date: Nov 2004
Posts: 1,405
Default

map making [1]

some impt note forehand
HEX->DEC 十六进制转十进制
DEC->HEX 十进制转十六进制
HEX-EDIT 十六进制编辑,需使用 UltraEdit-32 或 HexEditor等软件

------------------------------------------------------------

region
mapname on the server end,like aden_pvp is 24_19,devil's island is 21_24, etc
could consider looking at region map
http://bbs.99nets.com/read.php?tid=178732

------------------------------------------------------------

Grid reference

lineage 2 uses 20_18 as region and 0,0 as position
every region has 32768 x 32768 = 1072741824 points

every +32768 to X, e.g (32768,0) map will shift to next map 21_18
every +32768 to Y, e.g (0,32768) map will shift to next map 20_19

------------------------------------------------------------

region grid reference formula
X-axis:(X-20)*32768,(X-20+1)*32768
Y-axis:(Y-18)*32768,(Y-18+1)*32768

e.g water city (23_24),
(X-20)*32768,(X-20+1)*32768 = 98304, 131072
(Y-18)*32768,(Y-18+1)*32768-1 = 196608, 229376

23_24 region is within grid reference (98304,196608) (98304,229376)(131072,229376)(131072,196608)

------------------------------------------------------------

LV1
single surface, single layer server map
LV1 is single surface, single layer, distinction is easy to make

thru DEC->HEX / HEX-EDIT ,and u'll be able to do it

there's only single layer, single height
so some test map could probably work quite well with certain flat grounds

but at areas outside the flat ground, it'd have problems.
because outside this area, the ground has no height.

but to some single layer single height maps are fine, like aden pvp(24_19), field of silence(22_23), field of whisper(22_24) these maps without much difference in height

LV1 could be directly used.

------------------------------------------------------------

LV2
single surface, multi layered server map

LV2 is single surface, multilayered, distinction is inner-region could have different height layers

situation is like using a cloth and cover it on a irregular surface
basically it's only single layer, but could be used on any point of the surface.

i cant handle multilayer region as yet.
but most of l2 c2 maps used this type.

other than a more detailed LV1 region
like water city (23_24), water garden(22_25), devil's island(21_24), blazing swamp(24_17), etc maps.

LV2 info exact grid reference could be used to make geo_index
could be used for some region that could decrease HP, set movement space, etc

detailed LV2 could even fix old server maps, stuck mobs, etc problems

need LV1 map making skills, understand format storing, familiar with mapping tools, and of cuz determination

------------------------------------------------------------

LV3
multi surface, multi layered server map

Lv3 is multi surface, multi layered. distinction is it could handle all map problems. like TOI, castles, underground cities, need to use LV3

detailed Lv3 could even replace the old server maps

require Lv2 skills

------------------------------------------------------------

map versioning

LV1.bfwd_050401
LV2.xx.xx8.bfwd_050401
LV3.xx.xx8.bfwd_050401


versioning is impt
cuz different author has different needs n methods to create the map

LV2.xx.xx8.bfwd_050401

LV2 is method,13 is how many layers,128 refers to the unit size,lastly bfwd_050401 is the author and date

tho the more layers there are, the more accurate the unit size, the map would also be more accurate
but on the other hand, more problems might also araise, so sometimes using a not so accurate map might be better

Lv1 just has 1 layer so doesnt need to add it.
Digital is offline  
Old 10.04.2005, 05:36   #18
Digital
Архивный участник
 
Join Date: Nov 2004
Posts: 1,405
Default

LV1 making method

field of whisper (22_24 as example)

1. use L2J emu,enter "/loc" to find height (Z-axis)


------------------------------------------------------------
2.
calculation method

at this point the Z is -3650
if it's a negative number, add 65536 to the number, if it's a positive number u dun need to do it.

-3650 + 655336 = 61886

then change 61886 to HEX
61886(DEC) -> F1BE

-3650 will be stored in the conv.dat as BEF1
(number like AABB,would be stored as BBAA )

so (-3650)DEC->HEX = BEF1

------------------------------------------------------------
3.

use one Lv1 map as example
(like 16_22_conv.dat,16_23_conv.dat etc)

the first 2 numbers would be the region's number

22(DEC) = 16(HEX)
24(DEC) = 18(HEX)

so
region 16_22 is "10 16"
region 22_24 is "16 18"

at LV1 single surface single layer,there's only height values
take 00 XX XX XX XX 00 the XX XX and change them to BD F1



as to y XX XX are repeated?y is it stored as XX XX YY YY?all these will be explained at Lv2 tutorial

so the whole 22_24 region's height would be -3650
at this height or below, it could be used properly

------------------------------------------------------------

4.
tho it's height and below surface, but actually, all movements would be calculated with -3650 as a single surface
if this height has a difference of (±50?), the client could still manage;

so LV1 most ideal is to move the height higher

like -3650,would become -3650+50 = -3600
(-3600)DEC->HEX = F0F1

do not change this height too high
overly high height would result in mob/drop to drop down from high heights

------------------------------------------------------------
5.
single surface single layer Lv1 has only 2 places to edit

1. region number (the first 2 numbers)
2. single layer height value

easy enough?

of cuz, if it's single surface, single layer, it wouldnt be able to handle multi height problems
example would be water garden(22_25),
this region has multi layered region
using lv1 only could open the base layer height, but using it as a basis to test is pretty useful
http://bbs.99nets.com/read.php?tid=180725

if u want to use multiple height layers, u'll have to use Lv2/Lv3 method.
Digital is offline  
Old 10.04.2005, 05:40   #19
Digital
Архивный участник
 
Join Date: Nov 2004
Posts: 1,405
Default

附件:
HEX->DEC/DEC->HEX Javascript 计算器


天堂II 地图专用,
例如在列1输入Z值 (-3650),按 "DEC->HEX",在列2 就会出现 (BEF1)
这个HEX数值可以直接用于伺服端地图� �免除了(步骤2)的计算


同样在列2 输入HEX值,按 "HEX->DEC",就可转换为十进位的 Z值



↓存档为HTML即可↓

Code:
<html>
<head>

<title>L2 Map Z-index Cal</title>
</head>




<body>
<form name="T2MapCal">
    <input name="decToHex" type="text"><a onclick= decToHex()> Dec -> Hex </a>
    


    <input name="hexToDec" type="text"><a onclick= hexToDec()> Hex -> Dec </a>
</form>


<script>


function hexToDec() 
{ 
       hexStr = document.T2MapCal.hexToDec.value;

       if (hexStr.length>4) {document.T2MapCal.decToHex.value = "OverFlow";}
       
       else{
       
              hex = hexStr.charAt(2)+ hexStr.charAt(3) + hexStr.charAt(0) + hexStr.charAt(1);
              dec = parseInt(hex,16); 

              if (dec >= 32768) { dec -=65536;}
              
              document.T2MapCal.decToHex.value = dec;
       }
       
} 

function decToHex() 
{ 
  var hexStr = "0123456789ABCDEF"; 
  
  dec = parseInt(document.T2MapCal.decToHex.value);
  
  if ((dec >= 32768) || (dec < -32768)) {document.T2MapCal.hexToDec.value = "OverFlow";}
  else
  {
         if (dec < 0) {dec +=65536}
  
         var low1 = (dec/256) % 16;
         var high1 = (dec/256 - low1)/16;
  
         var low2 = (dec%256) % 16;
         var high2 = (dec%256 - low2)/16;
  
         hex = "" + hexStr.charAt(high2) + hexStr.charAt(low2)+ hexStr.charAt(high1) + hexStr.charAt(low1);
         document.T2MapCal.hexToDec.value = hex;
  }
} 
 
</script>

</body>
</html>
Digital is offline  
Old 11.04.2005, 13:53   #20
badjoe
Архивный участник
 
Join Date: Feb 2005
Posts: 72
Default

damn I can't find the good formula always problems somewhere >_<
Vaskes you got something working ?
badjoe is offline  
Old 11.04.2005, 19:04   #21
badjoe
Архивный участник
 
Join Date: Feb 2005
Posts: 72
Default

Quote:
Originally Posted by vaskes

Quote:
As known hightmap is 16bit greyscale which means 0-65535 range of axis with step +-1
nope. there are very short color range on grayscale (from 63 to 128).
No, as Stazis said, heightmaps are 16bit greyscale
you must extract them as raw data not as an image format or you'll lose data.

I can't find the correct formula to conv, it pisses me off >_<
badjoe is offline  
Old 11.04.2005, 19:32   #22
yellowperil
Архивный участник
 
Join Date: Mar 2005
Posts: 114
Default

question for you

how can different layers have different grid sizes?
yellowperil is offline  
Old 12.04.2005, 02:46   #23
badjoe
Архивный участник
 
Join Date: Feb 2005
Posts: 72
Default

sorry, I'm too tired tonight
I'll try to answer tomorrow and post some info on how I think this may work
badjoe is offline  
Old 12.04.2005, 03:57   #24
vaskes
Архивный участник
 
Join Date: Feb 2005
Posts: 156
Default

so abt header.
in 20_20 first 40 00 header starts from byte #394. ($18A)
file header is 14 14 80 00 10 00 53 56 22 00 37 e6 00 97 84 00 00 there are 4 G levels, 1 S, 2 C and 1 R
for example G1 from there have palette 121 ($79)
i thought that white color (FF from bitmap) = palette color in conv. its not true ((
the word must be 79 00 there are a lot of such words there but mush less then FF in bitmap (43 words 79 00, but MANY of them in 20_20_G1)

so im stuck. header info - not offsets, because this bytes too small and !=18A
palette meaning != level info in conv.
by the way conv file content is quite irregular for BLACK_AND_WHITE bitmap
vaskes is offline  
Old 22.04.2005, 05:34   #25
Digital
Архивный участник
 
Join Date: Nov 2004
Posts: 1,405
Default

rereading of geodata stuff
note #1

as of current C2 client and server, all new areas uses a new theory of an [empty map]

when killing a mob, the drop will drop onto the [empty map]'s height
as for the player, they have the client maps to map them to the correct position to be shown correctly.

but for NPC it's different, it has to read the conv.dat on the server for it's correct position. then spawn ontop of the height as on the conv.dat

for those xx_xx_conv.dat it's all abt height information
complex maps have have more data on height information (e.g caves, towers)

but if they are flat grounds like field of silence, etc with not much height areas it'd be quite easy. all we need to do is edit the xx_xx_conv_dat to set the height correctly and we'll be able to spawn/kill mobs correctly.
Digital is offline  
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 18:15.