G
GreyVessel
Guest
Hello,
I'm working on a game that will use a combination of procedural generation and prebuilt rooms to create its levels. Currently, the layout of each prebuilt room is specified via a character string (in which each character represents a tile, object, NPC, etc.). This method has the advantage of simplicity, but has a few downsides: the structure of the room is contained in a single unbroken character string and so is difficult to visualize, which can present problems when there are dozens or even hundreds of room templates to keep track of, and the use of unique characters to specify different entities in the game will become more difficult as the total number of entities grows (e.g. if you're using "s" for a skeleton NPC, what do you do if you have 5 different types of skeletons?). Because of this, I've been looking for different ways to create and spawn prebuilt rooms into the game. I've considered creating room templates with sprites and using draw_getpixel to parse the images, but the function is very slow and this method still runs into the problem of the templates being too abstract. What I was interested in doing was somehow creating all the templates in a GMS2 room, and then loading or copying them into the generated level. I'm not sure if this is possible, but I'd like to know if you have any ideas.
Thanks in advance.
I'm working on a game that will use a combination of procedural generation and prebuilt rooms to create its levels. Currently, the layout of each prebuilt room is specified via a character string (in which each character represents a tile, object, NPC, etc.). This method has the advantage of simplicity, but has a few downsides: the structure of the room is contained in a single unbroken character string and so is difficult to visualize, which can present problems when there are dozens or even hundreds of room templates to keep track of, and the use of unique characters to specify different entities in the game will become more difficult as the total number of entities grows (e.g. if you're using "s" for a skeleton NPC, what do you do if you have 5 different types of skeletons?). Because of this, I've been looking for different ways to create and spawn prebuilt rooms into the game. I've considered creating room templates with sprites and using draw_getpixel to parse the images, but the function is very slow and this method still runs into the problem of the templates being too abstract. What I was interested in doing was somehow creating all the templates in a GMS2 room, and then loading or copying them into the generated level. I'm not sure if this is possible, but I'd like to know if you have any ideas.
Thanks in advance.