Finishing up with AutoHotKey
But of course the other automation with AutoHotKey is still going forward. I've got a good majority of my AutoHotKey scripts written, I still need to test and tweak most of them though. I've already gone through and replaced my first type of scripts (the Controller that I showed in that Automation post) in the Aggro base. Didn't take too long and now I have 20ish controllers with comment documentation, a standardized structure, an interface, completion signals, and many more. I ran into a couple problems replacing the old controllers with my automation, but once those problems were gone I timed myself, and it takes me 2 mins to create a full blown standardized controller now when I need it. 1:15 minutes to automate the creation of the controller and 45 seconds of other random checking and tweaking (like setting up an old version of the controller to be replaced in this case). These scripts will make game development with this IoC framework (StrangeIoC) a cinch. And every hour I spend on this is WELL worth the work.
Diagrams and Documentation
Now onto the new automation stuff. One of the biggest problems I mentioned with SOLID design principles in the past is that it leads to a system with a LOT of files... like over 20x what would be in a standard built game, but the bonus is re-usability, flexibility, ease of adding new features, etc. This problem brings in a large issue, how does one learn the enire system if there is a lot to learn? Sure you can learn one piece at a time and what it interacts with, but "getting the whole picture" is made much more difficult. Hence bringing on other developers becomes a problem because of that time sync of training new people which takes longer with sooo much to learn. Therein lies the problem.
Visualization for programmers
But I might have discovered a trick to take care of that... well it is a pretty standard trick. They call it documentation and diagrams. Gross... who has time to write these? Seriously... that is a LOT of time not developing. I've already got part of that problem solved, documentation is done in the comments of the code in C# with something called docblocks. And that is part of the automation process with AutoHotKey... so check. But words can only go so far. It is just an easier version of looking at the code. So now we need to automate diagram creation... not really an easy thing. Flowcharts, class diagrams, etc. are also heavily burdened with perfectionism and lining up nodes and coloring and standardizing and notes, etc. SOOO many details. Enter the world of PlantUML + Coding.
PlantUML is a wonderful tool that I discovered a couple weeks back. It essentially turns text into diagrams. Yeah... that's a thing folks. All you do is define the nodes and the interactions between the nodes imagine it like this: Hello -> World That creates two class nodes, Hello and World, and links them horizontally because of the single dash (double is vertical) with a standard arrow with the greater than sign (you can also use asterisks, bars, and various other symbols). WHAT!?!?! Yeah blew my mind. As you add more interactions, it figures out what to create, and how to link them. Even better it calculates where to place all of those nodes for a readable display. No more shifting around nodes to line them up for hours. You can even add coloring standards, and define types and other great features. Oh it is a wonderful world indeed. So how do we take this and automate diagram creation? Programming can be used in the entirety of situations. AWAY!!!
My new task
So what I'm working on now is a parser that goes through ALL of the code in Aggro. It generates translations for like interface -> class, it generates all of the relationships based on dependencies, etc. and then writes out a UML file that can be rendered by PlantUMLs application. So now I can just hook that up to automatically run when I make changes to the code. Now I can version these images and we can watch aggro grow together. It will be a great way for me to showcase exactly what has changed in the last version of the game for you guys since it will be more visual. Also it will be great to have that visual representation from version to version that I can compile in the end. Lots of exciting things in the future. Gotta get ready for the new 3 day weekend next week where I will jump back into the code as long as I've finished my autohotkey stuff. See you guys next week.