Jump to content

What's the general vert/poly limit for a model in JKA?


Recommended Posts

I hear that a model with 1000 verts/polys is the max for regular JKA (please correct me if I am wrong), but for OpenJK I hear that it has been extended to allow higher poly/vert models?

 

I just wondered what the max poly/verts are for models in both Regular JKA and OpenJK without that model crashing the game.

lpriefer01 likes this
Link to comment

It's not that simple. The 1000 vertex per mesh (which is basically a single "chunk" of the model itself) is the max vertex limit that Jedi Academy allows, for a total of potentially 32000 vertexes. That is unchanged in OpenJK, as far as I know.

The crash you're referring to ("Run out of transform space for ghoul2 model" or something like that) is related to the complexity of the whole model, and isn't so easy to calculate directly, although someone posted the exact calculation somewhere around the forum. That also involves weapons: if you use a high poly player model with a high poly lightsaber hilt or weapon both these factors increase the risk of crash. The value it suggest to modify in the error (MiniHeapSize, I guess) was doubled in the singleplayer version of OpenJK, although it must be noted that the base JA multiplayer already has this value, while base JA singleplayer has it halved.

lpriefer01 likes this
Link to comment

My experience with OpenJk is that any mod l with more than 10,000 vertices crashes the game when the model gets hit. Also as Ramikad said, the weapon adds a factor to it.

 

I believe the main reason for that is that the engine calculates hit detection using the lowest LOD available. If a model doesn't have proper LODs, the engine will try to use the highly detailed model and crash. It's recommended to add LODs even if it´s just duplicates of the highest detail LOD and then add one last LOD made of a very simple mesh. Please someone confirm or deny this. Thanks.

lpriefer01 and The Punisher like this
Link to comment

I believe the main reason for that is that the engine calculates hit detection using the lowest LOD available. If a model doesn't have proper LODs, the engine will try to use the highly detailed model and crash. It's recommended to add LODs even if it´s just duplicates of the highest detail LOD and then add one last LOD made of a very simple mesh. Please someone confirm or deny this. Thanks.

Sounds logical. However, I have a ported mode that has around 11,000 Vs that crashed the game after been hit. I added LODs and it still crahses the game when hit a a few of times (but not at first like without the LODs).

:(

Link to comment

Quoting Xycaleth from my clone trooper WIP Thread:
 
 

Okay, just looked at the code. In OpenJK, SP and MP both have the same amount of 'transform space', which is 262144 bytes. JASP seems to have roughly half the amount of transform space compared to JAMP; JASP has 132096 bytes of transform space, JAMP has 262144 bytes.

The equation you're trying to satisfy is:
 

number of surfaces * 4 + total number of vertices in an LOD * 20 <= transform space
In other words, both the number of surfaces and the total number of vertices can trigger the error, but total number of vertices more-so. I don't know which LOD gets used, but assuming you're hitting the error, I'm guessing it's using LOD0.

For JASP, you can have around 6600 verts maximum before you hit the error.
In JAMP and OpenJK, you can have around 13100 verts before hitting the error.

Both cases assuming you have 32 surfaces.

EDIT: The 'transform space', in case anyone is curious, is used for transforming the model vertices for collision detection.

 

 
My tests while trieing to fix the clonetrooper have shown, that the vertex count of the currently equipped weapon also seems to add to the max vert limit. But I can't confirm it with 100% certainty.

EDIT:

Xycaleth did confirm it back then:

 

 


Okay, think I've found the problem (again?)! Any Ghoul2 model attached to the model also counts towards the limit. For example, if your model is holding a saber, you would add another numSurfaces*4 + numVertes*20 for that extra model. Does that bring the numbers over the limit?
Asgarath83 and The Punisher like this
Link to comment

Quoting Xycaleth from my clone trooper WIP Thread:   My tests while trieing to fix the clonetrooper have shown, that the vertex count of the currently equipped weapon also seems to add to the max vert limit. But I can't confirm it with 100% certainty.

That’s great information. Wish there was an easy way to increase those values (without having to recompile it).

Link to comment

Based on that highest LOD's number you can easily go 40-60% or so for the following ones, LOD3 no one will ever see up close and you should keep it around 1000-2000.

 

 

The tips I got was to use 10% (LOD1), 20% (LOD2) and 30-35% (LOD3) but yours sound good, especially sine I only play SP (and an occasional Solo game to burn out some frustrations). Thanks for the suggestions!

Link to comment
  • 1 month later...

Also, it's not just the vertex count as displayed in the 3D package... you have to consider if you have multiple vertex normals and/or multiple UV texture coordinates at a vertex... because the model compilers will have to create extra verts for these. (Note: A vertex can only have 1 normal and 1 UV coordinate... the software, like 3dsMax, may allow for more... but it will create the extra vertices during export).

Link to comment
  • 3 years later...

According to this, it might be pushing it for SP. Using a mod should be fine.

On 2/6/2018 at 2:24 PM, AshuraDX said:

For JASP, you can have around 6600 verts maximum before you hit the error.
In JAMP and OpenJK, you can have around 13100 verts before hitting the error.

Both cases assuming you have 32 surfaces.
 

On 2/6/2018 at 2:24 PM, AshuraDX said:

Any Ghoul2 model attached to the model also counts towards the limit. For example, if your model is holding a saber, you would add another numSurfaces*4 + numVertes*20 for that extra model

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...