Page 1 of 1

[SOLVED] [Blender Plugin] Polygon limit error

Posted: Thu Jun 14, 2018 11:12 am
by kiwi
Hello Marv,

as already mentioned on Discord, I have an issue with your Blender plugin. Just wanted to also create a "official" bug report thread here, for documentation purposes.

I am not able to export my level to a .w-file anymore. One of this 2 error messages appears:

Image

Image

My guess is, that it has something to do with the amount of polygons? I hit the 30.000 yesterday.

My level has at the moment:
- 39.556 Verts
- 32.959 Faces
- 64.816 Tris
- 1/1 Objects

Exporting the .ncp-file is working without error messages.

I am not able to continue with my level until this problem is solved.

Ciao, Kiwi

Re: [Blender Plugin] Polygon limit error

Posted: Tue Jun 19, 2018 10:15 am
by Marv
Okay, this problem is related to the file format.
The polygon and vertex limit for a mesh is 32767 (signed short int). Changing the type to unsigned short ("<H" in the code) is not a solution. While it exports, it'll most likely write a .w file that the game won't be able to load. RVGL uses signed short in the code for these limits. When it reaches a number bigger than 32767 in the exported file, it will just assume a negative number instead.

The solution is to divide your world file into smaller cubes (with 32767 polyons max.), similar to how it's done in stock tracks. This way you can use up to ~65k meshes with 32767 polygons each.

I'll work on an error message that pops up when you try to export a mesh with more polygons than the limit allows.

Re: [Blender Plugin] Polygon limit error

Posted: Tue Jun 19, 2018 10:48 am
by kiwi
Interesting, I haven't divided my world into parts. RVGL won't crash, while loading. But maybe there is an overlap: I tidied up a bit, and deleted a lot of polygons in the last time. So I am maybe below the 32767 polygon limit at the moment.

In the future, I will do it exactly the way you described, and split up my world into more cubes.