PDA

View Full Version : geodata my share


red
07.09.2005, 16:58
thats all my work i have done so far... dont complain about shitty php code -> feel free to make it better and share it with others! also dont pm me!
if u got a question -> ask here.

im giving it out since i think l2off got no future - my opinion, and im starting to work on l2j...

some explainations and theory...

i have seen that many ppl do application to generate geodata 'on the fly', i dont think its a good idea, it will be complicated to code and even if u try to create map grid-only based as result u will have hell buggy map and if u try to create 64 or 3type(flor) header map based it will couse great load to server... thats why i made it sql based (to clean up 0,64 and 3type header)

attachments:
- sql-geodata.rar is the empty mysql database
- load.php loads existent geodata into sql
- check.php calculate new header
- write.php write new map from sql
- flat_flors_fix.php not done, grid only based - allow to change existent data into solid area or bridges (if this one dosnt work i got somewhere older version)
- load-l2j.php a sample script to load heights from l2j dump, decompress the bin file with winrar first!

how to calculate bridges height -> ((ingame_height*2)/16-1)=> remove after point number and do this -> *16+1
this formula will give u a height that have to be used in geodata

flat_flors_fix.php does work - parttly, after fucking around with it, i got an idea to use pictures to generate map, theory:
1024x1024 bmp will allow to create 1 layer of geodata, 1pixel=1subgrid, different colors will allow to define height; such script should allow for example to load bmp generated from l2j, without bridge and lower flors but those r simple to add :)
i think there is no need for further explanation?

later i will post my theory about client side bmp textures..

sry for my bad eng.

bwgreen
07.09.2005, 19:06
Wow...... I'll give feedback ASAP!

dragoon69
07.09.2005, 21:25
No config.php?

torune
07.09.2005, 21:32
config.php are just basic settup for sql database
*good share and agree with the no future thinking

elcapo
07.09.2005, 22:17
good job red, but, i have a doubt about the heights in 64 and 64+ floors (40 00 and 4+ ++), about the way of calculating the height.

I mean, i think the heights of this floor types (64 and 64+) are "variations of height" between the 00 00 floors around it. Im trying to figure out it.

for example:
in a 64 floor type, -2692 is NOT -1 * 65536 - 62840 (F578)

i think it in depends of the floors around it.

s00r
07.09.2005, 22:41
hm..
the phps.rar work with mYsql db,
sql-geodata.rar - for mSsql...
why?

elcapo
07.09.2005, 22:46
-2692 => F8EA in the map if the indicator is greater than 64


but, what is the "formula" for indicators greaters than 64?

red
08.09.2005, 06:42
-2692 => F8EA in the map if the indicator is greater than 64


but, what is the "formula" for indicators greaters than 64?

0 and 64 are 1:1
flors (64++) need this formula: ((ingame_height*2)/16-1)=> remove after point number and do this -> *16+1

24_19 coliseum have been made this way...



for example:
in a 64 floor type, -2692 is NOT -1 * 65536 - 62840 (F578)

i think it in depends of the floors around it.

where did u get that from? :s

elcapo
08.09.2005, 09:13
thats the formula!
I read in ur code this:

[quote="ur code"]if ($hex_a > "32767") {$hex_a = -1 * (65536 - $hex_a);} else {};[/qoute]

and i tought u was in the same error than me.

i think even 64's floor type are like this, but, maybe im wrong, i will check in a minute.

UStas
08.09.2005, 10:52
This is good share /// But we cannot user this for castles, toi, etc...

L2J dont have walls, so if we create (sample) geodata for castle all mob`s from castle bean goin over wall. :)

Any one have formula for calculate height from bmp scale?

To Digital - I lost my pass for acc and my acc is blocked now :( My prev name anrysys// Help me plz

UStas
08.09.2005, 10:53
s00r - You can use locations.sql from l2j...

elcapo
08.09.2005, 11:55
red, u said that 0 and 64 are 1:1 , and 64+ are 2:1 (aprox), are u sure of that? i mean, 64 are 1:1 ? im checking it on 20_22 geo, and 64 appers to be 2:1.
I have modified this geo with 2:1, and the heighs are "some good", but not exactly the same. (im trying to take the inverse formula (from geo to ingame_height)).

red
08.09.2005, 14:03
thats the formula!
I read in ur code this:

[quote=ur code]if ($hex_a > "32767") {$hex_a = -1 * (65536 - $hex_a);} else {};[/qoute]

and i tought u was in the same error than me.

i think even 64's floor type are like this, but, maybe im wrong, i will check in a minute.

that convert unsigned short into signed :s



red, u said that 0 and 64 are 1:1 , and 64+ are 2:1 (aprox), are u sure of that? i mean, 64 are 1:1 ? im checking it on 20_22 geo, and 64 appers to be 2:1.


gimme offset

red
08.09.2005, 14:14
This is good share /// But we cannot user this for castles, toi, etc...

L2J dont have walls, so if we create (sample) geodata for castle all mob`s from castle bean goin over wall. :)

Any one have formula for calculate height from bmp scale?

To Digital - I lost my pass for acc and my acc is blocked now :( My prev name anrysys// Help me plz

u can create ur own own bmp with ur own color scale, with such script toi and catacombs can be made easly... 1color = 1subgrid, its simple

UStas
08.09.2005, 23:20
red - Why do you think so ? :) I think i can create multilayer geo from bmp... But not from one bmp :wink:

torune
08.09.2005, 23:55
nah, its possbile to get them all on one bmp
i actually tried it 2 monthes ago, but turn out, unable to connect everything together
bmp from client doesnt really solve things, in my opinion

UStas
09.09.2005, 00:02
Good idea... Dut i try to make from many bmp... With (for example geen corol) where layer no have hight...

torune
09.09.2005, 00:05
lol, its time consuming work, i spent 2hr+ just for taking height from 25_17 by l2j, but still fail to get a bugfree version.

fflam
09.09.2005, 05:34
the problem makeing geodata form bmp is the hight data bmp is only 256x256 pixle so thats 1 pixle per "grid" but what if you need a 64 type headder? need a much more detaled bmp then the ones providedform the client.

also it seems the hight data form l2j and official is diffrent. when red and i were makeign the colosium geodata the bridges were way diffrent in hight.

red
09.09.2005, 05:58
not only bridges are different, for example in l2off the coliseum got -3440 and l2j -346x...

for detailed geodata you will need 2048x2048 bmp (256x8) not 1024x1024 as i said earlier lol

elcapo
09.09.2005, 06:16
red: ((ingame_height*2)/16-1)=> remove after point number and do this -> *16+1

works great when u have ingame_heights, but, my idea is convert the 64+'s floors type height into 1:1, to make modifications, and merge it again.

i use h/2 but obviously it has a little convertion error, but, i think this LITTLE difference are making that every 64+'s floor type been unwalkeable. Just enter in the 64+'s type floor, and u will stuck.

I check it with //worlddebug, and the heigth is quite the same, with "may be", 10z of error.
I dont know what happends.

fflam
09.09.2005, 06:24
10z error is alot. when we wer working on the colosium and entered the l2j hight of -346X, and the ingame hight was suposed ot be around -3440 (dont rember exact numbers off the top of my head) i was a good 6 to 10 player hights (stack 6 to 10 player models on top of each other) above where i was suposed to be. so its got to be more or less dead on to work

red
09.09.2005, 06:29
red: ((ingame_height*2)/16-1)=> remove after point number and do this -> *16+1

works great when u have ingame_heights, but, my idea is convert the 64+'s floors type height into 1:1, to make modifications, and merge it again.

i use h/2 but obviously it has a little convertion error, but, i think this LITTLE difference are making that every 64+'s floor type been unwalkeable. Just enter in the 64+'s type floor, and u will stuck.

I check it with //worlddebug, and the heigth is quite the same, with "may be", 10z of error.
I dont know what happends.

i know, thats why you need this formula
flors seems to have "thickness" (its fflam idea) the height is the very top pixel of subgrid, exmaple:
-3440 is the first pixel of the 215subgrid, its range is -3440-3455 as you can see its the bridge itself and the range is not accessible for player, so to fix it put 215-1 subgrid into geodata

((ingame_height*2)/16-1)=> remove after point number and do this -> *16+1
((-3440*2)/16-1)=-6880/16-1=-429 and now *16+1
-429*16+1=-6863
-6863 its the height to put into geodata, you should be able to make backwards formula, but for what purpose...

elcapo
09.09.2005, 06:44
yes.. backwards formula.. for what purpose? to fix invisible walls perhaps, to move estructures, etc.

* covert Geodata (.dat) into a big size matrix (2048*2048*x heights levels).
* all of this heights must to be in the same convertion, to forget the types.
* make changes (move, put something).
* merge it again into a Geodata (.dat).

thats is what im trying to do. I make an bmp converter, to see the changes, but, i cant figure out the formula to take the right height from the geodata.
I trying to work manipulating bits, but, i'm not very good on it.

torune
09.09.2005, 06:45
what you guys gotta do, fix grid by grid? omg

red
09.09.2005, 06:51
what you guys gotta do, fix grid by grid? omg

nah, im pretty sure that l2j give much more detailed data as output, if im not wrong it dumps every subgrid.. :roll:

elcapo
09.09.2005, 06:53
first, i wanna fix some estructures, like castles. almost all of them are "moved".

red
09.09.2005, 07:03
first, i wanna fix some estructures, like castles. almost all of them are "moved".

the way of doing this its up to you, i would maybe create a php script to move a whole area in sql... didnt think about it... but sql allow almost everything

elcapo
09.09.2005, 07:10
but, a subgrid (8x8) is bigger than the castles are moved.

This is the why of my trouble.

red
09.09.2005, 07:14
moving a grids is a lot easier then subgrids...

if you have some sql experiences and had a look on my shares you will find a way to do it ;)

1subgrid = 16pixel
1grid = 128pixel

fflam
09.09.2005, 07:40
you cant just "move" castles. in c2 thay added alot to castles. thay made the wyvren entrance (up top) and the breakable walls (witch im assumeign are the same as bridges (type 3 headder) and a cupple changes inside most the castles. so to get castles workign correctly you cant just "move" the castle.

what you guys gotta do, fix grid by grid? omg

at this point this is the best way yes. there are a few "short cuts" you can do in some areas. but not maney. as it is right now i dotn see makeing geodata from the bmp provided by the client fesable, and theres really no way to get more then 1 floor from them anyways (unless you somehow make it more then 1 bmp, then make each bmp a enw floor, but if you cant get a 1 floor bmp to convert to geodata.. then i wouldent bother thinking about multifloor yet).

so in all honestly the BEST way to make geodata, would be to take a clinet map, upen it in a map editer, remove all non esentual data (lights, sounds, bushes, trees, EVERYTHING that doesetn have a hight (im 99% shure trees are client side only)), and then make a program to convert the unreal map file to hight only data stored the same way geodata is stored. but thats WAY beyond my programing lvl.

fflam
09.09.2005, 07:45
infact in my snoopign around i found

http://www.unrealtechnology.com/flash/technology/ue2.shtml

reading that makes me assume that epic has a editer that will convert unreal maps (what the lineage2 client is) into hight data (what geodata is).. if that is so just need to get ahold of it ;)

red
09.09.2005, 07:46
upps didnt know that, its a long time since i played l2...


k, from now on EOT

SoaPy
10.09.2005, 19:28
lol, my l2j when i active the ActivatePositionRecorder option, and move around some map and shutdown the server, my l2j grabs 2 files, a universe.png and a universe1126380210750.fin, and this fin file cant be opened with winrar, and there isnt any bin file. Maybe is the version of this l2j server :S.

montejo1974
10.09.2005, 22:29
Hello:

We are Trying to understand the way to obtain correct maps using this utility.

We have runned correctly the load.php and load the data on the SQL using the 24_17_conv.dat that are in the ProjectC2Beta3.rar. We don't know if we must use these files. Really we don't know what .dats files must use. Question 1.

After that, we've runned the check.php and get the new header. I noted that no updates where realized on the BD, so what must do with the new headers??. Question 2.

Last, we have runned the write.php and have obtained the map.dat, that is binary identical to that 24_17_conv.dat that we introduce in the load.php. Is must be so????Question 3.

So, we would advance in the develop of the new maps, but we need a little help.

Thanks for all, and sorry for be so newbie and for my english, of course ;)

Bye, I hope someone help me a bit.

red
11.09.2005, 13:51
:arrow: SoaPy
yeah, its seems like l2j dump function has changed.. check l2j sources...

:arrow: montejo1974
Ad1. i sgguest u to get some info about geodata itself.. with my scripts u can edit maps without hexing, php-sql knowledge is reuiqred..
Ad2. update manually headers table in geodata db
Ad3. did u made any changes to the data? no? so it must be the same :D