Rambling of a restless mind. That propably gets it. I write about whatever comes to my mind. Granted, that's a lot of more or less useless stuff. So I'll probably spare you of my thoughts of lesser importance or those that are borderline mad. The rest would be science, philosopy, computer graphics and mostly game development.
The last update on development has been some time ago, hasn't it? Bad news first: I had some commissioned artworks to do. Yeah well, "bad" news. Not on a strictly personal level. More on a "Crap I couldn't write devblog" level. Good news: I just hadn't time to write a devblog, but I had the time to push PMap along. So, relax.
Where should I start, a lot has happened...
HI everybody. I have just recently finished a artwork that has been on my art backlog for quite some time. This time I just added layer after layer while editing this thing in Photoshop. I usually don't do that. Don't really know why I did it this time, but this gave me the opportunity to create a small image showing How I went about creating this piece. Enjoy!
There's that point in software development, where the features are totally great, but the execution is still a "bit" shoddy. And colossally slow. And you try to crank the map size up to a thousand units square and you are like "Yeah, that'll be so awesome" and Unity is totally like... dead. Just why? Hwhyyyyyyy!?!
Being an artist I didn't ever want to need to think about performance optimization. And memory management. I didn't want to know what the heap is. And what the stack. And why there's a difference between the both. And quite frankly, I'm not sure If I got that into my brain already. But anyway. I was fortunate enough to being able to get my hands dirty with scripting a few years ago. So that's when I started to get into programming. That's when slowly the beauty of concepts like performance optimization unfolded. So Monday was that day where I thought to myself "You really need to start to clean up that mess". Allright. I tackled the small things first. Merged a few classes and cleaned up the errors when they arose. Until all went fine and dandy again. So, that's where the messy part started...
Performance optimization is a big thing for procedural content creation. You don't want to wait like forever for the level to load. So, since the last blog entry I did some groundwork for getting the framework do it's thing faster. This week, I took a VERY close look on the generation modules, the walkers. A walker is basically a Sampler/Placer for grid values with a specific algorithm. Each walker does something else. Some Walkers have a very low performance footprint. They complete in under 4 mas even with map sizes of a 1000 square. Which means one million cells. One bloody million. Needless to state, that some other walkers are WAY more expensive when it comes to them doing their thing. Like the Mazer. This walker creates mazes. Ranging from perfect mazes to variations with loops and such. And even with small maps, this comes with a price. its like 300ms average for 50 square grids. But that's only after my first optimization pass.
Since I didn't start this devblog from day one... shame to me... I've got to get you up to speed. So let's drop some information regarding the UI-Controller and Walkers. The UIController is a component that basically allows you to construct a procedural map setup in the Unity3D ui and save it as a prefab. I attached mine to an instance of a 2D ToolKit tilemap from Unikron Software. An interface controller pushes the map values to the tilemap for better visualization. But you can really attach the PMap Controller to any GameObject. PMap creates the data for you. Nothing more, nothing less. What you do with this data is entirely in your hands.
But now let's take a look on the process. For the purpose of this article I'll use a Walker that was modeled after the common Game of Life Rules. What it basically does, is creating cave like structures by filling the map with values of solid (1) or empty (0) randomly and then iterating with a set of rules. Ok, let's add the Walker to the chain. PMap features a intricate system where you have UIControllers that don't really do anything by themselves. The real magic happens inside of the walker class, which is just a regular c# class. No MonoBehaviour, no ScriptableObject. I'll go through how this process works internally at a later time. But for now, all you have to do is add a new UIController Component to the Component Chain.