How to generate a random map for horizontal clearance games

problem description

suppose the map in a 2D game is made up of floors, monsters, chests, etc.
how to generate maps randomly.

my current idea is:
characters generate a fixed-length random map for each sprint. For random maps, first generate a map randomly according to a certain distance and height difference.
then divide each randomly generated parcel into several parts, and then randomly place monsters or treasure boxes on any part of any parcel.
but this method has obvious drawbacks. For placed monsters and treasure boxes, if they are on the same parcel, then their spacing is the same.
in addition, even if the parcel is divided into several unequal parts, or the position of the monster and treasure chest is slightly moved, the effect is very poor, and the size of the monster will become larger later in the game.

clipboard.png

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b360c0-2b75d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b360c0-2b75d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?