Devlog: Procedural Worlds

Another day, another devlog on GrugNet. After some painstaking logic issues and a lot of refactoring, I finally have the static world generation updated to v2. We base our worlds on world sizes, so in the v1 version a world with a size of 12 would take around two minutes to generate (which is not great when your trying to simulate a very large world). Now, in the newer version, a world size of 24 takes 25 seconds to create.

To break down how insane this is a bit more, a world size of 24 means 24*24 environments. Each environment then generates its own locations (a random amount from 1 location to 9 locations). Each location then generates its own places (random amount from 1-7). At a world size of 24 based on some random number generation, this comes out to 576 environments, 5,184 locations, and 20,659 places. Each environment also has a random set of producers you can gather resources from, like wheat or rocks or coal resources (1457). Random traders are also placed across the places (858). All of this is generated in twenty-five seconds. That’s about a second per generation time, meaning we can generate a 128 size world in ~2 minutes, or a 256 size world in ~4 minutes.

Since world generation is only actually done once at the start of the game, you could generate a enormous world if you allowed 20-30 mins of creation time. The greatest part is that hooking the AI into this is a drop-in replacement with no additional time, so we can create a procedural AI generated world in a very short amount of time. Technology is cool.

Once the game goes live, I also plan to develop a front-end site for users who don’t want to create their own clients that has a live-updating map, information, and a game dashboard allowing you to play the game. However, this will all be made from user accessible endpoints. This means that whatever is seen on the site can be created, customized, and iterated upon by players. Want a cool new control panel to control your tribe and build your civilization that is tailored exactly to you? You can build that! This is as much an exercise in creativity for our players as it is for us, which is really exciting. And since it’s all based on API endpoints, you can choose any language you want.

Next up is C&C systems and hooking the AI into currently established systems even more. More on that next time!


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

css.php