Proposals/Obsolete Proposals/MapUtils


Author: Blondandy (talk, contrib)

maputils java

  • algorithm development: in svn ufoai\branches\maputils_java
  • compilation scripts for windows and linux are there too (javac required - sdk from
  • once compiled, do this to get started
java -jar maputils.jar -h

maputils todo

  • [open] check for z-fighting (only for faces that don't have nodraw set)
  • [open] check for intersecting brushes, see if there can be an automatic test to see if it can be simplified without introducing more brushes. (see src/tools/ufo2map/csg.c)
  • [done] assign nodraw to faces that are never exposed for faces pressed entirely against another face.
  • [WIP] nodraws to faces pressed against composite faces (parallel abutted faces from different brushes).

known problems

  • See datasource/maps/test/ after revision 17082. Largest roof part brush does not get the face se to nodraw that is hidden by 3 smaller brushes.
  • Maputils as of revision 17082, applied to trunk/base/maps/frozen/ (same revision), seem to make two mistakes. In the radiant screenshot below, furthest brush has selected face incorrectly set to nodraw, while two closest brushes do not have selected faces set to nodraw (they actually are obscured by brushes that are hidden in the screenshot).
    • I guess I should prioritise nodraws that are set when they should not be. I have worked out why this happens in frozen/ i need to totally redo my hidden-by-composite-face algorithm. again. this is tricky. it is hard because the composite faces can be concave (Richlv always finds the concave ones). i can see why the quake 2 engine uses convex brushes. everything gets easier.--Blondandy 22:33, 10 June 2008 (CEST)
    • incorrectly set nodraw for the furthest brush is fixed as of revision 17286. --Richlv 00:45, 20 June 2008 (CEST)

Radiant nodraws.jpg

  • Maputils as of revision 17286, applied to trunk/base/maps/frozen/ (same revision), does not set two additional nodraws (both are covered by single face, not a composite).

Radiant nodraws 2.jpg

ufo2map -fix -check todo

  • [open] Set levelflags based on vertex coordinates. This would only be used early in the mapping process, as it could not take into account optimisations like hiding floors in buildings when the player point of view has risen above the level of the roof. This check would be outside -fix all.
  • [open] assign nodraw to faces that are never exposed for faces pressed entirely against another face.
  • [WIP] split tests that mattn implemented.
  • [done] convert null textures to nodraw textures. by --Mattn 12:10, 1 June 2008 (CEST)

todo (maybe straight into ufo2map, maybe in maputils first)

  • align actorclips with the grid
    • probably unfeasible with current pathfinding code - many non-aligned actorclips are used to impact pathfinding --Richlv
  • reduction of exposed faces
  • find broken brushes. (see FixWinding in brushbsp.c)
  • align info_.+?_start to grid
    • can it be verified that the new position does not overlap with any brushes ? --Richlv
  • snap brushes to grid (not sure if this is a good idea...),
    • no definitly not ;) --Mattn 12:10, 1 June 2008 (CEST)
  • downward facing faces. I prefer not nodraw, as this messes up first person view [v]. perhaps we can use levelflags in some way. I realise this is controversial. --Blondandy 23:48, 31 May 2008 (CEST)
    • first person view sucks and the game is not designed for this, pvs was removed and so on. we should remove the fps in its current state and maybe just set the minpitch value of the camera to 0 (cl_campitchmin 0) --Mattn 12:10, 1 June 2008 (CEST)
    • I have a vague notion of pvs. but do not understand the relevance.
      • It's the potential visible set - a set of brushes that are visible in the current view frustom. It's a optimization for first person shooters that we don't have anymore
    • the smallest minpitch should be allowed to get is half the camera's vertical angle of view, otherwise you can see up through floors, because of the nodraws.

other stuff

  • BTAxis mentioned: faces that are never seen because the angle of view is limited and there are other brushes (eg floor, ground) above them. This would require a completely different algorithm , so i will leave it for now.

Note: This is not yet working in ufo2map. More patches are welcome

once a nodraw is identifed from the geometry, it should report

  • faces with nodraw flag & texture already set;
  • faces with flag only set;
  • faces with texture only set;
  • faces without any of these that are going to be transformed.