Posts: 610
Threads: 13
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jun 2011
Reputation:
0
Hey,
Does anyone know whats the relation between .wtr files (the terrain part i mean) and .[CeNsOrEd] files?
Ive been trying to understand that for a while but i cant find anything logic.
What ive noticed is that there are 1536*1536*2 bytes in junos .[CeNsOrEd] file, which makes me think theres a short for each height... but wouldnt there be 1537*1537*2 bytes then?
Well, idk, need a hand here...
Thanks!
Posts: 212
Threads: 21
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Oct 2011
Reputation:
0
[CeNsOrEd] is for elevation map in the gs setting , and wtr is for elevation in the client side , example , u have in map (client ) alevation 90 , u must create [CeNsOrEd] whit elevation 90 , if u use more or less u see the other ppl in the map underground or fly , u understand?
Posts: 610
Threads: 13
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jun 2011
Reputation:
0
Yep ikr.
What i dont understand is how the height works in the [CeNsOrEd]. Coz it doesnt seem to be (just like in the .wtr) the real height.
Posts: 212
Threads: 21
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Oct 2011
Reputation:
0
usually gets the maximum height of the map in the [CeNsOrEd], this is because if you climb a high mountain, you would cease to see that player on the map.
Posts: 610
Threads: 13
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jun 2011
Reputation:
0
Im not sure you understand my question :p
Lets try to explain that way: i wonder how is the height encrypted in a .[CeNsOrEd] file. Is it as in the wtr a height pos for each coord with a math formula, or is it different?
Posts: 313
Threads: 20
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jul 2011
Reputation:
0
This is the height map equation:
The heightmap is a matrix[w][h] of floats, and x is an unsigned short(data that reads from [CeNsOrEd] file, unsigned short are 2 bytes) network byte order
Posts: 610
Threads: 13
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jun 2011
Reputation:
0
and x is an unsigned short(...) network byte order
I dont get that part at all :/
Also, why is there only width*height shorts? That means theres no data for the (0,y) line?
Edit: and finally, theres no math operation applied to the heights? (while there is in the wtr)
Posts: 313
Threads: 20
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jul 2011
Reputation:
0
The y part is the value (which is x/100)
The unsigned short is is 2 bytes long, so it reads 2 bytes every time, and in the file it is stored in the network byte order(ntohs)
Posts: 610
Threads: 13
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jun 2011
Reputation:
0
Ok i think i got it.
Thanks alot!
Posts: 313
Threads: 20
Thanks Received:
0 in 0 posts
Thanks Given: 0
Joined: Jul 2011
Reputation:
0
This is the correct one(the one that I posted above will get the map rotated with 90 degrees and inverted):