Change to better support multiple up/downs?
Posted: Fri Jul 30, 2010 12:20 am
First off, the more I get into the T-Engine and ToME code the more I appreciate the great work you have done DG. Thanks!
I am working on the first chapter of my Viral Resistance RL (zombie-fallout-ish) and it is going to be set in a military hospital. Modern buildings have multiple staircases throughout the building, and trying to add multiple up/downs and have them link correctly between levels brought me to the following observation: the level.ups and level.downs only contain one position each, and adding additional stairs is not directly supported. This can be traced to engine.Generator.generate, which has the following return signature: startx, starty, endx, endy, spots. These are taken by engine.Zone and dropped into level.ups, level.downs, and level.spots. Is there any interest in having engine.Generator.generate directly return a table ups, a table downs, and a table spots?
Maybe engine.generators.Static could have two additional functions addUp and addDown to populate the tables and also accept the index of the corresponding exit on the connected level? I can try to submit a patch updating the example module first to test it out if you want, and if you like it port ToME over as well.
I believe this would help generalize the API to handle multiple up/downs. Of course, I could just be overlooking the obvious way to handle this.
I am working on the first chapter of my Viral Resistance RL (zombie-fallout-ish) and it is going to be set in a military hospital. Modern buildings have multiple staircases throughout the building, and trying to add multiple up/downs and have them link correctly between levels brought me to the following observation: the level.ups and level.downs only contain one position each, and adding additional stairs is not directly supported. This can be traced to engine.Generator.generate, which has the following return signature: startx, starty, endx, endy, spots. These are taken by engine.Zone and dropped into level.ups, level.downs, and level.spots. Is there any interest in having engine.Generator.generate directly return a table ups, a table downs, and a table spots?
Maybe engine.generators.Static could have two additional functions addUp and addDown to populate the tables and also accept the index of the corresponding exit on the connected level? I can try to submit a patch updating the example module first to test it out if you want, and if you like it port ToME over as well.
I believe this would help generalize the API to handle multiple up/downs. Of course, I could just be overlooking the obvious way to handle this.
