Leaf portals Created 17 years ago2006-09-06 11:34:27 UTC by Fastq Fastq

Created 17 years ago2006-09-06 11:34:27 UTC by Fastq Fastq

Posted 17 years ago2006-09-06 11:34:27 UTC Post #195779
My map compiles in fullbright even though there isnt any leaks and I think this could be the problem.
Warning:Leaf portals saw into leaf
Problem at portal between leaves 1020 and 1021
(-944.000 1056.145 288.000)
(-943.977 1056.000 287.954)
(-1152.000 1056.000 205.322)
(-1152.000 1080.764 214.815)

average leafs visible:390
g_visdatasize:100930 compressed from 199712
1566.47 seconds elapsed [26m 6s]
I did a problem check but it didnt show any vertex manipulation errors or invalid object errors.How do I fix this?
Posted 17 years ago2006-09-06 18:47:14 UTC Post #195814
It won't show up using Alt-P unfortunately. Here are some notes I had written down about this error:

[quote]
--Warning: Leaf portals saw into leaf
Problem at portal between leaves 708 and 710:
   (-505.000 -660.267 2.000)
(-505.000 -660.267 409.000)
(-628.525 -737.000 409.000)
(-628.525 -737.000 1.610)
(Also should be noted that CSG and BSP ran twice!!!)

Pinpoint the coordiantes to trackdown the problem object(s). I use the brush tool selection box--and make a little box where the coordiates lie--, but whatever way works for you.

Sometimes copy/pasting objects or importing perfectly good prefabs inexplicably causes this. In this case the original object is ok, but a clone of it gives the error for some unknown reason.

Fix: delete/remake, or sometimes copy/cut the object(s), compiling without it, and then hit CTRL-Z to undo (and recompile) fixes it.

Most if not all times, turning the offender into a func_wall eliminates the error too.[/quote]

Hope helps!
Posted 17 years ago2006-09-06 22:28:25 UTC Post #195828
The "Leaf portals saw into leaf" error won't necessarily cause a fullbright compile; my last map had three or four such errors (and ran fine for months) before I finally put some effort into tracking them down and eliminating them.

FWIW, I wrote a PERL script to assist me in tracking these errors down. If anybody wants to use it, you're welcome to it. (I'll post the code below; just copy-paste into a file called leafsaw.pl - and, of course, install PERL! :))

It works fairly simply. Just run it in the directory which contains both your mymap.map file and your mymap.log file. It will generate a mymap_leafsaw.map file which you can oepn in Hammer; the new map has a red light entity (with targetname = leafsaw) at each of the coordinates listed in the error. These can be easily searched for with Hammer's entity report, marked, etc, giving you a very good idea of the bit of space where the error has occurred. Then just switch back to the same place in your RMF file (don't forget to work on your RMF rather than the _leafsaw.map; I did that a few times...) and tweak the architecture a bit. (Generally you'll see the lights line up along a particular edge, telling you exactly which brush needs revising...)

The code is as follows:

#!/usr/bin/perl -w

use strict;
use File::Copy;

foreach my $f (<*.log>) {
  print "Reading $fn";
  my $fn = $f;
  $fn =~ s/.log//;
  my $map = $fn."_leafsaw.map";
  copy($fn.".map",$map);
  open LOG,$f;
  open MAP,">>$map";
  my $lcount = 0;
  my $lpsil = 0;
  foreach my $line (<LOG>) {
    if ($line =~ /Leaf portals saw into leaf/) {
      $lpsil = 1;
      }
    next unless $lpsil;
    chomp $line;
    if ($line =~ /(([-.0123456789]+) ([-.0123456789]+) ([-.0123456789]+))/) {
      my ($x,$y,$z) = ($1,$2,$3);
      $lcount++;
      print MAP "{n"classname" "light"n"_light" "255 0 0 500"n";
      print MAP ""targetname" "leafsaw"n"origin" "$x $y $z"n}n";
      }
    elsif ($line eq "") {
      $lpsil = 0;
      }
    }
  close MAP;
  if ($lcount) {
    print "Recorded $lcount Leaf_Saw_Into_Leaf marker lights into $mapn";
    $lcount = 0;
    }
  else {
    unlink $map;
    }
  }

print "nPress [Enter] to continue ... ";
<STDIN>;
Posted 17 years ago2006-09-10 15:52:06 UTC Post #196207
Wow - thanks for the bit of software. I'll give it a run the next time i run into this nasty error.

Sure beats moving your mouse carefully and trying to pinpoint coords.

Works a bit like Leakmark - only that's for leaks..
Posted 17 years ago2006-09-10 18:40:39 UTC Post #196247
Totally awsome Darkphoenix!!! It's guys like you who should be updating Hammer :)
Posted 17 years ago2006-09-18 00:36:50 UTC Post #196816
Glad you think it's useful! ;-)

The code was a bit quick 'n nasty, but it does the job!

If I understood the RMF format I might have been tempted to modify that directly ... but OTOH, working with the MAP file might be a little more fiddly, but it's also a lot more portable and should work for other editors as well as Hammer...
You must be logged in to post a response.