5/30/2023 0 Comments Endless dungeon close doors![]() ![]() We start by creating a simple Cell class. OOP stands for Object Orientated Programming and is a way of laying out code in a more friendly way whilst also keeping large projects organised. How tables work and a competent grasp of the Lua syntax Here’s a good thread from 2014 on the DevForums.Īll about Object Oriented Programming Community TutorialsĪn understanding of meta-tables (although the required code will be explained) We’ll be creating an object oriented approach to it. Find pathways from room to room using flood fill.Run a maze algorithm to fill spaces outside of rooms.Brute force set amounts of times to a max number of rooms. In this case, for our dungeon generation algorithm, we’re going to design using top-down design, when you design the ideas first then implement. Trustable (you can rely it gives accurate results).Implementable (to be able to actually script it).It’s important that the algorithm you design has to be (The 3 -ables) Knowing the battle is winning like 80% of it. If you don’t have an algorithm behind something, you can’t make it. You don’t even have to be a programmer to understand this. Of course there are many algorithms to generate mazes, but I’m going with a room-maze-corridor type of algorithm.Īrguably the most important part of this guide. Here’s something a random 2D dungeon would look like. We’re going to make a simple top-down 2D dungeon. So, if you don’t know what a dungeon is (why wouldn’t you?), it’s like a maze consisting of a number of rooms connected by corridors. We’ll be creating something like this on Roblox! ![]() This is the basis of the dungeon generation algorithm I decide to teach in this guide. IMO I find algorithms very aesthetically pleasing to make, especially non-pure, or random generation ones, because you can really get cool formations no one would ever think of. Instead of manually calculating or putting everything together, you can use algorithms to do it for you. It’s like a function in math, when you plug in numbers and get back some value based on it. This is opposed to creating data manually so you know we’re not just going by hand and place data here and there we are letting an algorithm do it for us.Įssentially, it’s when you use some sort of algorithm and get some desired output. One that’s not pure would be one where you give it a two and a three and it might give you something different every time. So a really simple way to think of this is an addition function- you know you add two numbers together- so maybe you know two plus three equals five that will always be true as long as you feed the addition function a two and a three you can always expect a five out of it that would be a pure function. Procedural generation, loosely defined, is a way of using algorithms in order to create data using pure functions - so it sounds like a lot of gibberish right away - but basically a pure function is one in which you always get the same output as long as you have the same input.
0 Comments
Leave a Reply. |