-
Thank, +rep.
I go try this. Because for the moment I not arrive to sync TileRecast/TileWow.
Edit:
Work fine! Thank
Last edited by RivaLfr; 12-13-2010 at 11:38 AM.
-
Member
It appears some of the latest additions to wowmapper have broken cross-platform compatability. Namely sprintf_s and strtok_s.
edit: oh yeah, and it took me 4 hours to figure this out, but for the love of god, build in 32bit mode. structs are read directly from corresponding files and if your data types are off... i feel like murdering someone right now.
Last edited by j005u; 12-23-2010 at 09:54 PM.
-
Active Member
anyone can provide tips to deal with m2ho chunk ? i am having issues to mark up/exclude water covered terrain. I've tried two ways
1. exclude based on rendermap (names from wowmapper)
2. exclude based on mask2 bytes array
no one seems to work (excluding/marking terrain) for 100% for me, i feel like i am missing something.
nvm.. figure it out.. renderMap works just fine.
Last edited by ostapus; 12-28-2010 at 05:30 PM.
-
Active Member
Decide to post question to this thread.
Question for those who are using recast for navigation - how do you build tiles ?
1. per adt basis ? in this case - adt size is 533.333 - you can't create mesh which will exactly fit this dimensions (recast is using int as cell size), therefore tiles on adt borders will overlap. Will it cause issues with detour ?
thanks
-
Contributor
Originally Posted by
ostapus
1. per adt basis ? in this case - adt size is 533.333 - you can't create mesh which will exactly fit this dimensions (recast is using int as cell size), therefore tiles on adt borders will overlap. Will it cause issues with detour ?
Huh? Tile size is in voxels. To go from voxels to world units, you multiply the voxels with your cell size. So lets assume you want a tile size of 2000 voxels (more voxels means better precision and increased calculation time). You need to find the cell size in the equation 2000 * cs = 533 1/3, which is cs = 0.26666.. you get the idea. I agree there are some numerical stability problems here, mostly due to Blizzards odd choice of tile size, but it works just fine in practice.
-
Active Member
Thanks,
assume i want detour tile covers whole adt (as in you example), assume i build 2 tiles from 2 connected adts, when i add detours tiles into the mesh, are they going to be connected ? The reason - i can't load whole continent geometry due to size but rather have to load adt, recast it, dump to file, load another adt etc...
when i load 2 "separately" built tiles and add them to mesh - will detour have problem to connect adjusted polys ?
thanks
-
Contributor
Detour will automatically connect tiles - but only if you pass to Recast geometry for the border, i.e. you will have to load the surrounding ADTs of the one ADT whose tile you want to create. You have to specify a border area in the config or regions will be cut off one agent radius short of the tile bounds.
-
Active Member
So basically - geometry for the tile + border size (in voxels) required for proper tile generation. go it. thanks for information!
i've converted wowmapper to c# code, if anyone interested i can post it here.
for those who cares there is small bug in wowmapper, to be exact in obj0.cpp, here
// I believe there is no MCRW without MCRD chunks, but MCRD is always first
if ( mcnk_chunk.size ) {
... MCRW/MCRD processing
the bug is that MCRW can exists w/o MCRD therefore needs to check what chunk is here. By fixing this - it will fix some geometry errors i observed sometime.
-
I can confirm what caytchen has said. You do need to provide some geometry to Recast beyond the border of your tile. This is basically because the algorithms Mikko uses are generic and cannot make assumptions (or permit you to make assertions) about what is beyond the tile. In this case the concern is what if there is a wall right off of the edge of the tile? This would mean that not only could you walk off the tile in this position, but you couldn't reach the edge of the tile either because your agent has width. That is the purpose of the max wall distance param Recast takes.
-
Active Member
I wonder what parameters others find to be most suitable to feed into recast/detour ? Anyone care to share please ?
thanks
-
Which settings are you wondering about? Many of them depend on how big you want to make your tiles.
-
Active Member
agent radius/height, walkable angle, max climb. currently (for test purposes), i am using cs = 0.26 (adt size / 2000), 125 cs per tile, 16 tiles per adt.
is this CS size sufficiently small or too big ?
i am not really sure how big tiles i want, i am open for any suggestions/expirience
thanks
-
Below are the settings I used when I was using Recast. Note that, though its not specifically documented, many of these settings are dependent on the others. That is why I made up a few variables of my own and set the Recast parameters in terms of them. This way I don't have to remember the relationships. For example, the cell size must perfectly divide the tile size. Another example is you must provide at least enough geometry beyond the tile boundary to account for half of an agent width (I think).
For accuracy, you want to pick a cell size that will nicely divide your agent's radius and a height that will nicely divide your agent's height and maximum step size. By nicely I don't necessarily mean divide exactly, but close to it. The closer you are, the more accurate you will be. However, to exactly divide everything perfectly, you'll have a cell size so small that your meshes will be enormous.
As for tile size, the problem I had with Recast was that with large tiles you can get long and skinny mesh polygons. This can give you some non-optimal paths because of the string pulling algorithm being used in Detour at the time. This may or may not still be the case, but currently I am experimenting with MCNK sized tiles.
I think MaiN does either four or 16 tiles per ADT.
Code:
private const float TileSize = (533f + (1f / 3f));
private const int TileVoxelSize = 1800;
private const int MinRegionSize = 20;
private const int MergeRegionSize = 40;
private const float CellSize = TileSize / TileVoxelSize;
private const float CellHeight = 0.4f;
private const float WalkableSlopeAngle = 50f;
private const float MaxSimplificationError = 1.3f;
private const float DetailSampleDist = 3f;
private const float DetailSampleMaxError = 1.25f;
/// <summary>
/// Height of wow toon
/// </summary>
private const float WorldUnitWalkableHeight = 1.652778f;
/// <summary>
/// Maximum height where slope is not considered
/// </summary>
private const float WorldUnitWalkableClimb = 1.0f;
/// <summary>
/// Radius of wow toon
/// </summary>
private const float WorldUnitWalkableRadius = 0.2951389f;
private static readonly int WalkableHeight = (int)Math.Round(WorldUnitWalkableHeight / CellHeight);
private static readonly int WalkableClimb = (int)Math.Round(WorldUnitWalkableClimb / CellHeight);
private static readonly int WalkableRadius = (int)Math.Round(WorldUnitWalkableRadius / CellSize);
private static readonly int MaxEdgeLen = WalkableRadius * 8;
private static readonly int BorderSize = WalkableRadius + 4;
private static readonly int TileWidth = TileVoxelSize + (BorderSize * 2);
-
Post Thanks / Like - 1 Thanks
Torpedoes (1 members gave Thanks to namreeb for this useful post)
-
Active Member
also, another probably noob question - object coordinates (say player), are they bottom (ground level) center of the model, center of the model and therefore "ground" points needs to be adjusted by height/t ( i am using height as 2 wu - is this ok ?)
another tia
-
I'm not sure, but I don't understand why that matters?