L2J Server - Geodata Homepage

Geodata Homepage!


Theory

First I'll define and describe few key words for geodata.

Geodata

Region
Whole world is divided into 32x32 regions.
You can see map of those regions on pic below:


Region numeration is from 0 to 31.
As you noticed (probably) map above show that top-left corner is not in region 0_0 but in region 16_10.
It means that on left side of that map are 16 regions and above - 10.
But where are they ?
They are not present in C6, but on paintings of C12 they are there.


To summary it: current l2world is 11 regions wide and 16 regions high.

That was simple

Next word:

Block
Each region is divided in 256x256 blocks (damn lot!!).
Each block is divided into 8x8 cells (but don't think about it atm).


Types of blocks:
FLAT - such block have no separeted cells inside, it's one solid unit.
As a name says its 'flat', it means that on whole block there is just on z value.
You can also move on FLAT block without any problems
(there can't be any walls or other things).

COMPLEX Such block has 8x8 cells and each cell can have different z value (height).

MULTILEVEL As a block is the same as COMPLEX,
but cells it contains can have layers (about layers in part about cells).



Cell It's the smallest piece of geodata.
Each cell is 16 units high and wide - in world coords.
Cell can be multilayered. It means that it's defined for many z values.
Good example is Tower of Insolence, where you have many floors and one cell goes throu them all
Described things is called layer.

Layer - it's deined for specific cell. We count layers from L0, L1, L2, .... Where L0 is most top layer.
Each layer of cell has defined z value (height) and NSWE.
z value of cells (that belongs to MULTILEVEL or COMPLEX blocks) are multiple of 8.

NSWE - basicly it's set of 4 values, saying if you:
- can go on North
- can go on West
- can go on South
- can go on East
from current layer of some cell.

To visualize described above therms I post that screen, where are marked FLAT blocks, COMPLEX blocks
(It's impossible to make screen with visualization of MULTILEVEL blocks), Cells and NSWE markers for Cell.


Typical Problems

Below is list of typical problems related with geodata.

First 2 problems not directly related with geo-files:
- wrong z value for spawn. If it's set wrong in databa, then geoengine may spawn it on wrong layer, bacause it looks for neared layer for given z-value.
- wrong z value for teleports. same problem as above. Here is also one more problem. Sometimes there are 2 layers really close but you should be moving on above one. If you (because of some bug in teleport coords) land on above one, you can have problems with moving on that layer.

Problems directly releated with geodata files:
- Invisible walls and other obstacles. I think it doesn't need description.
- holes in map (in stairs, bridges, even in flat terrain)
- horrible mix of many layers - sometimes it's easier to remove it and write something new on that place
- mixed layers. Sometimes terrain from one z value can go to different layers. For example corridor in catacombs - part of it can be on layer 3 but rest on layer 4. Whole that data should be moved to one layer.
- superfluous layers with not needed data. In current geo files most of most bottom layers are not needed. Some of them just have single cells in few places - can be removed safely (but be careful with such operations).
- parts of not needed data. Sometimes we can find data that we don't need - some single cells, or cells that defines leaves or trees(Oo) or bottom of rocks or sth.


How to work with GeoEditor

I Interface
Main window:

On screen above you can see how main window of program looks like.

1. Editor Pane
- status bar



Status bar contain all informations about selected cell, like:
Block Info: x,y value of block that contain selected cell. It also has info about block type (M - MULTILEVEL, C - COMPLEX, F - FLAT).
Cell info: x,y value of cell (geo coords) and info about nswe state of selected cell
z diff: min, max z value for current layer
World coords: x,y,z of selected cell in the same coords as you can see ingame
xyGO - you can use to to navigation (type world x,y coords and press GO).
Here is also info about used memory and 'garbage collector' button.

- minimap

Display image of current layer, that is generated based on heigh values.
(also can be used for navigation).


- layers list


It's a list with all layers that exists in loaded region. You can switch between layers with it and also delete / add layers.



- Window with region
The biggest window in Editor pane, you can see visual representation of loaded region, for selected layer. every cell is being represented by square with icon. Icon represents four arrow (they are showing status of NSWE for cell) color of background for each cell depends on height of it.


- "Edit panel"

On that panel are placed all tools that are being used for map editing, like:
- nswe buttons By default is selected empty button, it means that nswe editing mode is disabled. When you select one of NSWE buttons (these with arrows) you can edit nswe value of cells in main window.
- deletion button You can use that button to remove single cells (you can't remove cell if it has only one layer). If you remove cell from for examaple layer0 but that cell is also defined for layers 1,2, ... then all those layers will be shifted up.
- fix block types When you press it, then server is checking each block and deciding if it has good type. Basicly it's detecting blocks that are MULTILEVEL but should be COMPLEX and change it.
- weird colors (will be described later).
- refresh (will be described later)
- Height edit By enabling that function, you will change z value for every pressed cell (in main window) to value that stays in text field.
- Block type By enabling that function, you will change type of blocks that you press in main window.


- "Bugs panel"

Within than panel you can manage bug list you created by //geo_bug admin command. You can here load / save list. delete single entires and navigate to cells that bug is talking about. There is also description window showing what msg somebody who used //geo_bug command wrote.



2. Maps Pane

Here you can see big Image generated for loaded region.
You can switch between layers with list on right side.
On the bottom you can choose size image editor should generate. "Refresh button is for re-generating image (cause all image are being stored on HD after first generating and then only loading).



3. RegionMap Pane

Shows Interlude map divided into regions.
Region for currently loaded file is being marked with red border.



II Actions
Basicly: what you can do with editor.

Navigating:
- by clicking on minimap
- by clicking on map in Maps pane
- using scrollbars in main window
- with xyGO on statusbar (input world x,y and push GO)
- with "GO!" button in bugs panel
- navigating between layers - with layers list


Editing:
- layer editing:
- adding (with little button with + icon under layerlist)
- removing(with little button with - under layerlist) - be careful with that function cause it removes all data from layer. When you press that button then LAST layer is being removed - not selected

- Block editing:
- changing blocktype (attention: changing from multilevel to flat or complex will remove all layers for that cell except layer 0)
- fixing block types (described before)

- cell editing
- changing nswe
- changing z value
- removing / adding cell for MULTILEVEL blocks

Bugs management:
When you are ingame and find place where you thing geodata is buggy, then you can use admin command to record it.
syntax:
//geo_bug description
after that bug is being saved into /geodata/geo_bug.txt file with informations about place where you was while using that command.

Then you can load such a file into editor wity 'load' button in bugs panel.

You'll notice that two lists will fill with data.
Left list contain regions, right bugs recorded in those regions.
Syntax for bug element is:
[<blockx, blocky>][<cellx,celly>](<z value>)
When you select some bug you can see description in bottom test area.
To focus center main window on place where bug was recorded just push "GO!" button, it'll jump into that place (attention - it doesn't choose layer, you have to do it manually).

You can remove bugs from list with 'del' button.
You can also add new bug positions directly from editor by presing 'add' button.

III Colors / Images

colors in editor
- Colors that are used to fill background of cells are defined in paletteEdit.txt file, so you can manually change it if you wanna other palette.
- 'weird colors' mode. What it's for ... If you are operating on layer that has big difference between min and max z, then cell with not big z diff will be painted in the same color. To see diferences better in such case, you can enable 'weird colors' mode. Result:
before and after:


Colors in Images
- Images are being generated based on colors defined in file paletteImg.txt Colors for middle z values are being interpolated, so there is smooth effect.

About Image generating

Every image is being generated only at first request, then it's being saved on hard drive (in /img/ directory) and when is needed again is being loaded. It means that we won't see on images any changes we make on map. BUT there is 'refresh' button both for minimap and Maps pane. By pushing it, you force to re-generate map for current layer. Map is being generated and saved on disc.
Format for stored images is:
Img_[<regionX_regionY>]_L[<layer>]_s[<size>].jpg

__________________


Powered By

Support This Project