Difference between revisions of "Proposals/Obsolete Proposals/MapUtils"

From UFO:AI
(known problems: - list one more problem in st_h01 maptile)
 
Line 15: Line 15:
  
 
===known problems===
 
===known problems===
* See data_source/maps/test/test_nodraw.map after revision 17082. Largest roof part brush does not get the face se to nodraw that is hidden by 3 smaller brushes.
+
* See {{datasource|/maps/test/test_nodraw.map}} 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/st_h01.map (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).
 
* Maputils as of revision 17082, applied to trunk/base/maps/frozen/st_h01.map (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/st_h01.map. 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.--[[User:Blondandy|Blondandy]] 22:33, 10 June 2008 (CEST)
 
** I guess I should prioritise nodraws that are set when they should not be. I have worked out why this happens in frozen/st_h01.map. 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.--[[User:Blondandy|Blondandy]] 22:33, 10 June 2008 (CEST)
Line 47: Line 47:
 
*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.
 
*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.
 
<br>
 
<br>
* Some of the stuff is already ported and included in ufo2map - here's a patch http://mattn.ninex.info/patches/ufo2map_nodraw.diff
+
* Some of the stuff is already ported and included in ufo2map - here's a patch {{http|mattn.ninex.info/patches/ufo2map_nodraw.diff}}
 
Note: This is not yet working in ufo2map. More patches are welcome
 
Note: This is not yet working in ufo2map. More patches are welcome
 
<br><br>
 
<br><br>

Revision as of 17:48, 4 October 2012

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 java.sun.com).
  • 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/test_nodraw.map 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/st_h01.map (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/st_h01.map. 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/st_h01.map (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.