Urban Modular Simulator - Living City Build Jam


Code & Design by KarstSkarn#7993
Art & Design JusGoat
Demo Video: https://www.youtube.com/watch?v=l0–uIrUIV4
Showcase Link: https://launch.crayta.com/play/n53q7p2n
Blueprint: “Urban Modular Simulator Blueprint


Urban Modular Simulator is a package capable of simulating cities in a pseudo-realistic way taking into account their growth and services.

This package is on the fine line between art, decoration and functionality. Since by itself it is able to generate cities in a coherent way using preset modules and randomly assigned decorations.

It also offers an ideal base for the creation of a tycoon, certain RPGs, colony simulators and unleash your creativity as a creator! Although we had a great time parkouring from building to building.

Due to the nature and timing of this Jam, for now the package only provides two types of services necessary for the proper growth of the city: electricity and green areas. Although it is easily expandable using these two included services as examples.

We are highly inclined in the future to expand both the number of services, the realism of these services and the complexity they entail.

The city by default will generate houses that need services to sustain themselves; otherwise they will be abandoned! Likewise, if the lack of services is very noticeable, growth will stop in the areas where they are scarce.

Note: By default the “debug” option is activated in the main script, which forces the appearance of essential services at the initial moment (it makes a house, a power source and a green zone appear). After this point the behavior is exactly the same as without this option.


Quick installation guide

To run the package for the first time after installation there is only one single step to complete.

All templates including all those named “Modular…” and “MasterMacroTile_Template” must have the assigned in the basic panel slot.

This entity is “_UMSMainScriptHolderMachine” and you will find it in the list of templates. You must put it anywhere in the world and then as said above assign it manually in all templates that have a “MasterEntity” slot.

The property slot that must be assigned

Alternatively if you have decided that you want to use this package you can make use of the blueprint where this assignment is already done.


How it works

This package distributes and classifies the basic elements of a city as follows:

A grid formed by “macrotiles” that would come to be the blocks that make up a city. In these blocks are built the modules that represent each house or service.

Entities distribution in the Urban Grid

Depending on the configuration set in each type of module it will provide or consume the services.

The blocks (macrotiles) that have a good supply of services will grow until they reach the maximum number of floors possible (determined in an option of the main script). In the same way, when having 30% of slots occupied, it is possible to create a block adjacent to them and thus progressively expand the city.

But be careful! Rapid and excessive growth can lead to a shortage of services in the area! Modules catalogued as habitations that lack services in a noticeable way will be abandoned! If they remain in this state for too long they will be dismantled. Otherwise, if services are reestablished, these modules will be inhabited again.


The modules that are abandoned are shown with chains in a cross shape!

The templates that make up the package are easily editable to your liking. Likewise, they don’t have to be containers, you could assign anything you want!

To change the balance of services is very easy too! All modules have editable properties where you can change how much they consume or generate!

Alternatively you can edit the code to create more services or change how they affect the growth of your city! This is a great platform for creating tycoons and other genres!


Scripts properties

There are only 3 scripts that control all the functions of the package; although the package includes other scripts these mostly deal with aesthetic issues and do not influence the functionality of the package.

urbanModularSimulatorControllerScript

General Options

  • Verbose: Enables or disables the console output for most scripts of this package.
  • Debug: Enables or disables the functions intended for showcasing and testing purposes.

Main Options

  • Max Floors: Sets the maximum height (In modules) that the blocks (macrotiles) will be able to reach.
  • Start Point: Sets the position where the simulation will start.
  • Simulation Speed: Sets every how many seconds a new block (macrotile) will be processed.
  • Urban Grid Size: Sets the full size of the urban grid. Each position is a possible block (macrotile).
  • Tile Height: Sets the height of the modules (Currently the same height of a container mesh) to be able to stack it properly when a new module is spawned.
  • Macro Tiles Distance: Sets the distance between blocks (macrotiles). This is what creates the illusion of streets.
  • Safe Spawn Position: In order to avoid certain render glitches some entities are spawned really far away and then moved to their goal position. This position is that place. You must set an out of view position.

Package Mechanics

  • Utility Distance: Sets the maximum radius at which the modules (houses, electrical sources, leisures…) will be able to check for services. E.g. The radius at which one house will be able to look for an electrical source.
  • Green Areas: Enables or disables completely the green areas mechanic.
  • Electricity: Enables or disables completely the electricity mechanic.

Note: Be aware that if you disable all the services options there won’t be any way to track if the services are positive or not so it won’t grow.

Assets List

  • Macro Tile Template: Sets the template that will be used as block (macrotile).
  • Asset Type List: This is the full list of available modules.
  • Abandoned Housing Template: Sets the template that will be used in abandoned housings.

Housing Setting Sliders

  • Start Housing List: Sets at which point of the Asset Type List start the templates that will be used as housing.
  • End Housing List: Sets at which point of the Asset Type List ends the templates that will be used as housing.

Electrical Setting Sliders

  • Start Electrical List: Sets at which point of the Asset Type List start the templates that will be used as electrical sources.
  • End Electrical List: Sets at which point of the Asset Type List ends the templates that will be used as electrical sources.

Green Areas Setting Sliders

  • Start Green Areas List: Sets at which point of the Asset Type List start the templates that will be used as green areas.
  • End Green Areas List: Sets at which point of the Asset Type List ends the templates that will be used as green areas.

Advanced Settings

  • Entities Cap: Sets at which number of entities the macro tiles will stop growing.

macroTileControllerScript

General Options

  • Master Entity: Sets the entity where the main script is placed. This must remain constant along the game.
  • Structure Gen Template: Sets the template that will be used as animation when a module is spawned.
  • Structure End Template: Sets the template that will be used as animation when a module is dismantled.

modularStructureControllerScript

General Options

  • Is Stackable: If enabled this module will allow other modules on its roof.

Type Properties

  • Is Housing: If this is enabled it will behave as a housing unit.
  • Is Electrical Source: If this is enabled it will behave as an electrical source.
    Electrical Income: If the option above is enabled this determines how many electricity will generate this module.
  • Is Green Area Source: If this is enabled it will behave as a green area.
  • Green Area Income: If the option above is enabled this determines how many green area income will generate this module.

If you want help editing the code for your projects, find a bug or want us to implement new mechanics don’t hesitate to contact us!

1 Like