I haven’t updated recently, so this post will cover the title content, as well as other small updates.
Milestone #3 (see blog title) has been achieved! Even if it’s about a month late… – I’m just trying to complete everything as fast as possible at this stage. I finished coding the Walkers algorithm last week, over the course of 2 days. Here’s proof!
Walkers create dungeon and cave levels like Cellular Automata, although Walkers levels look more man-made than those generated with Cellular Automata. See the previous post if you want to compare the results of the two algorithms.
This algorithm took me around 2 days (about 6 hours total) to code – about double the time required for the other ones. It took longer to code because it had more classes and parameters that had to be debugged. I had one main problem throughout the coding, where the walkers weren’t changing direction very often. This was because I was creating lots of Random objects regularly within loops, which decreased the actual randomness. See this webpage for a detailed discussion on this.The walkers started stumbling around in the squiggly lines shown in the previous image, once I took the Random object out of the loops and forced it only to be used for all of the random requirements. The Random object is now a static property on Walkers in Walkers.cs.
Having completed the 3 algorithms, I can now start working on the game objects, which are part of Milestone #4. Users will be able to create game objects via the Game Object tab, once this next milestone has been completed.
Algorithm Parameter GUI Labels
You probably noticed the addition of parameters GUI labels in the previous image – i.e. Min walkers, Max walkers, etc. These were the result of the work I did today! Each algorithm has parameters that change its behaviour, and Procreate lets users modify these values. I’ve completed most of the parameter GUI labels, other than one for the Randomise Level algorithm, which will require some kind of list or panel that the user can drag and drop game objects into. This one will require a little thinking!
I’ve also bound the labels to the algorithm data in the code, so code will update as soon as the user makes changes to the parameters. This required a stack of code-writing, which you can see in MainWindow.xaml.cs – lines 87-213. I’m hoping to push most of this functionality into the Procreate’s xaml file, using Data Templates, so the xaml.cs file isn’t as big.