Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

Understanding how the map works.


foxtail
 Share

Recommended Posts

Hello again.

 

So I've been digging into the map system structure and I have some questions.

 

I see that there are a couple of types of files associated to the map.

 

One of those is ymap. This XML file defines the <CMapData> root with Extent information like so:

 

  • Exhibit A - hei_dt1_12.ymap
<CMapData>  <name>hei_dt1_12</name>  <parent>hei_dt1_lod</parent>  <flags value="2"/>  <contentFlags value="18"/>  <streamingExtentsMin x="-699.51840000" y="-1711.34000000" z="-732.95460000"/>  <streamingExtentsMax x="844.98030000" y="-70.88074000" z="833.23740000"/>  <entitiesExtentsMin x="-5.62365700" y="-975.01520000" z="27.50712000"/>  <entitiesExtentsMax x="145.06910000" y="-795.41660000" z="137.02910000"/>

This looks like a tile on the map, being defined by two 3-Dimensional points.(streamingExtentsMin, streamingExtentsMax)

 

  • Exhibit B - hei_dt1_13.ymap
<CMapData>  <name>hei_dt1_13</name>  <parent>hei_dt1_lod</parent>  <flags value="2"/>  <contentFlags value="18"/>  <streamingExtentsMin x="-655.01980000" y="-1711.34000000" z="-666.76250000"/>  <streamingExtentsMax x="844.98030000" y="-211.34020000" z="833.23740000"/>  <entitiesExtentsMin x="133.77600000" y="-1013.40600000" z="16.47309000"/>  <entitiesExtentsMax x="260.30820000" y="-848.08870000" z="59.63683000"/>

After these are defined, then <entities> are defined. Like so:

<entities>    <Item type="CEntityDef">      <archetypeName>DT1_12_emissive_SLOD</archetypeName>      <flags value="8"/>      <guid value="2724170972"/>      <position x="70.18534000" y="-884.15190000" z="89.27497000"/>      <rotation x="0.00000000" y="0.00000000" z="0.00000000" w="1.00000000"/>      <scaleXY value="1.00000000"/>      <scaleZ value="1.00000000"/>      <parentIndex value="14"/>      <lodDist value="15000.00000000"/>      <childLodDist value="375.00000000"/>      <lodLevel>LODTYPES_DEPTH_SLOD1</lodLevel>      <numChildren value="4"/>      <priorityLevel>PRI_REQUIRED</priorityLevel>      <extensions/>      <ambientOcclusionMultiplier value="255"/>      <artificialAmbientOcclusion value="255"/>      <tintValue value="0"/>    </Item>

I'm guessing these are the items that exist in the tile and their positions? But what are archetypes? How do *.ytyp files tie in? And these tiles seem huge to only hold a couple of entities.

 

Do they perhaps overlap?

 

I would appreciate some insight from someone who understands how this all works,

 

Thanks,

F

Link to comment
Share on other sites

.ytyp files are model definitions, game knows that the model exists, then you can use it as you want, as a map object, spawn in scripts etc.

HHnErXC.png


Link to comment
Share on other sites

.ytyp files are model definitions, game knows that the model exists, then you can use it as you want, as a map object, spawn in scripts etc.

 

So to see if I understand this.

 

In .ytyp files models are defined. An example:

<archetypes>    <Item type="CBaseArchetypeDef">      <lodDist value="300.00000000"/>      <flags value="0"/>      <specialAttribute value="0"/>      <bbMin x="-82.43872000" y="-90.51441000" z="-104.07640000"/>      <bbMax x="60.86279000" y="56.73477000" z="75.92849000"/>      <bsCentre x="-10.78796000" y="-16.88982000" z="-14.07395000"/>      <bsRadius value="136.58280000"/>      <hdTextureDist value="150.00000000"/>      <name>hei_DT1_02_Build2_LOD</name>      <textureDictionary>dt1_02_lod</textureDictionary>      <clipDictionary/>      <drawableDictionary>hei_dt1_02_slod_children</drawableDictionary>      <physicsDictionary/>      <assetType>ASSET_TYPE_DRAWABLEDICTIONARY</assetType>      <assetName>hei_DT1_02_Build2_LOD</assetName>      <extensions/>    </Item>

The model defined in a .ytyp file is called an archetype. The coordinates given in the *.ytyp file for a model archetype are relative to the model ( center, bbmin, bbmax etc).

 

 

To load an item on the map, the game looks at the *.ymap file for the area and defines an entity, The entity uses information from *.ytyp files (pulling texture, dimentionality info etc) to spawn the model, where the *.ymap file specifies.

 

Correct?

 

Also are ymap "extent" coordinates rectangular tiles on the world?

Edited by foxtail
Link to comment
Share on other sites

Yes, but it's not everything. _manifest.ymf is telling to the game, where to find archetypes which are in ymap file. This is a part of _manifest.ymf file.

 

 

<Item>      <imapName>hw1_07_long_0</imapName>      <manifestFlags/>      <itypDepArray>        <Item>hollywood_metadata_003_strm</Item>        <Item>v_coin_op</Item>        <Item>v_palm</Item>        <Item>v_seating_tables</Item>        <Item>v_sports</Item>        <Item>v_utility</Item>      </itypDepArray>    </Item>
Edited by _CP_

HHnErXC.png


Link to comment
Share on other sites

A full example:

Player is at area inside the extents of a ymap tile.

 

Game pulls hei_dt1_02.ymap file:

<CMapData>  <name>hei_dt1_02</name>  <parent>hei_dt1_lod</parent>  <flags value="2"/>  <contentFlags value="18"/>  <streamingExtentsMin x="-1010.14500000" y="-1570.88100000" z="-732.95460000"/>  <streamingExtentsMax x="828.79780000" y="38.28485000" z="879.94240000"/>  <entitiesExtentsMin x="-234.96730000" y="-691.58610000" z="26.07112000"/>  <entitiesExtentsMax x="-75.71102000" y="-539.29720000" z="211.94700000"/><entities><Item type="CEntityDef">      <archetypeName>hei_DT1_02_Build2_LOD</archetypeName>      <flags value="1572864"/>      <guid value="1984505424"/>      <position x="-148.40620000" y="-601.07170000" z="134.30780000"/>      <rotation x="0.00000000" y="0.00000000" z="0.00000000" w="1.00000000"/>      <scaleXY value="1.00000000"/>      <scaleZ value="1.00000000"/>      <parentIndex value="1"/>      <lodDist value="300.00000000"/>      <childLodDist value="180.00000000"/>      <lodLevel>LODTYPES_DEPTH_LOD</lodLevel>      <numChildren value="1"/>      <priorityLevel>PRI_REQUIRED</priorityLevel>      <extensions/>      <ambientOcclusionMultiplier value="255"/>      <artificialAmbientOcclusion value="255"/>      <tintValue value="0"/>    </Item>

Sees that it needs an archetype of name "hei_DT1_02_Build2_LOD".

 

Goes to _manifest.ymf and sees:

<Item>      <imapName>hei_dt1_02</imapName>      <manifestFlags/>      <itypDepArray>        <Item>downtown_01_metadata_005</Item>        <Item>hei_downtown_01_metadata_001</Item>      </itypDepArray>    </Item>

Then goes to hei_downtown_01_metadata_001.ytyp

<CMapTypes>  <extensions/>  <archetypes>    <Item type="CBaseArchetypeDef">      <lodDist value="300.00000000"/>      <flags value="0"/>      <specialAttribute value="0"/>      <bbMin x="-82.43872000" y="-90.51441000" z="-104.07640000"/>      <bbMax x="60.86279000" y="56.73477000" z="75.92849000"/>      <bsCentre x="-10.78796000" y="-16.88982000" z="-14.07395000"/>      <bsRadius value="136.58280000"/>      <hdTextureDist value="150.00000000"/>      <name>hei_DT1_02_Build2_LOD</name>      <textureDictionary>dt1_02_lod</textureDictionary>      <clipDictionary/>      <drawableDictionary>hei_dt1_02_slod_children</drawableDictionary>      <physicsDictionary/>      <assetType>ASSET_TYPE_DRAWABLEDICTIONARY</assetType>      <assetName>hei_DT1_02_Build2_LOD</assetName>      <extensions/>    </Item>

and pulls the assetName hei_DT1_02_Build2_LOD archetype which includes all drawing info.

 

Then proceeds to draw it on the tile.

 

The manifest was missing from my understanding of the process.

 

Do we know how the extents work in the .ymap file? I mean:

<streamingExtentsMin x="-1010.14500000" y="-1570.88100000" z="-732.95460000"/><streamingExtentsMax x="828.79780000" y="38.28485000" z="879.94240000"/><entitiesExtentsMin x="-234.96730000" y="-691.58610000" z="26.07112000"/><entitiesExtentsMax x="-75.71102000" y="-539.29720000" z="211.94700000"/>

Also thank you so much for responding, this helps me alot :)

Edited by foxtail
Link to comment
Share on other sites

The entitiesExtents defines a close-fitting bounding box around all the entities that are contained within that ymap, calculated from the bounding boxes of all the entities themselves.
The streamingExtents is a bigger box, which fits around all the entities plus their lodDist values. Since an entity will be visible when the camera is closer than the lodDist, this means that the streamingExtents is the bounding box where any entity in the ymap could be visible. If the camera is outside the range of the streamingExtents, the ymap and its contents do not need to be loaded by the engine.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.