[WIP] "Ballin-Ninja" - a roguelike
So I have revived my roguelike project once again, I have a new name for it (although this is a temporary name brought on by a suggestion from GitHub for my repo): "Ballin-Ninja". The name is definitely going to change when I have some appropriate inspiration.
This kinda forms an initial dev blog and an introduction to the project, so bear with me if things seem weird. I will post more at a later stage.
Part #1 - Map Gen
This kinda forms an initial dev blog and an introduction to the project, so bear with me if things seem weird. I will post more at a later stage.
Part #1 - Map Gen
I finally have something worth showing (and I also have finally made up my mind on how I want to do things), so here goes:
My ever-reviving and never-realizing roguelike project has come back. Many people might remember various ideas I have had had and changed over time (Neverending RPG {might have been endless or something like that actually}, Sanctuary, Atlis Rogue), and over time through research, ideas and prototypes I have arrived at a state that I am happy to go forward with and start sharing.
My first order of business for sharing this project and getting started in dev was to build some form of procedurally generated map. After considering options and building prototypes that all worked in different ways (large single-generation map, small infinitely-expanding-outwards PCG maps that make a larger map, and so on) and trying out and reading up on various mechanics I recently found an algorithm that I like for map generation.
Posted originally on Evil Science the simple premise lead me to learn a simple and easy to implement algorithm that yields really awesome results. Having been given the fantastic grids library by Game Logic I went about learning the ins and outs and worked on implementing this algorithm. In terms of steps the algorithm itself is extremely easy to remember:
1. Create a map of random noise.
2. Clear out every "extra" point that does not have a neighbor.
3. Make a list of the points remaining.
4. Go through the remaining points and expand them y a random number of cells from 6 to 9 distant (I used a recursive function because I am lazy and that is easy to do, this I tweak often).
5. Make a list of each "body" of ground.
6. Randomly shuffle each "body" of ground in the list for step 7.
7. For each body of ground make a corridor from the closest point of it to the closest point of the next other one (this step may require repetition to work out 100%).
The grids library seemed much harder to me when initially reading code and looking at the samples, but it turned out it was AMAZINGLY easy to use, and once I got the hang of it I managed to build up the map generation prototype in pretty much 1 hour 30 minutes as I read someone else's code as a reference for the algorithm.
The end result looks quite organic, it could use some tweaks, however I am happy with it for the purpose of getting this prototype functional and out there. Eventually I will tweak and adjust this algorithm.


L_76FD.tmp.jpg
1015 x 748 - 145K


L_16B2.tmp.jpg
266 x 378 - 28K


L_46F2.tmp.jpg
445 x 313 - 21K


L_C38A.tmp.jpg
548 x 389 - 77K


GridFinal.PNG
864 x 472 - 115K
Comments
Tweaked the layout and generation till I had the right map size and shape I wanted:
Closer View of the map:
I then tweaked the camera and allowed the user to drag the camera view around the map:
Next up came "base characters" - these are base stats characters that just roam the map for no reason. These are future cannon fodder:
I am probably doing something bad here, but this is what my level looks like inside the Unity world:
I have my stats built in, and I am basically ready to start building the player character and the enemies + their behaviours: