Art · Dungeons and Dragons

Kadmos & Yum

In the lands of Wundleich, the adventurers Kadmos and Yum pursue fantastical tales of treasure and mystery, slowly unearthing ancient secrets and forgotten lore that could see their world remade…

These characters are played by close friends, who asked that I draw them as part of their ongoing Dungeons and Dragons campaign.

Art · Dungeons and Dragons · Teaching

The Adventuring Party of Python!

Over the course of the summer of 2019, I was lucky enough to be able to teach at the Stem Kids NYC Summer camp. For four weeks between January and August, I taught programming to kids ages 6-13. During lunch breaks, I started a game of Dungeons and Dragons for a group of the kids. The kids decided to name their group “Python” (spelled using the Greek letter) in reference to the programming language I used in my lessons. As both a teacher and tabletop gaming enthusiast, it was amazing for me to see how much fun they all had during the games.

Art · Dungeons and Dragons

“A Long and Lonely Road is Now My Only Home”

Once upon a time, Aaaron Amnotxy was the promising heir to the noble House Antaniel, they of the Silver Word. Such a bright child, the scribes would say, such promise as with the pen or bow. The sages of the Trials, for all his promise, found him wanting. For the dishonor, the stain of failure upon the name of the House, his father the Lord Antaniel says he is to leave. What realm is there beyond the wood for an elf without a name?

I have played the character of Aaaron in a Dungeons and Dragons campaign for the past year – this is a pencil and paper sketch of a scene from his backstory – of the moment he left the elven woods, and left the signet ring of his house behind.

Art · Music · Theatre

Within the Ice

Over the summer of 2019, I was lucky enough to be able to work on a short play written by one of my friends from school, and produced as part of the New York Theatre Festival’s Summerfest series. My role was an aglomeration of sound designer, composer, and sound operator along with lighting designer, stage manager and lighting operator . The show was a short Lovecraftian horror thriller set aboard a stranded antarctic expedition in the early 20th Century.

I created poster art, a musical theme, and sound effects for the production. The show opened with a slightly shortened variant of the theme over which played a narration done by the chair of our school’s theatre department, which is playable from the link below. Although running sound and lighting during a show can be incredibly stressful, this was without a doubt one of the most fun and rewarding collaborative projects I’ve been part of.

Video of the Within the Ice score playback.
Everything Else · Projects

Drawing Setup

As may have been indicated by some of the posts I’ve made already, I am something of a fan of drawing. Concept art, designs, and characters are among my favorite subject material. The nature of the things uploaded in my earlier posts may also have indicated that digital sketching is among the methods I employ.

For my digital art I employ a Kamvas pro 13 graphics tablet from the Huion company. It comes in a big black box, and while undeniably pricey, is far more economical than similar products by Wacom, the giant in digital art hardware.

Once removed from the aforementioned big, black box, the tablet reveals itself to be a screen slightly narrower and longer than a piece of printer paper. It comes with a stylus for drawing with. One of the great selling points of this model of tablet is that the pen requires no battery or charge; you can use it forever as long as the tablet is plugged in. Besides its screen, the tablet also has a total of five buttons and a slider (plus two more buttons on the stylus) which can be mapped to any key combination on your keyboard. For example, one of the buttons on my tablet functions as Control-z, handy for rapidly undoing mistakes, and my stylus can toggle between pen and eraser mode quite easily. The tablet’s screen is indeed a screen, and can be configured just like a second monitor. The tablet itself requires connection to a USB port to register as an input device, a HDMI port to render, and a power supply. All of that fits into the single cable visible on the right of the tablet in the photo,

Once you plug in the tablet, however, you’re still not quite done. See, the tablet registers on your computer as a USB input device and displays exactly like it should, but your computer doesn’t really know how to talk to the tablet. If you try doing anything like using that pressure sensitivity it just wont work. For this, you need to download the company’s driver. A driver is just a special piece of software that you use to talk to hardware. Your computer comes with a lot of drivers built into its operating system, which is why you don’t need to specially configure your mouse or keyboard when you set them up. Your computer knows how to handle a HDMI display (hence why the tablet’s display works just fine), but your computer probably has no clue how to handle the pressure input by itself, since it assumes that your stylus is just like a mouse pointer. This is where the Huion tablet graphics diver comes in. This driver is made by the company, and lets your computer talk to the tablet properly. This app window lets you set up your hotkeys, configure the display, select how the contact on the tablet screen maps to the display, and to calibrate the pen input (configuring how the tablet’s display is treated as a monitor is done through your computer’s normal settings window). Once this is set up, you can start drawing.

Now, your tablet and driver may be fancy, but they’re not an art setup by themselves, because they can’t actually, well, do art. All of this so far has been setting things up so you can input brush strokes into your computer. To actually get drawing, you need a special art program. For this there are many great options such as Photoshop, but also a huge number of free and open-source online projects by various groups. GIMP is one popular example. For my art, I use a program called Krita, which besides a simple and easily to use interface has some spectacular brush templates and a great color selection dialogue. However, most tablets will work with most art software, albeit with varying amounts of setup required. Krita is great because it detects your tablet automatically.

And that’s about it! Once you’ve set it all up, then the world of art is your oyster. Cheers, and happy drawing!

Computer Science · Projects

A* Demo in Processing

Pathfinding has been with us for a very long time. From Marco Polo to Christopher Columbus, the adventures and misadventures of getting from one place to another have been turning points in history. As it turns out, being able to navigate from one point to another is a really useful thing to be able to do – and so, computer programmers have figured out a way (in fact, many ways) to do it using computers. You probably use these algorithms all the time. Every time you get directions from Waze or Google Maps, you’re using a pathfinding algorithm that probably works very similarly to this simple example.

Consider a grid, like a chessboard. Imagine yourself put on one of these squares, and told to find a path to some destination square. You know what direction it’s in, so you start walking towards it. If you hit an obstacle, you try to walk around it, and eventually you reach your goal. Computer scientists call what you just did a Greedy Best-first search – at every step of your process, you tried to get as close to your goal as you could, based on some guess of which steps would take you closer. This got you to the destination eventually, but you probably spent a lot of time finding your way around obstacles.

Let’s try this example again, but this time, you want to avoid knocking into any walls. Instead of immediately finding your goal and moving towards it, you instead start searching the tiles around you. Because you want to walk as little as possible, you explore the squares closest to your starting point, and explore outwards in this fashion until you find your destination. This gets you a shortest path (for there may be many equally short paths) towards your goal. We in the computer business call what you just did Dijkstra’s Algorithm (no, I can’t help you pronounce that, but Wikipedia can). It got you the best path, but you spent a lot of time exploring.

On your third attempt at this maze, you decide to combine the approaches of your first two attempts. You want to explore tiles before traversing them to avoid obstacles, but you also don’t want to waste time looking at tiles that aren’t going to help you get closer to your destination. This time, you consider both how far you are from your destination and from your goal when you decide on your final path. This is the secret to the algorithm known as A* (pronounced “A Star”). By looking at both your starting point and destination, you can be both fast and find an optimal path.

A* works using what computer scientists call a Heuristic. This algorithm’s heuristic is the same one that you were using in the first example – how far do I think I am from my destination. For every tile you looked at in example one, you estimated how far it would be to your destination. For every tile you looked at in example two, you could easily see how far it was from your starting point. In example 3, you can say that you added the two numbers together. For every tile you looked at, you combine how far you are from your starting point with how far you think you are from your goal. You can see then that if that number is small, you’ve found a short path (i.e. if you are close to both the start and end). The beauty of A* is that it lets you customize the parameters of your search. If you always take the distance to the destination to be 0, then you’re only looking at the distance to the start (this is Dijkstra’s Algorithm). If you take the distance to the origin to always be 0, then you’re only looking at the distance to the goal (Greedy Best-first). The smaller you estimate the distance to the destination to be, the more time you spend searching but the better your final path. The larger your estimate of the distance to the destination is, the less time you spend searching, but your search takes less time. This ability to customize the algorithm makes its utility clear.

My implementation of A* was done on a 2D grid, on which we generated a maze using Recursive Backtracking and then knocking out some random walls. The maze itself was a class, which stored the maze as a 2D array of GridCell objects, which each had a location on the grid, a randomly generated inherent cost, amd an array storing booleans representing walls on each side. After generating, the Maze object would then make a new instance of the AStar class, which ran on the Maze. The implementation used Java’s built-in Priority Queue, which organized gridCells yet to be looked at by their heuristic cost.

The process of conversion was, to put it mildly, quite a challenge. This was my first time working in JavaScript, and dealing with the differences between it and Java were quite difficult. JavaScript, unlike Java, is an interpreted functional language with weak typing. What does that mean? Java is a compiled language. Whenever I want to run it, I have to translate (compile) it into a form that can run on my JVM. JavaScript, however, is interpreted – browsers load the source code, then look at it and execute it line by line. Java is what we call an object-oriented language. Everything in Java is an object, which we can assign properties to and make instances of. For an example, if you were to describe your house in Java, you might have a “chair” class, and every chair in your house would be an instance of that class. JavaScript is functional – everything in it is a function under the hood. This makes it difficult to use the same ideas as real life – where things are “objects” that share certain properties, it makes many other tasks much easier, and lets you modify your program when it runs in ways that you can’t with Java. Another difference between Java and JavaScript is that JavaScript has many fewer built in functions and data types. This meant that I needed to implement the Priority Queue and the Stack data types myself, but fortunately that wasn’t too hard, as JavaScript has a lot of useful functions of its own that can be run on an array.

For the sake of time and my sanity, my conversion was fairly simple. Rather than completely rewrite the algorithm from scratch, I instead altered my syntax and changed some structures until it ran without throwing errors. Though unoptimized, it let me get the job done in a timely manner.

Thanks for reading, and fly safe!

You can try out my A* implementation in glorious fullscreen by going to https://theocoulson.com/stuff/code/AStarJS/ and pressing Space to start. Use the arrow keys to change the dimensions of the maze. Enjoy!