Page 1 of 2

MOH Light Compile error

Posted: Sun Jan 11, 2004 5:59 am
by diego
I'm getting this error when MOHlight starts to calculate the light and shadow grids after doing all the model files:


451) Model: static/bush_buckthorn.tik
452) Model: static/bush_buckthorn.tik
453) Model: static/corona_util.tik
Total Models Lit: 454
Total Vertecies Lit: 81737
Total Vertecies that were in Solid Leafs: 1924
Data Size: 322401 bytes

************ ERROR ************
SetupGrid: malloc failed on 1604923808 bytes


It was working fine until today. I added some more lights and some more brushes, but no major changes. BSP and the vis data compile fine. I don't have any leaks. I can post the full logs if that will help.

Thanks.

Posted: Sun Jan 11, 2004 7:20 am
by Balr14
You have way too many lights and/or surfaces too light.

Posted: Sun Jan 11, 2004 10:49 am
by jv_map
Yup, basically you don't have enough memory (RAM) to compile your map as it is now...

Posted: Sun Jan 11, 2004 1:11 pm
by diego
Well, Balls....

Looks like that's it. I've got 512. I was watching my memory usage while compiling. It sits around 350 meg until it hits that point, then it suddenly jumps to something like 2 gig or more before crashing. Not sure why just a few more lights and objects would knock it so far off though.

Posted: Sun Jan 11, 2004 9:55 pm
by diego
I've reverted to an earlier version of my map. This one will compile fine. But I've been seeing these errors:

====== Entity Lighting Lights ======
Num lights per leaf clamped from 78 to 60
Num lights per leaf clamped from 88 to 60
Num lights per leaf clamped from 81 to 60
Num lights per leaf clamped from 88 to 60
Num lights per leaf clamped from 67 to 60
Num lights per leaf clamped from 115 to 60

Posted: Mon Jan 12, 2004 3:57 pm
by bdbodger
Maybe fewer lights with larger radiuses maybe . Are you useing lights to light your shadows instead of worldspawn setting ambientlight to light your shadows ? Why do you need that many lights ?

Posted: Mon Jan 12, 2004 11:38 pm
by diego
I am using ambient light for the shadows. But for interiors, I've been using multiple light sources in many of the rooms for a more realistic effect. I've also had problems getting lamp .tik objects to illumniate evenly. Lamp shades and hanging lights always seem to have some surfaces facing away from my light object leaving dark spots on the .tik model.


I've been trying to cut back on how many lights I'm using by substituting fewer lights with larger radii if possible. But it is not uncommon for me to have 3-5 lights in a room --- even as many as 10 in some cases.

In one instance, I have a tunnel that used to have 4 large ceiling lights, but I found the radius of those was so large, it was affecting the characters on the street above the tunnel. So I now I have about 8 small lights placed near the floor to compensate.

In another room, there are wall sconces over each table in a bar. I put one light object for each one of them plus a few for the bar itself. That one has 10 lights.

Is 60 lights a recommended maximum for the entire map? I'll never get it cut down that far.

Posted: Tue Jan 13, 2004 12:17 am
by Bjarne BZR
Diego wrote:Is 60 lights a recommended maximum for the entire map? I'll never get it cut down that far.
I had 154 lights in "Vemork Factory"... and even more in the first (larger) version, so you can use more than 60...

Oh, and there were some light emitting surfaces as well.

Posted: Tue Jan 13, 2004 4:55 am
by diego
I've never used a light emmitting surface. Is that like a lit window?

Posted: Tue Jan 13, 2004 7:55 am
by Bjarne BZR
yes, usually.

Posted: Tue Jan 13, 2004 8:26 am
by jv_map
Diego, did you do anything to 'vis' your map? I.e. use hint brushes or vis_leafgroups? Did you do a vis compile at all?

Vis data helps the light compile as the compiler will understand that when one room can't 'see' another room, light can't go from this room to the other one. Using clever vis design the leaf size will probably decrease and there won't be so many lights per leaf. Hence, your light compile won't need to 'clamp' lights, it will use less memory and be faster.

8-)

Posted: Tue Jan 13, 2004 8:32 pm
by diego
I didn't really build the majority of this map. Mostly, I am lighting, texturing and adding static details. But occasionally I add more structure to it. I know there are no special brushes in it for vis groups. I have a basic understanding of what it is for, but not enough for me to make decisions on how to break it up manually with brushes.

Do I just put hintbrushes in the interiors of my buildings? 2 sides of the map are walled in with very long buildings with multiple rooms. One of these sides is at a 45 degree angle so I know these rooms must be crossing over multiple vis_leafgroups as they are displayed in Radient. The map also has a couple of big open areas.

FPS is pretty good on the map except when you look in the direction of the trees. It doesn't matter if they are visible or not. Then it drops from 60-80, to about 45. But it did that before I started on it. I figured leafgroups would help that problem as well.

I've been trying to get a better idea how this stuff works and how to implement it on a scale more complicated than the simple box tutorials. But I decided not start thowing stuff in the map that I don't understand.
I suppose it would help if I could see an example of a real map that was using vis_leafgroups and brushes.

I do compile the vis data. But I also have the blocksize set to zero. One of the tutorials here and another elsewhere said to do that. It doesn't take very long -- about 30 minutes. Compile time was about 2 minutes before I started loading the map with objects and lights.


This is starting to snowball into a completely different problem than I expected. I appreciate the help.

Posted: Wed Jan 14, 2004 6:10 am
by diego
Here is my data from the vis compile.

1553 portalclusters
4886 numportals
7302 numfaces
visdatasize:310608

creating leaf vis...
Average clusters visible: 266

70 minutes compile time.


Latest Light attempt. This one was with Radiosity on and static shadows:

Total Models Lit: 405
Total Vertecies Lit: 75774
Total Vertecies that were in Solid Leafs: 1769
Data Size: 296282 bytes


====== Entity Lighting Lights ======
Num lights per leaf clamped from 74 to 60
Num lights per leaf clamped from 80 to 60
Num lights per leaf clamped from 73 to 60
Num lights per leaf clamped from 79 to 60
Num lights per leaf clamped from 103 to 60

It appears that all the steps are being completed, but I've noticed that the staticshadows are not being calculated.

Posted: Wed Jan 14, 2004 7:18 am
by jv_map
Your visdatasize is relatively high, that indicates you may have too many structural brushes (or the map is just very big).

Posted: Wed Jan 14, 2004 8:39 am
by diego
I think the map is kind of big. With the 1024 blocksize turned on, it is about 7x8 blocks. The map really wasn't built within these blocks so I don't think turning the blocksize back on in my compile will be much help.

I've been reading up a lot on vis_leafgroups and area portals and stuff today.

I have not tried any manual vis data, but I have put in some area portals in the doorways of all rooms that do not have windows.

I've also been trying to get my MOH to work with the r_showtris command. But everytime it says cheats are not enabled.

I'm using the following batch file to run MOH:

E:\Games\ALLIED~1\MOHAA.exe +set developer 1 +set thereisnomonkey 1 +set cheats 1 +set ui_console 1 +devmap BK_Town

I thought this was supposed to auto-load the map, but it has never worked. I just get a console window that pops up saying I have a localization error. I've been searching for a fix for that but the one other post that had my exact error message was never really answered.

-----------------------------------------------------------------------------

That said, this thread has shifted it's focus to a vis data issue. With all the research I did today on the topic, I have a better understanding of the vis_leafgroups and manvis. But everything I have seen has been geared towards improving FPS. My FPS is actually quite good.

So how will all this vis_data help my lighting? I would like to resolve the clamping errors, get my static shadows working again, and make sure I don't run out of memory again when calculating the diffuse grids.


--------------

By the way, I noticed my BSP file is 8.8 megs. Is that bad?