MMORPG Mapping?

Core-Dump said:

i'm afraid i have no experience with this stuff, i'm sure someone else can give more in depth information :)


Do you know anybody in particular who I could PM?

You might want to take a look NEL at http://www.opennel.org/confluence/display/NEL/Home



It's really BIG, but may give you some ideas on how to do things. Oh, yea, it's in C++, but may give you some ideas on how to roll your own in Java and jME.



Check out the feature list: http://www.opennel.org/confluence/display/NEL/NeL3D. This package is the most comprehence, open source system for building a MMOG. It's about 10x the size of jME though, so it will take time to wade through it.



Also, there's the book series "Massively Multiplayer Game Development" that you will want to consider.

You cut your terrain into square blocks, then you don't need to think where the pieces need to be, you just translate them by the block's position. Radakan already does that in it's tile loading engine: http://radakan.svn.sourceforge.net/viewvc/radakan/trunk/radakan/src/com/gibbon/radakan/tile/TileLoader.java?view=markup

I'm using a "lego" approach for my MMO terrains. If you ever played with legos you'll probably remember the base plates that you used for building cities, space stations, etc. Some had road patterns on them, others had moonscapes, craters, etc. You can make your stock of terrain "base plates" however you like and create them so that they wrap (the edges match) and use them as terrain blocks.


Massively Multiplayer Game Development


Not really a fan of this series at all (some of the articles contain some patently bad advice), but these books do point out some subjects that are very worthy of thought. Reading through the chapter list is almost more worthwhile than reading the articles themselves.

-Prime
Momoko_Fan said:

You cut your terrain into square blocks, then you don't need to think where the pieces need to be, you just translate them by the block's position. Radakan already does that in it's tile loading engine: http://radakan.svn.sourceforge.net/viewvc/radakan/trunk/radakan/src/com/gibbon/radakan/tile/TileLoader.java?view=markup


This is good advice-- I just don't understand how that source code works. Basically cut up my one HUGE map into tiny tiny square blocks, then import them all but use a TileLoader which basically lines them up how they should go?

you should also try and stitch them together and let the tiles share normals where they meet

you should also try and stitch them together and let the tiles share normals where they meet

This is mostly an issue for heightmapped terrains. For modeled terrains the terrain splitter will include the normals in the triangles so this is not a problem.

This is good advice-- I just don't understand how that source code works. Basically cut up my one HUGE map into tiny tiny square blocks, then import them all but use a TileLoader which basically lines them up how they should go?

You don't import all of them immediately, each block/tile is a separate file which you load when the player gets close to that specific tile- that way you achieve "dynamic loading" of terrain.
The TileLoader class does not line them up, it only reads them from a file and creates a Node object which can then be handled by the TileManager. The TileManager knows where to put the tile based on it's position, e.g if it's tile -5, 6, then it multiplies that by the tile size (constant for the whole game), and you get -320, 384 (if the tile size is 64, like in radakan), you set that to be the Node local translation which you got from the TileLoader: tile.setLocalTranslation(-320, 0, 384).

How does the TileManager know what position the Tile is supposed to be?

I'll be releasing a cut of DarkMMO some time between 4 and 8 weeks after JavaOne.  It'll be a very early "pre-release" but you might want to take a peek at the code.  I warn you, its not as simple as you seem to be thinking.  (There is no "MakeMMOMap" call in JME< just as three is no "MakeMMOCJHaracter" or anything  else that genre specific.)



Some design notes around maps on DakrMMO to get you thinking:



(1) DarkMMO uses the NWN Aurora editor to build maps.  It uses the NWN data set,models and tiles.



(2) DarkMMO is Project Darkstar based.  The map data is server based so that it can be updated centrally and so that the server can perform blocking checks (essential to avoid cheating.) Client side maps mean anyone just has to open your data files to know every secret of your game and with a simple hack they can walk right through walls.  In general in MMOs, if you want to prevent cheating, all important game state MUST be server side.  Clients are just limited views onto that data.



(3) The server sends the client the name of the current tile set and the width and height of the tile map.  Its is followed by packets that set each tile with an x,y tile position, a tile orientation, a tile height and the tile number itself.  I do each tile in its own packet rather then one rectangular map so they cna be individually changed on the fly.



(4) The actual tile models are resident on the client and are loaded as each packet arrives and transformed to the right place in the scene.  If you don't know what a transform is, your gonna have REAL trouble with this project unless you build entirely on top of someone elses game engine.  Thats just reality.  3D graphics is vector algebra.



(5) The tiles contain walk meshes for each tile.  I have logic that checks for blocking in these meshes at both the client (for immediate response) AND the server (for cheat protection.)



I know you don't want to hear this, but you have bitten off something thats not just some of the most advanced math in games, but also a conjunction of many of the hardest problems.  I sure hope this isn't your groups first game project, or that your open to learning through your explorations of it what you maybe aren't up to yet and reconsidering your direction or goals.






How does the TileManager know what position the Tile is supposed to be?

The tile isn't 'supposed' to be at a position, it's just is. Let's say you have a player at localtranslation 0, 0, 0. You convert those coordinates to tile space by dividing the x and z by 64 (the tile size), then you get 0, 0. Then you have to find all the tiles near the player, in this example a tile is considered 'near' the player if it's 5 block sizes away from it:
for (int y = playerY - 5; y < playerY + 5; y++){
    for (int x = playerX - 5; x < playerX + 5; x++){
        // check if the tile is not loaded yet
        TileKey tk = new TileKey(x, y);

        // if not, load it and cache it
        if (!tileCache.contains(tk)){
            Node tileNode = TileLoader.loadTile(x, y);
            tileCache.add(tk);
            tileNode.setLocalTranslation(x * 64f, 0, y * 64f);
            rootNode.attachChild(tileNode);
        }
    }
}
In this case, the TileLoader class goes into the file system and fetches the file "tile_x_y.xml", where x and y are the tile position given in the arguments.

Note that if you cache tiles you will need to use SharedNodes as you cannot just join a scene sub-graph to multiple places in the world graph directly.  SharedNodes have a lot of limitations.  These may or may not line up with the assumptions of your modeler.



I currently do not cache tiles as my tiles contain a number of types of animation and animations cannot be shared through a SharedNode or they confuse their state.  I eventually intend to cache the tri meshes, which are much easier to share and are the bulk of the data, but require caching in the actual model loader.

I believe the modeling system I use has a lot of animations as well. What do you do as an alternative to Tile Caching?

Right now I load every tile as its own sub-graph, even if its a duplicate.  Otherwise  my code is much like the fragment posted.



This, however, is wasteful of memory as Im duplicating model geometry in memory.  In the long run I intend to add a mesh-cache to my model loader that uses SharedMesh as the majority of the memory is consumed by the tri-meshes.



If you don't have access to the internals of your model loader, you could write a "cloner" that walked your main tile tree and created a clone tree with SharedMesh nodes, but it would be some coding.

I'm so confused by all of this. I've done a little developing for a private World of Warcraft server, but we never messed with the maps. This is the newest territory to me: I have NO idea how to load maps into my world, you're going to have to talk to me as if I'm retarded so I'll understand all of what you mean

Personally i would simply forget about all the caching and culling optimizations and maybe start with a little smaller map. :slight_smile:

Maybe just the little Island, this could be a tutorial map for the later game.



In your first post you said, you can't use a random generated heightmap.

But how about simply generating the HeightMap once and when you think its fits, you save and load it with the binary exporter/importer instead of generating it.



Or simply import your terrain as a .obj model or similar.


I am sorry, but my code doesn't do any caching at all… The name was somewhat misleading, if you look at what the code is doing, it's only storing the TileKey in tileCache Set, so no tiles are actually cached. This is used by the code to know which tiles are already attached to the scene graph and which are not so it doesn't attach the same tile twice. However you would also want to detach tiles that are out of range, that part I did not include in my code.

So, no messing with SharedNodes and related bugs.

Core-Dump said:

Or simply import your terrain as a .obj model or similar.


I chose to import it from a modeling software (FreeWorld3D 2.0) because it gave me a lot more control over the terrain.

Core-Dump said:

Personally i would simply forget about all the caching and culling optimizations and maybe start with a little smaller map. :)
Maybe just the little Island, this could be a tutorial map for the later game.


That's what I am going to do. I'm going to create our "GM Island" to test and develop stuff, I'm just trying to figure out how I'm going to put all the little cut up maps together when I need to.

I would not suggest checking out the source now as it is in Ender's hands now, and therefore in WIP phase. So it might not function at all at the current state. When the work on it finishes, it will be released on the jME forums under "User Code".

If I'm getting a blank white model, does that mean I'm not directing the program to my .mtl file properly?

Mate - TERRA is the key - love or hate - adapt it