Getting detailed models ingame experiments.

Started by SleepKiller, July 25, 2017, 06:45:07 AM

Previous topic - Next topic
July 25, 2017, 06:45:07 AM Last Edit: August 03, 2017, 03:48:13 AM by SleepKiller
This topic is one I posted in the requests board and have since hijacked now talk about experiments of getting detailed models ingame.

[spoiler=Original Post]By golly, it's been a while since I've actually posted a topic related to me modding the game. I have a random and seemingly strange request for anyone that is able to fulfill it.

I'm after some very detailed (Shall we say around ~10k face count, although I'll settle for whatever anyone has) for some testing around LOD settings in munged files. If anyone has anything in that detail range (5k to 10k faces) (or can easily make) I would appreciate them sending the models my way.

I want to experiment around with fooling the game's engine into thinking the models it is rendering are not quite as highly detailed as they actually are.

Ideally I would like to play around with a soldier model, a (hover) vehicle model and a static prop model. But I'll take what I can get.

I'm not sure that I'll get anything out of it so I don't want anyone going out of their way to fulfill this request, but I would like to play around with it.[/spoiler]

If it suits your purposes, I would be okay with you using my TFU Stormtrooper model conversions: http://www.swbfgamers.com/index.php?topic=10470.0
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Quote from: Gistech on August 02, 2017, 10:48:58 PM
If it suits your purposes, I would be okay with you using my TFU Stormtrooper model conversions: http://www.swbfgamers.com/index.php?topic=10470.0
Perfect!

I've performed some initial simple tests. I stipped the model of it's skin and munged it as a static model with no collision. Then I filled map with ~96 of them for a start. Then I struggled with getting it munging (it's been a while since I've made maps...) . Finally I was able to a baseline test, as expected the game would only render a few at a time, favouring the closest ones.

After some fiddling based off the information I've learnt about the munged format I was able to get all of them rendering at once. (See the attached picture.) So each of those models weighed in at around 9099 faces each I think. Not too bad for the game to render ~96 of them once.

I will continue to look into this, with the end goal of making a simple tool to automate the edits.

That seems to suggest, at least to me, that the memory pool for unit models is a lot less than we think.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Quote from: Gistech on August 03, 2017, 04:17:15 AM
That seems to suggest, at least to me, that the memory pool for unit models is a lot less than we think.
Do you mean a lot more? Or less because without the edits I only had a few rendering?

Either way they weren't being used as units, they were simple props. Essentially what I did in the edit was tell the game, "Trust me this model only has eight triangles in it.". That seemed to make it be quite happy to go "Well okay then I can render all those no problem without butchering the FPS!".

So the game appears to be maintaining a "cost" of sorts for the current frame, if it's too high it says no and stops rendering high detailed models to keep FPS up. (At least on 2004 hardware that is.)

I'm about to do some testing with unit models, just need to get setup first, I shall report back my results.

Quote from: SleepKiller on August 03, 2017, 04:24:36 AM
Do you mean a lot more? Or less because without the edits I only had a few rendering?

Either way they weren't being used as units, they were simple props. Essentially what I did in the edit was tell the game, "Trust me this model only has eight triangles in it.". That seemed to make it be quite happy to go "Well okay then I can render all those no problem without butchering the FPS!".

So the game appears to be maintaining a "cost" of sorts for the current frame, if it's too high it says no and stops rendering high detailed models to keep FPS up. (At least on 2004 hardware that is.)

I'm about to do some testing with unit models, just need to get setup first, I shall report back my results.

From my investigations and from what psych0fred told me the model memory is split up into several separate pools. I'd guess it's something like one for terrain, one for world objects, one for animated props, one for vehicles and one for units, and I'd guess that the one for units is a lot less than the one for world objects, for instance. When you render the unit models as props, they use a different model memory pool.

However, if the same method you used to render it as a prop works when you render it as a unit, it means we can finally bypass the 'no high-res units' limitation for the original game.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Without the edits the game was freaking out trying to render the stormtrooper model, it would render it, then immediately switch to the lowrez model leading to an awful lot of flickering.

After the edits I got the all models ingame and stopped them from ever switching out to the lowrez model defined in the odf. Bad news is the animation system still gives up, leading to great looking sliding storm troopers. I'm still going to look into it and see if I can trick the animation system as well.


So, we're almost there... this would be awesome because I've wanted to put the SWBF3 Battle Droid and TFU Stormtroopers into SWBF for Phase 2 of my Legacy Mod for a while now.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Is this possible to be made and for Battlefront 2?Or Battlefront 2 do not need such thing?

Battlefront II handles models differently, allowing you to use whatever high-res models you want.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Quote from: Ginev on August 04, 2017, 02:56:31 AM
Is this possible to be made and for Battlefront 2?Or Battlefront 2 do not need such thing?
Quote from: Gistech on August 04, 2017, 03:03:31 AM
Battlefront II handles models differently, allowing you to use whatever high-res models you want.
Depends if SWBFII has the same problem or not. In my tests the problem wasn't the game engine willingness to upload a high resolution model to the GPU, it was its willingness to consistently make a draw call for it. If SWBFII also has that problem then yes this trick will work for it.

I wasn't able to find a way to trick the animation system, but that doesn't mean my work was for nothing. With this trick you can still draw high detailed props/buildings/vehicles and you should be able to find a balance for the engine where it doesn't give up on animating the models. I may have been pretty hard on it with that wide open map and it trying to do them all at once. (Or someone could just find a way to trick the animation system as well.)

For now I've posted a tool to automate the edits I was making, grab it and talk about it here http://www.swbfgamers.com/index.php?topic=12234.0.

Sorry about the lack of explanation and detail in these posts. I was working on this all evening and want to get onto other things, I'll try to write up how to do the edits manually tomorrow and more instruction on the tool. (Although the tool is dead simple so I don't know how much more instruction is needed.)

Just thinking on it: granted that the model issue persists with models that are 9,000+ polys like the TFU Stormtrooper, but I'm wondering if the method would work with unit models with a poly count of less than 3,000 with better success.
In Progress:
--Star Wars: Battlefront - Anniversary Edition (formerly Star Wars: Battlefront - Legacy Edition)

On Hold:
--Star Wars Battlefront: Elite Squadron For SWBF1
--Endor: Imperial Base

Quote from: Gistech on August 09, 2017, 06:16:23 AM
Just thinking on it: granted that the model issue persists with models that are 9,000+ polys like the TFU Stormtrooper, but I'm wondering if the method would work with unit models with a poly count of less than 3,000 with better success.
Sorry, I think I may have been doing a poor job communicating here.

The 9K models work fine ingame. They're fully animated and look great.

So why did I say the animation system gave up? Because it does if you lie to the game too much. My primary test was a completely open map with ~32 units in it at once, none of which were being allowed to switch out to their low resolution model defined in their ODF.

I was telling the game the models only had eight triangles, however what happens instead if we told it the model had 1K or 500? The renders the high resolution models fine still with no flickering, but low res switching for background models can still take place. (Keeping the animation system happy.)

You even might be able to have your low resolution models be 2k-4k triangles, just adjust their cost to the same extent your adjusting your high resolution model.

Doing all that you should be able to have great looking (comparatively to stock) unit models without any major problems. It is also worth noting that in my limited tests when I kept the model's cost high enough for the game to still want to perform low res switching it still rendered more normal models than the game would for stock unit models without this hack applied. (Quite happily so as well.)