Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: Sanocon on September 18, 2014, 04:39:06 pm

Title: Question:Recomended Model Plolygon Count
Post by: Sanocon on September 18, 2014, 04:39:06 pm
So I'm making my first mod and I finished a prototype model for the player ship. However, learning from past experiences I know that a high polygon count can cripple a game immensely. So I need to know what is the recommended polygon amount that the models should not go over. I am making these type of models:

Capital ships
Fighters
Missiles

My main player model is around 4K polygons. so I know it's not much. but it would still be safe to know the recommendations.
Title: Re: Question:Recomended Model Plolygon Count
Post by: Axem on September 18, 2014, 05:41:07 pm
There's a lot of ifs and buts to the answer, but the gist is: whatever you feel comfortable with and whatever looks best.

Generally though fighters around here tend to have around 4-5k polygons, even up to 10k on very nice quality ships (someone even imported a 100k poly ship from Star Citizen!). Capital ships go from anywhere between 5k, 10k, 50k or even 100k depending on their size and complexity. But lots of textures and lots of subobjects will slow the game down more than lots of polygons. So its generally more important to keep those down than polygon counts. (Keeping map sizes in the range of 5122 (low quality), 10242 (medium quality) or 20482 (high quality))

Having multiple 100k poly ships will probably start to hurt since the game needs to calculate collision information for all those polygons, so something of that size should be a special ship if you go that high. Also tons of polygons means tons of uvmapping! Quite the show stopper when it comes to finishing ships.

As for missiles, they fly by pretty quickly and they're small, so they probably don't need more than 100-500 polygons just because the player will barely be able to see them. But there are options to use a higher quality model for interface screens, which you could go as high poly as you want.

There's a lot of freedom with this stuff, just be reasonable with it. :)
Title: Re: Question:Recomended Model Plolygon Count
Post by: Sanocon on September 18, 2014, 08:37:16 pm
Having multiple 100k poly ships will probably start to hurt since the game needs to calculate collision information for all those polygons, so something of that size should be a special ship if you go that high. Also tons of polygons means tons of uvmapping! Quite the show stopper when it comes to finishing ships.

Agreed, especially when i researched via the wiki:http://www.hard-light.net/wiki/index.php/Engine_limitations (http://www.hard-light.net/wiki/index.php/Engine_limitations) there's a 4750 texture limit. although in the models there is a limit of 128 in "standard" and 300 in "inferno". Is that for the polygon models, and if so, what's the difference?
Title: Re: Question:Recomended Model Plolygon Count
Post by: Axem on September 18, 2014, 08:51:27 pm
I would think that texture limit is amazingly hard to reach since ships cant have more than 16 textures.

And the Standard/Inferno thing is for ship classes (or entries) in any ship tbl or tbm files for the entire game. A long time ago the limit used to be 130, but one of the big grand daddy of mods called Inferno went above that limit so they needed special builds to accommodate their needs. So they were called Inferno builds. The change has since gone to the main builds for the past few years so everyone can enjoy 250 ship classes. (Keep in mind 1 model can be used for more than one ship class!) It doesn't include things like any weapons or skyboxes or debris. Just actual in game objects.

I haven't heard of too many mods that have reached that limit, so you should be pretty good.
Title: Re: Question:Recomended Model Plolygon Count
Post by: niffiwan on September 18, 2014, 09:19:12 pm
I should point out that the 4750 limit is for all "bitmaps" not just ship textures.  I'm pretty sure that limit has to cover every static image used in FSO including interface art, HUD gauges, animation frames, primary weapon bitmaps, glowpoints, ship textures... and probably other stuff that I can't recall right now.
Title: Re: Question:Recomended Model Plolygon Count
Post by: Mad Bomber on September 18, 2014, 11:44:54 pm
Does that figure also include textures introduced via in-mission Texture Replacement?
Title: Re: Question:Recomended Model Plolygon Count
Post by: Sanocon on September 19, 2014, 12:03:35 am
The Standard/Inferno thing is for ship classes (or entries) in any ship tbl or tbm files for the entire game. A long time ago the limit used to be 130, but one of the big grand daddy of mods called Inferno went above that limit so they needed special builds to accommodate their needs. So they were called Inferno builds. The change has since gone to the main builds for the past few years so everyone can enjoy 250 ship classes. (Keep in mind 1 model can be used for more than one ship class!) It doesn't include things like any weapons or skyboxes or debris. Just actual in game objects.

So trying to understand here, i can hypothetically have 500 ships rendered in one level but the level only had 3 ship classes?

I should point out that the 4750 limit is for all "bitmaps" not just ship textures.  I'm pretty sure that limit has to cover every static image used in FSO including interface art, HUD gauges, animation frames, primary weapon bitmaps, glowpoints, ship textures... and probably other stuff that I can't recall right now.

That's what I was also thinking, I think it's a memory management thing. If i recall FSO is a 32bit program, if that's the case then FSO uses safety limits because it cant use over 4GB of RAM.

Does that figure also include textures introduced via in-mission Texture Replacement?

If by "replacement" probably means dumping the old texture and the new one taking it's place. (Don't quote me on that though :nervous:)
Title: Re: Question:Recomended Model Plolygon Count
Post by: niffiwan on September 19, 2014, 12:35:28 am
The Standard/Inferno thing is for ship classes (or entries) in any ship tbl or tbm files for the entire game. A long time ago the limit used to be 130, but one of the big grand daddy of mods called Inferno went above that limit so they needed special builds to accommodate their needs. So they were called Inferno builds. The change has since gone to the main builds for the past few years so everyone can enjoy 250 ship classes. (Keep in mind 1 model can be used for more than one ship class!) It doesn't include things like any weapons or skyboxes or debris. Just actual in game objects.

So trying to understand here, i can hypothetically have 500 ships rendered in one level but the level only had 3 ship classes?

Yep, that's correct... except for the 400 ships per mission limitation :)

I should point out that the 4750 limit is for all "bitmaps" not just ship textures.  I'm pretty sure that limit has to cover every static image used in FSO including interface art, HUD gauges, animation frames, primary weapon bitmaps, glowpoints, ship textures... and probably other stuff that I can't recall right now.

That's what I was also thinking, I think it's a memory management thing. If i recall FSO is a 32bit program, if that's the case then FSO uses safety limits because it cant use over 4GB of RAM.

Yeah, that sounds about right, although you'll note that the limit is on number of textures, not aggregate size of the textures... (and a 32bit Windows OS will probably limit FSO to 2GB userspace RAM IIRC)

Does that figure also include textures introduced via in-mission Texture Replacement?

If by "replacement" probably means dumping the old texture and the new one taking it's place. (Don't quote me on that though :nervous:)
I'm not sure exactly when the old texture is dumped.  Obviously if it's still in use on another ship then it won't (or shouldn't! :)) be dumped immediately.
Title: Re: Question:Recomended Model Plolygon Count
Post by: Sanocon on September 19, 2014, 03:20:22 am
Now by mission thats the level space right?
Title: Re: Question:Recomended Model Plolygon Count
Post by: The E on September 19, 2014, 04:04:07 am
Yes.
Title: Re: Question:Recomended Model Plolygon Count
Post by: Sanocon on September 19, 2014, 04:26:27 am
Ok. I will make a note of that.
Title: Re: Question:Recomended Model Plolygon Count
Post by: Nyctaeus on September 20, 2014, 06:11:56 am
After releasing one big mod, and working on second, both with very large modpacks, I can tell you that polycount really doesn't matter. Of course you shouldn't have multipke 100k poly fighters in one mission cuz it will cause massive lags. Try to avoid more than three textures per model, I mean one single main UV texture, nameplate [only for capitalships] or glass [only for fighters and bombers] and debris texture. Of course you can make a place for debris and glass on the main texture. Nameplate is the only thing that have to be done separately.

Second: texture sizes. If you have multiple HTL fighters, missiles, drones and other small objects, keep their texture size on medium quality [1024x1024 px] and high [2048x2048 px] for capitalships. I rid off a lot of large textures for fighters and bombers from my modpack recently, reduced maps folder size of almost 80 mb and improved performance 2-3 times. Even my BoE missions runs smoothly after that.

As for the polycount itself, 20-25k for fighter/bomber is enough. There are small vessels with higher polycount here, like new HTL Medusa, but you can pack all the details You want in smaller polycount. In 40-50k you can make cool cruiser, corvette or frigate sized vessel. Destroyers and bigger vessels are not likely to have such limit. Remember about engine limitations. If your model have more than 64k faces or verts per single object, you will have to divide it into multiple subobjects just like HTL Sathanas and HTL Hades.

If You REALLY want to make higher poly than usual models, you are free to go. Esarai released a frigate with 114k polys and it runs pretty smoothly due to detailboxes. Detailboxing may save your ass. I modelled a frigate with 115k polys myself, and 75% of details are detailboxes. Even with four of them in actual mission I have no FPS drops.
Title: Re: Question:Recomended Model Plolygon Count
Post by: Scooby_Doo on September 20, 2014, 10:24:35 pm
Lodding can make a big difference too.  If you have a whole bunch of high-poly models flying around in the scene but if they're all LOD 1 (with a much lower polycount) it won't be as bad for the gpu.
Title: Re: Question:Recomended Model Plolygon Count
Post by: Sanocon on September 22, 2014, 01:55:04 am
There is only 1 level that I'm planning make may have some lag problems. but it's because it's kind of a final battle, I'm planning to near the 400 ship max. I'm also planning on making different quality builds when I release the mod(like one build where ships have 5-6k polygons max with 1 2048 texture, while another build will have ships with 3-4k polygons with 1 1024 texture) so low end computers aren't stuck with a build running less than 30 fps, but I'm still going to be reasonable for the high end computers. Even though this is my first mod, I want to see what FSO is really capable of and I'm already impressed thus far with some of the mods I played.
Title: Re: Question:Recomended Model Plolygon Count
Post by: zookeeper on September 22, 2014, 02:32:07 am
If you have hundreds of ships, then I'd worry equally much (if not more) about collision detection performance than rendering performance. Most of the ships would be off-screen or so far away that they'd use LODs anyway and thus typically skip most of their submodel render calls, whereas collision detection for everything including the hundreds of lasers flying around needs to happen all the time everywhere.

You can take my impressions with a grain of salt, but it seems to me that especially collision checking between ships flying close to each other (that is, when the ships' radii intersect) tends to be the costliest so if you have a hundred fighters flying between capships, the rendering performance is probably the lesser issue.
Title: Re: Question:Recomended Model Plolygon Count
Post by: Nyctaeus on September 22, 2014, 05:20:49 am
...than small texture sizes, detailboxes and LODing are your friends for now :P
Title: Re: Question:Recomended Model Plolygon Count
Post by: Sanocon on September 28, 2014, 01:35:52 am
...than small texture sizes, detailboxes and LODing are your friends for now :P

definitely going to be using LOD for help. now is the render distance for FSO infinite or does it have a cut off limit?
Title: Re: Question:Recomended Model Plolygon Count
Post by: Black Wolf on September 28, 2014, 02:18:29 am
Render distance is infinite, but the mission space is limited. Well... used to be limited, I think FSO has fixed that. It certainly renders stuff further away than you'll ever be able to see them (i.e. smaller than an onscreen pixel), if that makes any sense.
Title: Re: Question:Recomended Model Plolygon Count
Post by: zookeeper on September 28, 2014, 04:08:03 am
The max render distance is 10,000,000,000m. Should be enough for most purposes. :lol:

Mission space is practically unlimited, but the further you go the more jittery everything becomes. At as little as 100km away from origin, I start to get visible minor jitter, at 200km it's very noticeable, and I believe the player gets auto-destroyed if they go further than... what, 400-500km or so?
Title: Re: Question:Recomended Model Plolygon Count
Post by: Sanocon on September 28, 2014, 05:21:41 am
The max render distance is 10,000,000,000m. Should be enough for most purposes. :lol:

Mission space is practically unlimited, but the further you go the more jittery everything becomes. At as little as 100km away from origin, I start to get visible minor jitter, at 200km it's very noticeable, and I believe the player gets auto-destroyed if they go further than... what, 400-500km or so?

that shouldn't be a problem then, most fighters i encountered were averaging around 5-10km away.