Access to collision geometry information (physics faces) for models and the map

DecoDeco Join Date: 2010-04-10 Member: 71288Members, WC 2013 - Shadow
edited June 2013 in Modding
Howdy!

Been messing around with modding NS2, and I was wondering if there's a way to access the world and model collision geometry.
It seems the only way to do this is via traces, but that's impractical for what I want to do.

Are there any functions to access this information? If not, can we get some?
It doesn't have to be based off the live environment.
Simply: given a model (or the map), get a list of the collision faces and their position (at a given time, if an animated model).

If there's an issue with accessing the PhysX thread, perhaps it could be a request with a callback (or a pollable object).

My use-case is a HUD that estimates enemy locations (and hence needs to compute visibility), but it's not the only one: local bot navigation, bullet penetration, map layout analyses, etc

Even better would be the ability to insert, remove and modify faces in the map (for both rendering and physics), but that's a long shot...
(Imagine generating a new NS2 map each round using an L-System. Analysing balance and playability would be interesting!)

Comments

  • TharosTharos Join Date: 2012-12-18 Member: 175439Members
    My use-case is a HUD that estimates enemy locations

    Maybe look at the code of the "aura" alien upgrade, close enemies are visible even behind walls with this upgrade.
  • DecoDeco Join Date: 2010-04-10 Member: 71288Members, WC 2013 - Shadow
    Tharos wrote: »
    My use-case is a HUD that estimates enemy locations

    Maybe look at the code of the "aura" alien upgrade, close enemies are visible even behind walls with this upgrade.

    That just draws sprites over the location of enemy players.

    I've made a prototype in LÖVE2D that creates probability fields based on last known enemy position, velocity, etc.
    At the moment it's just a test, but it could become interesting.

    In order to do it, I need to find the edges of walls and other obstacles.
    To do that, I could either trace (a lot) or work with a list of collidable/renderable faces.
  • DecoDeco Join Date: 2010-04-10 Member: 71288Members, WC 2013 - Shadow
    Bump!

    It'd be really nice to have some input from an engine dev, even if it's "this will never happen."
  • JimWestJimWest Join Date: 2010-01-03 Member: 69865Members, Reinforced - Silver
    No you can only use Traces.
  • matsomatso Master of Patches Join Date: 2002-11-05 Member: 7000Members, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Shadow, NS2 Community Developer
    I'd suggest flood-filling the map with 0.1x0.1m cubes and storing the result once for each map. Gives you a coarse outline of the map, basically. A typical map is about 300x300x50m or so, rougly a million cubic meters, so ... about a gigabit of info or so.

    For extra credits, adaptive cube sizes :-)
  • CrushaKCrushaK Join Date: 2012-11-05 Member: 167195Members, NS2 Playtester
    edited July 2013
    Can't you use the navigation mesh / path node network to estimate possible locations of enemies in the map? It would of course fail for stuff like Lerks and Skulks in vents and on ceilings, though…

    That's how it used to be done back in UT - and those games had some of the finest deathmatch-style AIs out there.
Sign In or Register to comment.