Jump to content

Resizing NavMesh crashes Editor


beo6
 Share

Go to solution Solved by Josh,

Recommended Posts

When i created a NavMesh and resize it by changing the Tiles, it crashes the Editor with the following Error:
image.png.e3ce44d1ad16ac555e5eca2c1af72b99.png


Steps to reproduce:
- Create a Terrain
- Create a Navmesh
- Go to "Map" Tab and select Navigation Mesh
- Resize Tiles X or Y via the up arrow.
- Resize Tiles X or Y via entering a value directly

Link to comment
Share on other sites

I suspect you are using version 0.9.0. There was a change at some point that changed the way the Navmesh creation parameters work, in part to prevent the user from being able to input invalid values.

If you are using 0.9.0, you can uninstall the engine, switch to the "stable" channel, and install that to get the latest stable build.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

No. I am running 0.9.2

I just updated to Build 309 to see if i can still reproduce, and sure enough, it still crashes.

Even without a Terrain btw. Just had to press the arrows for the TIles, Change the value to a higher one for X and then for Y. and then = Crash.

 

I guess there is an issue when switching between using the arrows and entering a higher value directly. Not sure.

Link to comment
Share on other sites

You are triggering an error in the navtile generation routine. I added some more checks to find out which one:

		if (dtStatusFailed(status))
        {
			if (DT_WRONG_MAGIC & status) Print("Error: Input data is not recognized");
			if (DT_WRONG_VERSION & status) Print("Error: Input data is in wrong version");
			if (DT_OUT_OF_MEMORY & status) Print("Error: Operation ran out of memory");
			if (DT_INVALID_PARAM & status) Print("Error: An input parameter was invalid");
			if (DT_BUFFER_TOO_SMALL & status) Print("Error: Result buffer for the query was too small to store all results");
			if (DT_OUT_OF_NODES & status) Print("Error: Query ran out of nodes during search");
			if (DT_PARTIAL_RESULT & status) Print("Error: Query did not reach the end location, returning best guess");
			if (DT_ALREADY_OCCUPIED & status) Print("Error: A tile has already been assigned to the given x,y coordinate");
			RuntimeError("Could not init navmesh (" + String(status) + ")");
        }

But the underlying issue is probably that 60 x 70 x 32 is too big.

60 * 70 * 32 = 134400
134400 * 134400 = 18,063,360,000

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Digging way down into this here is where the error occurs:

	m_saltBits = dtMin((unsigned int)31, 32 - m_tileBits - m_polyBits);

	if (m_saltBits < 10)
		return DT_FAILURE | DT_INVALID_PARAM;

Calculation of the parameters is as follows:

		params.maxTiles = navmesh->tilecount.x * navmesh->tilecount.y;
		params.maxPolys = MAX_POLYS_PER_TILE;

 

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

  • Solution

Okay, I updated the dev channel with a build of the editor that uses the calculations from the link above for the parameters and it seems to work. C++ lib and Lua exes are not updated yet, but I think this particular issue is solved.

  • Like 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...