From .obj to .navmesh menu

Shout-Out

User Tag List

Page 3 of 6 FirstFirst 123456 LastLast
Results 31 to 45 of 77
  1. #31
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    You should be creating a tiled mesh. I don't know if there is really anything else in Detour anymore, anyway. There are many tiles. If you're doing 1 tile per ADT, you'll have several hundred tiles, and the (x, y) you give to Detour would be the ADT (x, y).

    From .obj to .navmesh
  2. #32
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes until here i got it. What i mean is, do you have only ONE tile per ADT? Or is your tile splited up in smaler tiles. Its all i thing of difination xD

  3. #33
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    I think it's a question of poor English on your part. That may be what you meant, but that's not what you said. It's up to you whether you want to have 1 tile = 1 ADT. It's certainly a good place to start.

  4. #34
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if you create only 1 tile per ADT, you will have problem with zone having a complex geometry (cities, ...)

    I use to use 4 tiles per ADT, and now I'm using 16 (4*4) per ADT, because I want to be able to "rebuild" my tile faster if I want to add an obstacle.

  5. #35
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So your files look like this ? :

    tile_x_y_1
    tile_x_y_2
    tile_x_y_3
    ......

    or is it still tile_x_y but the peaces for an adt are stored in a header?

    (ADT = 533.333.. x 533.333.. Right)??

  6. #36
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've one file per ADT (easier to find witch file to load) but this contains 16 tiles.
    I use these values :

    Code:
    GRID_SIZE = (float)(533.0 + (1.0 / 3.0));
    GridDiv = 4;
    TileWidth = (TileVoxelSize / GridDiv) + (BorderSize * 2);
    TileSize = (GRID_SIZE / GridDiv);
    Last edited by guizmows; 08-18-2011 at 02:19 AM. Reason: replace php

  7. #37
    Bananenbrot's Avatar Contributor
    Reputation
    153
    Join Date
    Nov 2009
    Posts
    384
    Thanks G/R
    1/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    *dazzled by PHP radiance*

    You can store multiple tiles in one file. I 256 mcnk-sized tiles in one file, resulting in one file per adt.
    Just read the demo code -.- It is not any harder than ordinary reverse engineering, you know...

  8. #38
    Millow's Avatar Member
    Reputation
    5
    Join Date
    Mar 2007
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what size should the mesh be approximately for 1 ADT ?
    for 32_48 in azeroth I have 505k, seems pretty small considering that the .obj is 4Mb.
    "What can be asserted without proof can be dismissed without proof." --- Christopher Hitchens

  9. #39
    namreeb's Avatar Legendary

    Reputation
    668
    Join Date
    Sep 2008
    Posts
    1,029
    Thanks G/R
    8/222
    Trade Feedback
    0 (0%)
    Mentioned
    9 Post(s)
    Tagged
    0 Thread(s)
    That's actually rather large, if memory serves. But my code had optimizations for discarding WMOs which don't actually land on the tile boundaries.

  10. #40
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So if i use the Demo Code and try to call addTile it only add the first part. Problem seems to be the addtile func. Becouse it checks if there is allready a tile loaded and then it returns an error .

  11. #41
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    each tile has a dtNavMeshCreateParams. in this param you've to set correct titleX and tileY value. Detour use this value in order to know where is located your map in the whole map.

  12. #42
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah and thats finaley my Problem .
    Do you use a System like this :

    Adt_10_20

    Recast:

    Tile 100_200
    Tile 100_201
    ...

    So 10 the adtx and 0 the first tile Praxis if code?

  13. #43
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    no

    you've to calculate your tile X adn Y according to your mesh origine (center of your continent for example)

    pseudo code
    Code:
    centerX = (tileRealCoordXMin + tileRealCoordXMax) / 2; 
    tileX = (centerX - globalMeshCenterX) / TileSize;

  14. #44
    hamburger12's Avatar Contributor CoreCoins Purchaser
    Reputation
    87
    Join Date
    Jan 2010
    Posts
    297
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So this is my funktion to save a mesh.

    Code:
    void Sample_TileMesh::saveAll(const char* path, const dtNavMesh* mesh)
    {
    	int TileX = 40;
    	int TileY = 33;
    
    	int tileTempStartX = (TileX * 4) -3;
    	int tileTempStartY = (TileY * 4) -3;
    
    	int size = 4;
    
    	int TempCountX = 0,TempCountY = 0;
    	int iA = 0;
    	int iB = 0;
    
    	if (!mesh) return;
    	
    	FILE* fp = fopen(path, "wb");
    	if (!fp)
    		return;
    
    	ofstream myfile;
    	myfile.open ("Log.txt");
    	
    	// Store header.
    	NavMeshSetHeader header;
    	header.magic = NAVMESHSET_MAGIC;
    	header.version = NAVMESHSET_VERSION;
    	header.numTiles = 0;
    	for (int i = 0; i < mesh->getMaxTiles(); ++i)
    	{
    		const dtMeshTile* tile = mesh->getTile(i);
    		if (!tile || !tile->header || !tile->dataSize) continue;
    		header.numTiles++;
    	}
    	memcpy(&header.params, mesh->getParams(), sizeof(dtNavMeshParams));
    	fwrite(&header, sizeof(NavMeshSetHeader), 1, fp);
    
    	// Store tiles.
    	for (int i = 0; i < mesh->getMaxTiles(); ++i)
    	{
    		const dtMeshTile* tile = mesh->getTile(i);
    		if (!tile || !tile->header || !tile->dataSize) continue;
    
    		NavMeshTileHeader tileHeader;
    		tileHeader.tileRef = mesh->getTileRef(tile);
    		tileHeader.dataSize = tile->dataSize;
    
    		tile->header->x = tileTempStartX + TempCountX;
    		tile->header->y = tileTempStartY + TempCountY;
    
    		myfile<<"LogId: "<< i << "TileX: "<<tile->header->x<<" TileY: "<<tile->header->y<<" CounterX: "<<TempCountX<<" CounterY: "<<TempCountY<<"\n";
    
    		if(TempCountY == size -1)
    		{
    			TempCountX += 1;
    			TempCountY = 0;
    		}
    
    		if(iB == size -1)
    		{
    			TempCountY = 0;
    			iB = 0;
    		}
    		else
    		{
    			TempCountY += 1;
    			iB += 1;
    		}
    
    		fwrite(&tileHeader, sizeof(tileHeader), 1, fp);
    
    		fwrite(tile->data, tile->dataSize, 1, fp);
    	}
    
    	fclose(fp);
    	 myfile.close();
    }
    But it still don't work o.O
    Last edited by hamburger12; 08-19-2011 at 01:25 PM.

  15. #45
    guizmows's Avatar Banned
    Reputation
    57
    Join Date
    Feb 2008
    Posts
    414
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    check :

    dtNavMesh::getNeighbourTilesAt and dtNavMesh::calcTileLoc I hope it will help you to understand how Detour find neighbour tiles, and you will find how you have to name your tiles.

Page 3 of 6 FirstFirst 123456 LastLast

Similar Threads

  1. Making Cash from Lv. 10
    By Cush in forum World of Warcraft Guides
    Replies: 10
    Last Post: 09-02-2006, 10:52 PM
  2. Free Marks from Battle Grounds
    By Matt in forum World of Warcraft Exploits
    Replies: 10
    Last Post: 06-19-2006, 11:21 AM
  3. Add-ons from curse-gaming.
    By volcom in forum World of Warcraft General
    Replies: 5
    Last Post: 05-16-2006, 11:50 AM
  4. Raid Griefing Exploit (kick anyone from any group)
    By Matt in forum World of Warcraft Exploits
    Replies: 5
    Last Post: 04-28-2006, 09:26 AM
All times are GMT -5. The time now is 10:24 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search