modding:developerinfo:streets

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

modding:developerinfo:streets [2018/12/11 15:58]
tom
modding:developerinfo:streets [2019/03/19 10:18]
Line 1: Line 1:
-===== Streets ===== 
  
-==== Overview ==== 
- 
-A street configuration files specifies a set of parameters to define the properties, dimension, features and visuals of streets. They are stored in ''​.lua''​ files in the folder ''​res\config\street\''​. 
- 
-The file has the following format: 
- 
-<code lua> 
-function data() 
-return { 
- -- property and dimension definitions 
-        -- ... 
- 
- materials = { 
-                -- material definitions 
- }, 
- assets = {  
-                -- asset definitions 
- }, 
- bridges = { 
-                -- bridge definitions 
- }, 
-} 
-end 
-</​code>​ 
- 
-=== Properties and dimensions === 
- 
-Example: ​ 
- 
-<code lua> ​     
-function data() 
-return { 
- numLanes = 4,         -- number of lanes 
- streetWidth = 16.0,   -- [m] width of the street (without sidewalk) 
- sidewalkWidth = 4.0,  -- [m] width of the sidewalk 
- sidewalkHeight = .3,  -- [m] height of the sidewalk 
- yearFrom = 0,         -- available from [year] 
- yearTo = 1925,        -- available until [year] 
- upgrade = false, ​     -- only used in the upgrade tool [bool] 
- country = false, ​     -- disallow town buildings [bool] 
- speed = 60.0,         -- [km/h] maximum allowed drive speed 
- cost = 88.0,          -- building costs per meter 
-  
- -- material, assets, and bridge definitions... 
-} 
-</​code>​ 
- 
-=== Materials === 
- 
-The list of materials defines the materials used for various parts of the street. Every definition contains a link to a ''​.mtl''​ file and its size. 
- 
-<code lua> 
-materials = { 
- streetPaving = { 
- name = "​street/​country_new_medium_paving.mtl", ​    -- base path: /​res/​models/​material/​ 
- size = { 8.0, 8.0 }                                -- ??? 
- }, 
- 
- -- more material definitions... 
-}, 
-</​code>​ 
- 
-Available material definitions:​ (which are ALL optional) 
- 
-   * ''​streetPaving''​ 
-   * ''​streetBorder''​ 
-   * ''​streetLane''​ 
-   * ''​streetStripe''​ 
-   * ''​streetStripeMedian''​ 
-   * ''​streetTram''​ 
-   * ''​streetBus''​ 
-   * ''​crossingLane''​ 
-   * ''​crossingBus''​ 
-   * ''​crossingTram''​ 
-   * ''​crossingCrosswalk''​ 
-   * ''​sidewalkPaving''​ 
-   * ''​sidewalkLane''​ 
-   * ''​sidewalkBorderInnersize''​ 
-   * ''​sidewalkBorderOuter''​ 
-   * ''​sidewalkCurb''​ 
-   * ''​sidewalkWall''​ 
- 
-Street materials with non-zero polygon offset are rendered without depth buffer write. Depth write can be forced with forceDepthWrite flag. 
- 
-== Base Materials == 
- 
-Base materials - like paving and sidewalks - require the following parameters: 
- 
-<code lua> 
-return = { 
-    order = 0 
-    params = { 
-        -- more params 
-        polygon_offset = { 
-            factor = -2, 
-            units = -2, 
-        }, 
-    type = "​PHYS_TRANSPARENT_NRML_MAP"​ -- or non-transparent 
-} 
-</​code>​ 
- 
-== Overlay Materials == 
- 
-Overlay materials - like markings, borders, bus lanes or tram tracks - require the following parameters: 
- 
-<code lua> 
-return = { 
-    order = 1    -- for multiple overlays set order appropriately 
-    params = { 
-        -- more params 
-        alpha_test = { 
-            alphaThreshold = 0.5, 
-            preferAlphaToCoverage = false, 
-        }, 
-        polygon_offset = { 
-            factor = -3, 
-            units = -3, 
-        }, 
-    type = "​PHYS_TRANSPARENT_NRML_MAP" ​ 
-} 
-</​code>​ 
- 
-== Material types ==  
- 
-Material types are renderered in this order: 
- 
-<​code>​ 
-REFLECTIVE, 
-REFLECTIVE_NRML_MAP,​ 
-REFLECTIVE_OP,​ 
-REFLECTIVE_NRML_MAP_OP,​ 
-PHYSICAL, 
-PHYSICAL_OP,​ 
-PHYSICAL_NRML_MAP,​ 
-PHYSICAL_NRML_MAP_CBLEND,​ 
-PHYSICAL_NRML_MAP_CBLEND_DIRT,​ 
-PHYSICAL_NRML_MAP_OP,​ 
-PHYSICAL_NRML_MAP_CBLEND_OP,​ 
-PHYSICAL_NRML_MAP_UV1_AO,​ 
-PHYSICAL_NRML_MAP_OP_UV1_AO,​ 
-PHYSICAL_GLOSS_ONLY,​ 
-PHYSICAL_OP_GLOSS_ONLY,​ 
-SKINNING_TEXTURED,​ 
-SKINNING_PHYS_CBLEND4,​ 
-SKINNING_PHYS_NRML_MAP_CBLEND4,​ 
-PHYSICAL_ALPHA_NRML_MAP,​ 
-PHYSICAL_ALPHA_NRML_MAP_OP,​ 
-PHYS_TRANSPARENT,​ 
-PHYS_TRANSPARENT_NRML_MAP,​ 
-PHYS_TRANSPARENT_NRML_MAP_CBLEND_DIRT,​ 
-PHYSICAL_NRML_MAP_CBLEND_DIRT_LOGO,​ 
-TRANSPARENT,​ 
-TRANSPARENT_DETAIL,​ 
-TRANSPARENT_NRML_MAP,​ 
-TRANSPARENT_OP,​ 
-TRANSPARENT_NRML_MAP_OP,​ 
-EMISSIVE, 
-LEAF_CARD, 
-BILLBOARD, 
-BILLBOARD_MULTI 
-</​code>​ 
- 
-=== Assets === 
- 
-Contains a list of asset models, which will be placed along the street. 
- 
-<code lua> 
-assets = { 
- { 
- name = "​asset/​lamp_old.mdl", ​   ​ 
- offset = 5.0,                   -- [m] offset along the street 
- distance = 17.0,                -- [m] distance between assets 
- prob = 1.0,                     -- [0.0 - 1.0] placement probability 
- offsetOrth = 3.4,               -- [m] offset perpendicular to street direction 
- randRot = false, ​               -- random rotation [bool] 
- oneSideOnly = false, ​           -- place only on one side of the road [bool] 
- alignToElevation = false, ​      -- align to elevation [bool] 
- avoidFaceEdges = false, ​        -- asset not placed at street segment border (avoid... 
-                                                -- ...overlaps with bigger assets, i.e. tree beds) 
- placeOnBridge = true,           -- place on bridges [bool] 
- }, 
- 
- -- more asset definitions... 
-}, 
-</​code>​ 
- 
-=== Bridges === 
- 
-Contains a list of ''​.lua''​ files with available bridges. 
- 
-<code lua> 
-bridges = { 
- "​stone_old_medium.lua",​ 
- 
- -- more bridges... 
-}, 
-</​code>​ 
modding/developerinfo/streets.txt · Last modified: 2019/03/19 10:18 (external edit)