Procedural Generation

VirtualHome has procedural generation capabilities to create new environments on demand during runtime. This implementation of procedural generation in VirtualHome supports the generation of new layouts and objects, but also allows the user to use a seed to generate any environment they want and share it with others. Addtional parameters such as altering the amount of specfic rooms generated inside a environment can also be used.

You can use procedural generation by using unity_simulator.UnityCommunication.procedural_generation() function, and can specify additional parameters such as the desired seed_id(). After a environment is created through the procedural generation process, the interaction with the environment becomes the same as the custom designed environments where all the available interactive features in VirtualHome are supported. Essentially procedural_generation() replaces the comm.reset() function.

# This is the basic function with the default paramameters that you call to activate procedural generation.


The following example shows how one could use procedural generation:

# Start procedural generation and returns a Boolean flag with the seed_id used during generation

# When you want to reload the same procedurally generated environment, call the same function but with the same seed_id.

Below is a list which provides more information for the parameters available for procedural generation.


The seed integer value used to generate the same environment which was created by procedural generation. Allowing you to rebuild the environment and share it with others.


integer or random


  • communication with the unity executable file is active

  • A new environment will be generated

  • comm.procedural_generation(seed_id=random)

Please note, the seed_id provided by the procedural_generation() function only works interchangebly with builds using the same version number! A important thing to keep in mind is that the parameter provided to the procedural_generation() function will need to be logically possible to generate or after a predefined number of attempts it will return False with a error message.


More features such as finer control over procedural generation is in the works.