Dynamic City Generator

If you liked this item, please rate it up on Steam Workshop page.

Author: Condasoft

Last revision: 28 Apr at 00:09 UTC

File size: 32.85 KB

On Steam Workshop

Description:

Dynamic City Generator is an Arma 3 composition script that procedurally creates a dense city around a marker placed in the editor. It is designed for quick mission building, urban combat scenarios, survival missions, Zeus setups, and custom environments.

This is a composition script. To use it, subscribe to the Workshop item and place it through Eden Editor’s custom composition feature.

The generator supports two usage modes. You can run it directly in Eden Editor through the debug console to create a city as an editable mission template, or you can place the composition normally and let it generate the city during mission runtime. All code is included in the trigger fields.

The script is easy to customize. You can change the buildings, fences, walls, lamps, vegetation, roads, and other objects by replacing the classnames with similar assets. It should work with most normal-sized Arma 3 buildings and props.

If you want to use different walls or buildings roads or street lights just change the classnames in the script works well with frozen vr and deserted vr since those maps are essentially blank canvases which come with ground textures and winter/desert skyboxes.

Frozen:
https://steamcommunity.com/sharedfiles/filedetails/?id=1977158707
Deserted:
https://steamcommunity.com/sharedfiles/filedetails/?id=1946431719

For zeus wanting to use compositon scripts during live play:
https://steamcommunity.com/sharedfiles/filedetails/?id=3052893294

You are free to use, modify, and distribute this script for personal or non-commercial projects. However, if you modify, republish, or redistribute this script, or any part of it, you must include proper credit to me as the original creator/contributor.

You may not use this script, or any part of it, in monetized, commercial, or paid content without contacting me first and receiving permission.

Credit must remain visible in the script files, documentation, or project page where the modified version is published.

————————————–configurable options——————— _maxBlocks = 250; controls how many city blocks are generated before the script stops. Increase this for a larger city, or decrease it for a smaller town. _markerName = "city_center"; defines the marker used as the center point for city generation. Place a marker with this name in Eden, or change the name here to use a different marker. _blockSize = 42; controls the size of each city block. Increasing it creates larger blocks with more space between roads and fences, while decreasing it makes the city tighter and denser. _buildingChance = 1; controls the chance that a normal block receives a building. 1 means every eligible block gets a building, while 0.5 would mean roughly half of them do. _parkChance = 0.18; controls how often blocks become parks instead of normal building blocks. Increase this for a greener city, or decrease it for a denser urban layout. _parkTreeCount = [10, 18, 28]; controls the random number of trees placed in each park. The middle number is the average-style value, while the first and last values define the lower and upper range. _parkPlantCount = [18, 30, 48]; controls how many bushes, plants, and small vegetation objects are placed in each park. _parkRockCount = [2, 5, 9]; controls how many rocks are placed in each park. Increase this for rougher natural areas, or reduce it for cleaner city parks. _roadClass = ""; controls what object is used for road visuals. Leaving it blank disables physical road objects while still keeping the city grid layout. Add a classname such as "Land_DirtPatch_01_6x8_F" if you want visible road patches again. _roadPatchSpacing = 4; controls spacing between road patch objects if _roadClass is used. Smaller values make roads more continuous but create more objects. Larger values improve performance but may leave gaps. _squareClass = "Land_CobblestoneSquare_01_32m_F"; defines the cobblestone square object used in some blocks. _squareChance = 0.22; controls how often cobblestone squares appear at the center of blocks. Increase this for more paved plazas, or reduce it for fewer. _fenceClasses = […]; controls which wall and fence objects are used around blocks. You can add or remove classnames to change the city style. _fenceInsetFromRoad = 5; controls how far inside the block the fences are placed from the road edge. Higher values move fences closer to the center, while lower values place them closer to roads. _fenceGapSize = 4; controls the intended entrance gap size in fences and walls. The script always removes at least one fence segment, so longer wall pieces may still create wider entrances. _lampClass = "Land_LampShabby_F"; defines which lamp object is used. Replace this classname to use a different lamp post. _lampChance = 0.35; controls how often lamps appear on normal city blocks. Increase it for more street lighting, or decrease it for fewer lamps. _lampOffset = 5; controls how far lamps are placed from the block corners. Higher values move them inward, lower values move them closer to the road edge. _treeClasses = […]; defines which tree objects can be used in park blocks. Add or remove tree classnames to customize the vegetation. _plantClasses = […]; defines which bushes, flowers, reeds, and small plants can appear in parks. _rockClasses = […]; defines which rocks can appear inside parks. _rawBuildingData = […]; defines the building pool used by the generator. Each entry contains a building classname and an approximate radius value. You can replace or add normal-sized buildings here to customize the city. _spawnedRoadEdges = createHashMap; prevents duplicate road edges from being spawned between neighboring blocks. This improves performance and keeps shared roads from stacking. _doorCache = createHashMap; stores whether each building type has doors, so the script does not repeatedly scan the config for the same classname. _forceSimple = _simple || {_type in ["fence", "road", "square", "vegetation", "simpleBuilding"]}; controls which object types are forced to use simple-object behavior. Roads, fences, squares, vegetation, and buildings without doors are treated as lightweight objects for performance. _spiralX, _spiralY, _spiralDir, _spiralLegLength, _spiralLegProgress, and _spiralLegsDone control the outward spiral generation pattern. These usually should not be changed unless you want to alter how the city expands from the center.