Onarr Posted June 14, 2019 Share Posted June 14, 2019 Hi, lately I got ton of fun from making prefabs. Iam a bit sad, that once somebody plays through it, the value of it goes down. I would really like it, if Fun Pimps would introduce system, where you can set up more randomness in the PoI, similar to how it is done in Left for dead. Set up different routes, loot on different places, different entrances. For now the sleepers can be spawned a bit randomly, which is great. How I imagine it: Ability to set roadblocks and openings, that would spawn randomly. For example you have house, and there is preset path, through which you can go. However when creating PoI, you can create different routes by implementing closed doors, barricades, destroyed walls and floors. For one route you will set which entrances are unlocked and which are blocked. With that, you can have several kinds of paths, and you never know, which one it is when entering PoI, because it will be always different. Once you can start on the roof, other time in the basement. I would really love this especially in maze like PoI, where everytime you enter, the path is different. I believe this would increase replayability a lot. Loot goes with that, it would be random, if the house belonged to different kinds of people - scientist (medicine), gun nut (guns), normal folk (food), engineer (tools), nerd (books), grease monkey (car parts). Also it would provide different dangers - mines (gun nut), dogs (normal folk), electric traps (engineer), gas barrels, that can be destroyed by zombie (grease monkey), higher chance of higher lvl zombies (scientist), wild card (nerd). This would be appliable to more than just house PoIs, but for shops, towers, factories etc. Basis would be a floorplan, that can have several possible routes. Then, it would decide on type of loot that spawns inside, and unique dangers that spawns inside. It could go even further - the rooms itself could be random - library, bedroom, living room, laundry room etc. for example there would be larger block, that would be interchangeble depending on type of room lets say 2x2 - bed ( bedroom), benchpress ( gym), desk and chair (study), two cabinets and stools (kitchen), two washing machines (laundry room), cement bags (building site), workbench (workshop) etc. Or it could work differently - instead there would be several possible layout for such room. Link to comment Share on other sites More sharing options...
Dimpy Posted June 14, 2019 Share Posted June 14, 2019 It's pretty limited functionality, but helper blocks can add a little bit of randomization. Link to comment Share on other sites More sharing options...
Beelzybub Posted June 14, 2019 Share Posted June 14, 2019 I like this idea, but no clue how to make it work. Maybe if you had a number of versions of the same poi, each with a different path. Then, when the poi is reset accepting the quest, it could randomly select one. That's not something a modder could do though (I don't think). It'd have to be put into the game by a dev. Link to comment Share on other sites More sharing options...
Onarr Posted June 14, 2019 Author Share Posted June 14, 2019 My idea is that first you create a rough scetch of PoI. Say we are making a house. You create a floorplan with possible connections to other rooms. Every room is therefore accesible in three different ways: 1. another room resides next to the first one 2. another room is connected via hallway 3. another room is connected via outside pathway - roof, garden etc. First will be decided if you go top down or bottom up, this will spawn an entrance. For example -basement entrance via: broken piping, storm cellar, trap pit -floor lvl entrance: destroyed wall, doorway -top entrance: jumping through roof, scaffolding Then you randomly select entry point and exit point of the lvl. Next step is that you select order in which to clear rooms. The pathway between those will remain open and every other will be blocked. This opening/closing would be done via helper block: -opened/closed door -intact/broken wall -intact/broken window -barricaded/unbaricaded hallway entry point to next lvl would always be next to exit point from previou lvl. this logic would be applied for every level of PoI, with last lvl instead of exit point, you will have loot room. For this you would need to be able to mark rooms, attach them with helper blocks and other rooms Link to comment Share on other sites More sharing options...
Damocles Posted June 16, 2019 Share Posted June 16, 2019 Dynamic POIs could be realized already in A17, but that would require some effort by modders to create "modules" of a POI. For a simple example: splitting a House POI into 4 horizontal "chunks", that each have a slight variation. And then just spawning in a random combination in the game (to the prefabs.xml of the world-files). In one variation it could have a door open, in another one blocked by junk, or a wall town down... So the output looks something like this: (house_old_bungalow_01 having four 20x10 slices) <decoration type="model" name="house_old_bungalow_01_slice1_v3" position="1566,58,563" rotation="0" /> <decoration type="model" name="house_old_bungalow_01_slice2_v1" position="1586,58,563" rotation="0" /> <decoration type="model" name="house_old_bungalow_01_slice3_v2" position="1566,58,510" rotation="0" /> <decoration type="model" name="house_old_bungalow_01_slice4_v2" position="1586,58,510" rotation="0" /> The automatic placement into a new map is the easy part (I could cover that in NitroGen). But cutting up the POIs and creating variations is quite some effort. Link to comment Share on other sites More sharing options...
Onarr Posted June 16, 2019 Author Share Posted June 16, 2019 Dynamic POIs could be realized already in A17, but that would require some effort by modders to create "modules" of a POI. For a simple example: splitting a House POI into 4 horizontal "chunks", that each have a slight variation. And then just spawning in a random combination in the game (to the prefabs.xml of the world-files). In one variation it could have a door open, in another one blocked by junk, or a wall town down... So the output looks something like this: (house_old_bungalow_01 having four 20x10 slices) <decoration type="model" name="house_old_bungalow_01_slice1_v3" position="1566,58,563" rotation="0" /> <decoration type="model" name="house_old_bungalow_01_slice2_v1" position="1586,58,563" rotation="0" /> <decoration type="model" name="house_old_bungalow_01_slice3_v2" position="1566,58,510" rotation="0" /> <decoration type="model" name="house_old_bungalow_01_slice4_v2" position="1586,58,510" rotation="0" /> The automatic placement into a new map is the easy part (I could cover that in NitroGen). But cutting up the POIs and creating variations is quite some effort. That sounds like a good idea. However I wonder how to make it work, so you always have one viable path through. Maybe you could make logic with say six rooms in lt ______ |A|B|C| ===== |D|E|F| say generator would decide on order: A, F, D, C, B, E. That would mean, you would need hallway to get from A to F. Outside path to get from F to D, another outside path to get from D to C, doors/hole to get from C to B and then you are stuck, because you do not have another way to get to E, because you used the hallway to get from A to F. Hmm, there would need to be some logic that would solve this. Perhaps first deciding on which two room will be connected by hallway and roof, and then connecting them. Damn if you could spawn according to a script... damn it could actually work! I got to prepare the prefabs Only thing Iam afraid of how much memory would this consume... or would it be done during generation? Link to comment Share on other sites More sharing options...
Damocles Posted June 16, 2019 Share Posted June 16, 2019 That sounds like a good idea. However I wonder how to make it work, so you always have one viable path through. Maybe you could make logic with say six rooms in lt ______ |A|B|C| ===== |D|E|F| say generator would decide on order: A, F, D, C, B, E. That would mean, you would need hallway to get from A to F. Outside path to get from F to D, another outside path to get from D to C, doors/hole to get from C to B and then you are stuck, because you do not have another way to get to E, because you used the hallway to get from A to F. Hmm, there would need to be some logic that would solve this. Perhaps first deciding on which two room will be connected by hallway and roof, and then connecting them. Damn if you could spawn according to a script... damn it could actually work! I got to prepare the prefabs Only thing Iam afraid of how much memory would this consume... or would it be done during generation? The ingame performance should be the same, it only depend on the total number of blocks in the final POI. Generating that into a world file is also quick. Its mostly the effort to create the prefabs that fit together in a modular fashion, and some definition about the rules they fit. Link to comment Share on other sites More sharing options...
Onarr Posted June 17, 2019 Author Share Posted June 17, 2019 https://ibb.co/51tysnq EDIT: no idea why, but the picture was shown really tiny Ok, so I created a simple prefab to test my idea a little, and instead of making different variations of chunks of prefabs, I built the prefab with every room isolated an instead for every obstacle, where would be an open alternative, that would spawn in, if the algorhytm connect those two rooms. The problem I see now however, is getting exact x,y,z and rotation data. After that I could program small script that would randomize the path. I was also thinking about the script: 1.Select starting room and loot room. Spawn loot in the loot room. 2.Connect current room with neighbouring room (unless it is loot room). This cycle will continue, until you run out of neghbouring rooms. 3.If no path is available, connect room with random unused room (that is not loot room) via garden or hallway. If both have been already used, restart cycle. 4. Same as in n2 applies, until number of rooms is zero - you reached loot room. 5. If anytime the script cannot continue, start over. So say we select room 1 as starting room and room 3 as loot room. Room 1 i connected via garden with room 6. -> open r1-garden and r6-garden Room 6 is connected with room 3. -> open r3-r6 Room3 is connected with room 2. -> open r2-r3 Room 2 is connected with room 5 via hallway. -> open r2-hallway and r5-hallway Room 5 is connected with room 3. -> open r3-r5 end script rx-ry would have specified small prefab or block assigned that would open the way - broken window, opened doors, destroyed wall, torn down barricade. Link to comment Share on other sites More sharing options...
Onarr Posted June 18, 2019 Author Share Posted June 18, 2019 I created wireframe for how the UI might look like: https://ibb.co/ZmTHsGN So i understand what the script needs to spit out is prefabs coordinates like you mentioned? For example: <decoration type="model" name="door_opened" position="1566,58,563" rotation="0" /> <decoration type="model" name="hole_in_wall" position="1586,58,563" rotation="0" /> <decoration type="model" name="broken_window_01" position="1566,58,510" rotation="0" /> <decoration type="model" name="empty space" position="1586,58,510" rotation="0" /> Link to comment Share on other sites More sharing options...
Damocles Posted June 18, 2019 Share Posted June 18, 2019 The final output are those decoration xml entries that have to be generated. The initial data are the prefabs, that serve as "puzzle blocks", and a descriptor file for it (x,y,z dimensions, y offest, "grid center point" for placing it on a final regular grid when connecting with others). You have already placed some ideas about the rules how they connect. There then needs to be some kind of script that defines connection rules between those blocks, and what the whole POI requires. Lets say we have the blocks A,B,C,D,E,F we could define the rules how they connect as A,C,F connects east to B,D,F B,C,E connect south to A,F A requires connection in north,east C requires connection in north,east F requires connection in west,east,south or something like that. Then a procedural generator could randomly connect all blocks via the valid rules from the script, and check that everything is connected (no missing connections) And assemble an enclosed valid random POI. The final POI could still be rotated to 4 directions. ---- There can be different connections (large doorway, small corridor, bridge) etc. That probably can be defined per POI template. ---------- Theoretically this allows many POIs to be generated randomly that even change their outer shape. --------------- The whole connection logic and generation should be tested out in 2D (in an image editor for example) to nail down the logic, before putting effort into creating the actual POI assets. Spawning the prefabs ontop of each other probably does not work, as the game tries to somhow pull up the terrain. Not sure if that would lead to bugs (else multlevel building would be possible) Link to comment Share on other sites More sharing options...
Onarr Posted June 19, 2019 Author Share Posted June 19, 2019 The final output are those decoration xml entries that have to be generated. The initial data are the prefabs, that serve as "puzzle blocks", and a descriptor file for it (x,y,z dimensions, y offest, "grid center point" for placing it on a final regular grid when connecting with others). You have already placed some ideas about the rules how they connect. There then needs to be some kind of script that defines connection rules between those blocks, and what the whole POI requires. Lets say we have the blocks A,B,C,D,E,F we could define the rules how they connect as A,C,F connects east to B,D,F B,C,E connect south to A,F A requires connection in north,east C requires connection in north,east F requires connection in west,east,south or something like that. Then a procedural generator could randomly connect all blocks via the valid rules from the script, and check that everything is connected (no missing connections) And assemble an enclosed valid random POI. The final POI could still be rotated to 4 directions. ---- There can be different connections (large doorway, small corridor, bridge) etc. That probably can be defined per POI template. ---------- Theoretically this allows many POIs to be generated randomly that even change their outer shape. --------------- The whole connection logic and generation should be tested out in 2D (in an image editor for example) to nail down the logic, before putting effort into creating the actual POI assets. Spawning the prefabs ontop of each other probably does not work, as the game tries to somhow pull up the terrain. Not sure if that would lead to bugs (else multlevel building would be possible) Hmm, about those multilvl PoI, would it work, if you instead spawned top to bothom? Link to comment Share on other sites More sharing options...
Damocles Posted June 20, 2019 Share Posted June 20, 2019 Maybe, I have not tested that. You could test it out by creating two prefabs, where the top one does not have this dirt layer, and then editing the <decoration> tags in a map, placing them ontop of each other. (the second value in the position (y) determines the spawn-hight of POIs). If it has no side effects (terrain pulling up), then multilevel POIs should also be possible. Link to comment Share on other sites More sharing options...
Onarr Posted June 21, 2019 Author Share Posted June 21, 2019 Maybe, I have not tested that. You could test it out by creating two prefabs, where the top one does not have this dirt layer, and then editing the <decoration> tags in a map, placing them ontop of each other. (the second value in the position (y) determines the spawn-hight of POIs). If it has no side effects (terrain pulling up), then multilevel POIs should also be possible. https://ibb.co/n3npskn it works. Multi-level PoIs should be possible. Damn, the possibilities... now I just need to nail the logic Link to comment Share on other sites More sharing options...
Damocles Posted June 21, 2019 Share Posted June 21, 2019 Nice. Link to comment Share on other sites More sharing options...
Dimpy Posted June 21, 2019 Share Posted June 21, 2019 oooooh Link to comment Share on other sites More sharing options...
SylenThunder Posted June 22, 2019 Share Posted June 22, 2019 I recall Magoli working on something similar for the Compo-Pack with his segmented bio-shelters back around a15. I recall him running into an issue with getting it to work correctly with the RWG mixer, but I con't remember the issue. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.