L2JMobius

High Five Need guidance on understanding Geodata (Beginner to L2J, but experienced in prog

jhonassantos13 · 2 · 228

Offline jhonassantos13

  • Vassal
  • *
    • Posts: 1
Hello everyone,

First of all, please accept my apologies if I am posting this in the wrong section or if this topic has been heavily discussed before. I did some searching but couldn't quite find the technical starting point I was looking for.

I am relatively new to the L2J Mobius emulator (currently working on a High Five project), but I have a solid background in programming. I am trying to get a deeper understanding of how Geodata works within the Mobius architecture.

Could anyone point me in the right direction? I would love to know:

How the core reads and processes the Geodata/Pathfinding files.

Are there any specific classes in the Java source code I should start analyzing to understand the logic?

Any recommended tools or best practices for debugging or fixing Geodata issues?

I really appreciate any documentation, tips, or brief explanations you can share. Thank you for your time and patience with a newcome


Online Mobius

  • Distinguished King
  • *****
    • Posts: 19653
The geodata pipeline lives mostly under org.l2jmobius.gameserver.geoengine.

A few starting points:
  • GeoEngine.java - the main entry point. Look at loadGeodataFiles() and the canMoveToTarget() / getValidLocation() methods.
    This is where the rest of the core asks geodata questions like "can this mob walk from A to B?"
    Geodata is laid out as 16x16 cell blocks per region file (the .l2j files in /data/geodata/), with NSWE flags per cell indicating which directions are walkable plus a height value.
  • geodata/ package - the block type implementations (flat, complex, multilayer). Multilayer is the interesting one because it handles overlapping floors (think the inside of buildings under terrain).
  • For pathfinding specifically, check org.l2jmobius.gameserver.geoengine.pathfinding.
    The project typically uses a geodata-aware A* over the cell grid. CellNodeBuffer and PathFinding.java are where to dig in.

A few tips:
  • Coordinate conversion trips everyone up. World coords -> geo coords uses fixed offsets (-327680, -262144 in the standard chronicle layout) divided by 16 for cells.
    There's usually a getGeoX() / getGeoY() helper - use it religiously rather than rolling your own math.
  • For debugging, enable the geodata debug flags ingame //debug.
    There is also an admin command that editsdumps NSWE flags around the player's current cell //ge
  • The community tool of choice for visually inspecting geodata is G3DEditor.
    It lets you load the .l2j files and see the walkability map. Good for sanity-checking before you go hunting in code.
  • If you find broken regions (NPCs falling through floors, mobs stuck on geometry), the issue is almost always in the geodata files themselves rather than the engine,
    re-extracting from a clean client or grabbing a known-good geodata pack tends to fix it.

Good luck!