foxtail Posted May 31, 2017 Share Posted May 31, 2017 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 More sharing options...
_CP_ Posted May 31, 2017 Share Posted May 31, 2017 .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. foxtail 1 Link to comment Share on other sites More sharing options...
foxtail Posted May 31, 2017 Author Share Posted May 31, 2017 (edited) .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 May 31, 2017 by foxtail Link to comment Share on other sites More sharing options...
_CP_ Posted May 31, 2017 Share Posted May 31, 2017 (edited) 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 May 31, 2017 by _CP_ foxtail 1 Link to comment Share on other sites More sharing options...
foxtail Posted May 31, 2017 Author Share Posted May 31, 2017 (edited) 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 May 31, 2017 by foxtail Link to comment Share on other sites More sharing options...
dexyfex Posted June 1, 2017 Share Posted June 1, 2017 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. foxtail 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now