{"author_link":"\/users\/matterlinx","author_name":"MatterLinx","author_uid":"matterlinx","comments":[],"epoch":1683315392,"event":"LD53","format":"md","ldjam_node_id":369937,"likes":6,"metadata":{"p_key":"200981","p_author":"MatterLinx","p_authorkey":"1242787","p_urlkey":"433654","p_title":"Our \"Procedurally Generated\" Game World","p_cat":"LDJam ","p_event":"LD53","p_time":"1683315392","p_likes":"6","p_comments":"0","p_status":"WAYBACK","us_key":"1242787","us_name":"LDJam user 242787","us_username":"242787","event_start":"1682726400","event_key":"118","event_name":"Ludum Dare 53"},"node":{"_collation":{"body_sanitizer":"TextUtils::SanitizeHTML via existing importer","event":"LD53","removed_author":false},"_superparent":332127,"_trust":3,"author":242787,"body":"\nHello there! In this post, we\u2019re going to dive into how we used \"procedural generation\" to build out our game world. Procedural generation is an incredibly useful tool in game development, allowing us to generate large, intricate worlds with relatively little manual work. \n\n**If you haven\u2019t checked out our game yet, [give it a shot!](https:\/\/ldjam.com\/events\/ludum-dare\/53\/package-for-the-king)**\n\nFirst things first, we needed to generate a noise map to create the base for our game world. We used a tool to do this, and then drew the main path of the game on top of it. We never got to randomly generating the path, so it's not true procedural generation (hence the quotes). Here\u2019s what the texture looked like:\n\n![main_map.png](\/\/\/raw\/364\/b3\/z\/5b68e.png)\n\nWe actually ended up using only half of the generated map because we didn't have enough content to fill it out. We did, however, tint the texture to match the color of the ground and used it for shadows underneath the objects.\n\nNext up, we defined map objects to spawn within a specified grayscale value of the map texture. Each object had other parameters that allowed us to tune its placement. This gave us control over the placement of all the objects in our world. Additionally, map objects had variants to prevent uniformity. Here\u2019s what it looked like:\n\n![genobjs.png](\/\/\/raw\/364\/b3\/z\/5b690.png)\n\nWe had plans to use a secondary texture to spawn enemies of varying difficulty, but alas, we ran out of time. The resulting map was very large and couldn\u2019t be loaded all at once, so we had to build a chunk loading system. This allowed us to load in the objects one at a time every frame, which helped eliminate stuttering issues. Here\u2019s what the final result looked like slowed down:\n\n![GIF 5-5-2023 3-24-51 PM (1).gif](\/\/\/raw\/364\/b3\/z\/5b69a.gif)\n\nAll in all, procgen was an incredibly powerful tool that allowed us to create a fairly large world with minimal effort. We hope this post has given you some insight into how we did it, and maybe even inspired you to try it out yourself!","comments":0,"created":"2023-05-05T19:10:54Z","files":[],"files-timestamp":0,"id":369937,"love":6,"love-timestamp":"2023-05-05T20:46:00Z","meta":[],"modified":"2023-05-05T20:46:00Z","name":"Our \"Procedurally Generated\" Game World","node-timestamp":"2023-05-05T19:38:41Z","parent":353326,"parents":[1,5,9,332127,353326],"path":"\/events\/ludum-dare\/53\/package-for-the-king\/our-procedurally-generated-game-world","published":"2023-05-05T19:36:32Z","scope":"public","slug":"our-procedurally-generated-game-world","subsubtype":"","subtype":"","type":"post","version":1142728},"node_metadata":{"n_key":"369937","n_urlkey":"433654","n_parent":"353326","n_path":"\/events\/ludum-dare\/53\/package-for-the-king\/our-procedurally-generated-game-world","n_slug":"our-procedurally-generated-game-","n_type":"post","n_subtype":"","n_subsubtype":"","n_author":"242787","n_created":"1683313854","n_modified":"1683319560","n_version":"1142728","n_status":"WAYBACK"},"source_url":"https:\/\/ldjam.com\/events\/ludum-dare\/53\/package-for-the-king\/our-procedurally-generated-game-world","text":"\nHello there! In this post, we\u2019re going to dive into how we used \"procedural generation\" to build out our game world. Procedural generation is an incredibly useful tool in game development, allowing us to generate large, intricate worlds with relatively little manual work. \n\n**If you haven\u2019t checked out our game yet, [give it a shot!](https:\/\/ldjam.com\/events\/ludum-dare\/53\/package-for-the-king)**\n\nFirst things first, we needed to generate a noise map to create the base for our game world. We used a tool to do this, and then drew the main path of the game on top of it. We never got to randomly generating the path, so it's not true procedural generation (hence the quotes). Here\u2019s what the texture looked like:\n\n![main_map.png](\/\/\/raw\/364\/b3\/z\/5b68e.png)\n\nWe actually ended up using only half of the generated map because we didn't have enough content to fill it out. We did, however, tint the texture to match the color of the ground and used it for shadows underneath the objects.\n\nNext up, we defined map objects to spawn within a specified grayscale value of the map texture. Each object had other parameters that allowed us to tune its placement. This gave us control over the placement of all the objects in our world. Additionally, map objects had variants to prevent uniformity. Here\u2019s what it looked like:\n\n![genobjs.png](\/\/\/raw\/364\/b3\/z\/5b690.png)\n\nWe had plans to use a secondary texture to spawn enemies of varying difficulty, but alas, we ran out of time. The resulting map was very large and couldn\u2019t be loaded all at once, so we had to build a chunk loading system. This allowed us to load in the objects one at a time every frame, which helped eliminate stuttering issues. Here\u2019s what the final result looked like slowed down:\n\n![GIF 5-5-2023 3-24-51 PM (1).gif](\/\/\/raw\/364\/b3\/z\/5b69a.gif)\n\nAll in all, procgen was an incredibly powerful tool that allowed us to create a fairly large world with minimal effort. We hope this post has given you some insight into how we did it, and maybe even inspired you to try it out yourself!","title":"Our \"Procedurally Generated\" Game World","wayback_source":[]}