Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Amo on August 23, 2006, 10:22:29 AM

Title: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 10:22:29 AM
Good morning!

I made several 3d Actor tests during the last days and recognized, that the poly counter tells my something total different to what Max says.
My Actor in Max has 2088 Triangles but WMEs poly counter shows about 4600 in an nearly empty test scene and about 6500 (!) after opening the Escape Menu (just some little textured windows with standard buttons save, exit, etc. )
How is that comming? Or better asked, how can I optimize that? After loading the actor twice one as NPC one as player I lost about 30 fps (from 85 to 53) I better do not think about whats happening after loading a second NPC.
My workstation is really not slow (P4 3Ghz, GeForce 6600GT, 1Gbyte RAM), but we can't expect that possible users accept that high system specs for a 2.75D adventure.
What is the polycounter really counting? I can't find where the triangles should be.
Title: Re: Characteroptimizing and the polycounter
Post by: Mnemonic on August 23, 2006, 10:28:07 AM
The counter shows polygons actually rendered. It's approximately twice as much as the character's polycount, because the character is rendered twice (once for the shadow silhouette).
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 10:43:33 AM
OMG!?! Twice for the shadows...Hm... I hate the idea behind killing a half of my triangles...How about the DrawBackfaces attribute? Is it working as standard, or has it to be activated manually?
Title: Re: Characteroptimizing and the polycounter
Post by: metamorphium on August 23, 2006, 10:55:03 AM
that's really strange. I am testing my game on Athlon XP+ 1800, with GeForce FX5600 and I have 86fps (monitor refresh rate) with exactly two times bigger framerate (including particle engines and such).

On the other hand typical low poly model for such engines is around 3000 polys max.

One more thing, I believe that you can switch off shadows, but if you want to have shadows on your scene, it's necessary to render them so there's no way around that.

Title: Re: Characteroptimizing and the polycounter
Post by: metamorphium on August 23, 2006, 10:57:27 AM
what's your screen resolution?
Title: Re: Characteroptimizing and the polycounter
Post by: Mnemonic on August 23, 2006, 11:04:15 AM
Quote
OMG!?! Twice for the shadows...Hm... I hate the idea behind killing a half of my triangles...
Well that's the way it is. The shadow has to be rendered *somehow*. Of course, you could sacrifice the shadow quality by using the "simple shadow", i.e.  the simple black blob. It's just 2 polygons :)

Quote
How about the DrawBackfaces attribute? Is it working as standard, or has it to be activated manually?
By default DrawBackfaces is enabled. If your model doesn't rely on backfaces, you can set it to false (actor.DrawBackfaces = false;).

As for the window raising polygon count, you can "optimize" it by not using the "tiled image" for the window backround, but a single image.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 11:10:16 AM
That is not that strange in fact, because the res is 1024 768 4x Antialiasing and two monitors. It is more the fact behind having so many Triangles (as said the double of the figure normally has). Even what I do not understand is, that the menu has about 2600 Tris.... I do not want to decrease the tris of the actor down to 1500 than he looks like Trinity and she is really low. The menu is actually no problem, because the framerate is jumping back to 85, I was just wondering about.

Ok, when you say... I normally do not give a damn about shadows, that is the thing of our coder  ;D
Title: Re: Characteroptimizing and the polycounter
Post by: metamorphium on August 23, 2006, 11:15:27 AM
I am using 1024x768 6x alias on the Ati card and 4x on the GeForce card... Strange.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 11:19:26 AM
(actor.DrawBackfaces = false;).

I tried it out, it made no difference, wether for frame nor for the poly counter...

@metamorphium: Can the second monitor be the reason for this behaviour? Do you have a second one?
Title: Re: Characteroptimizing and the polycounter
Post by: metamorphium on August 23, 2006, 11:23:14 AM
no. I don't have second monitor. Maybe it can really be related. Maybe if you upload somewhere some test scene, we can look at that on our computers.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 11:28:47 AM
Unfortunately uploading a test scene is not possible yet, it is problem with the rights (the project is commercial). I try it out, I'll pump the actor up to 7000 tris and try it one time with both screens and than deactivate the second one.
Give me a minute.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 11:37:26 AM
Ok, I pumped him up to 10 000 that caused a maximum poly count of 23 000 in the scene (low poly NPC, scene, high poly actor).
With second screen: 35 frames
without: 36 frames

That is not the reason. Ok, I'll eat something and than I continue my search.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 12:11:55 PM
I can't find a reason, playing WME only on the second screen makes no difference at all.
Hopefully it works after adding more sprites and scripts not as lame as a one legged turtle.

Another question about the actors. With the Ms3d actors it was possible to cut all animations to several files, to load only that one, you need, like an separate take animation. Is that also possible with the X files? I tried it at the same way I used to do with the milkshapes but it doesn't work.
Title: Re: Character optimizing and the polycounter
Post by: metamorphium on August 23, 2006, 12:37:25 PM
try closing all other applications. For example 3d studio Max tends to reduce performance to half the number of the frames.
Also trz to run it in compiled mode with project man and scene edit instances closed.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 12:54:38 PM
Does scene edit and project man need so many resources? That could be a reason, max is already closed. We try, otherwise I do not know what to do.
Title: Re: Characteroptimizing and the polycounter
Post by: Mnemonic on August 23, 2006, 04:18:07 PM
I kind of lost track by now. So, the problem is, that the 10000 polygon character is too slow, or...?

Quote
Another question about the actors. With the Ms3d actors it was possible to cut all animations to several files, to load only that one, you need, like an separate take animation. Is that also possible with the X files? I tried it at the same way I used to do with the milkshapes but it doesn't work.
You can specify multiple MODEL = "something.x" lines in the actor definition.

Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 04:41:48 PM
I kind of lost track by now. So, the problem is, that the 10000 polygon character is too slow, or...?

You can specify multiple MODEL = "something.x" lines in the actor definition.


Erm... OK... Where? I mean, must I add this to the external data part, or something like:

 ANIMATION
  {
    MODEL="talk.x"
    NAME="talk"
    LOOPING=TRUE
    STARTFRAME=5
    ENDFRAME=35
  }

And how about pre loading? Are they all were pre loaded at the start of the game even an model that is needed in lets say 2 scenes of 100?
For example the same model only including an ladder animation, and nothing more.

I kind of lost track by now. So, the problem is, that the 10000 polygon character is too slow, or...?


No, not really. I just used this as a test, to find out, where the limitations of WME are. The point is, we tested it now on some machines here.
After loading two actors, both with 2020 tris in one scene, combined with some objects, we got about 6800 tris and the frame rate decreased down to 35 on a P4 with 2,2Ghz. On my 3Ghz everything seems to be nice, only the loading of the scene needs a little longer (only lets say 1/2 second, nothing to worry about).
We are just a bit unsure what is happening, when we have a full scripted scene, with many objects and three of these characters. Nobody wants, that the minimum system specs are about 2,2Ghz and a GeForce6.
Title: Re: Characteroptimizing and the polycounter
Post by: Mnemonic on August 23, 2006, 05:34:13 PM
You can specify multiple MODEL = "something.x" lines in the actor definition.
Erm... OK... Where? I mean, must I add this to the external data part, or something like:
No, you specify multiple MODEL = "something.x" lines.

Code: [Select]
MODEL = "something1.x"
MODEL = "something2.x"
MODEL = "something3.x"

The animations of all those .X files are then merged. Note the word *animations*. It doesn't mean the model is loaded three times in memory, it's only loaded once. The other .X files only add their animations.


We are just a bit unsure what is happening, when we have a full scripted scene, with many objects and three of these characters.
The 3D characters are the single most hardware demanding feature. Your scripts/sprites are not likely to take much of the performance, unless you'll be doing some very nasty things.
Also, the antialiasing is, naturally, bringing the performance down, because the scene has to be rendered in higher resolution and downsampled.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 05:59:28 PM
No, you specify multiple MODEL = "something.x" lines.

Code: [Select]
MODEL = "something1.x"
MODEL = "something2.x"
MODEL = "something3.x"

The animations of all those .X files are then merged. Note the word *animations*. It doesn't mean the model is loaded three times in memory, it's only loaded once. The other .X files only add their animations.




Yes I got that with the multiple lines, but my question was, where in the file I have to add that. I am artist, no coder, so sorry for my noobie questions.
Did I understand you right, when I add the following:

Code: [Select]

 ;--- external data
  MODEL = "actors\tom\tom1.x"
  MODEL = "actors\tom\tom2.x"
  FONT = "fonts\arial.font"
  ;CURSOR = ...

It is good to know, that just the animations get pre loaded, but they need power too, so my question was, where they all pre loaded, or where they loaded, when the animation is needed. That is important for me to know, because I am unsure right know if could add some more animation parts, randomly played when the actor stands still.

Title: Re: Characteroptimizing and the polycounter
Post by: Mnemonic on August 23, 2006, 06:16:35 PM
Did I understand you right, when I add the following:
Yup.

It is good to know, that just the animations get pre loaded, but they need power too, so my question was, where they all pre loaded, or where they loaded, when the animation is needed. That is important for me to know, because I am unsure right know if could add some more animation parts, randomly played when the actor stands still.
Currently they are all preloaded.
There's a feature request for loading custom animations on demand.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 07:14:24 PM
Ok, that is clear now. Thank you.
And with the milkshape files it is the same?
Title: Re: Characteroptimizing and the polycounter
Post by: Mnemonic on August 23, 2006, 07:26:12 PM
Yes, they were preloaded too.
Title: Re: Characteroptimizing and the polycounter
Post by: Amo on August 23, 2006, 07:27:34 PM
Thanks for the information.