Creating a new room in GameMaker can be done both programmatically and through the GameMaker Studio IDE. Here is how to do it in both ways:
To create a room dynamically during runtime, you can use GML (GameMaker Language). However, there is no direct way to create an entirely new room from scratch during runtime. Instead, you can create multiple rooms in the IDE and then switch between them or modify existing rooms at runtime.
Here's an example of how to switch to another room:
And here's an example of how you can modify some aspects of a room at runtime (you can't create a completely new room this way, only alter properties of an existing one):
If you're looking to generate rooms with varying content, you may want to look into using data structures or arrays to hold room data and apply that data to an existing room when you need to 'create' a new one.