Hex Map

I’ve started generating some random maps using the hex tile set in my last post. The map below uses only 3 tiles from the set, placed and rotated randomly. Once I add more of the tiles in, I’m going to group them together into general types. For example I might have 3 tiles which can be used for open terrain, 3 for forested areas and 3 for hills. By doing this, I’m hoping to get less homogenous results as well as create some defined features and regions on the map that span multiple tiles.

Hex Space

I’ve always been interested in rule based systems, and lately I’ve been reading a lot about game design. I’ve found it far more interesting to hear the designer’s thought process behind the design of a game than to actually play the game itself. This has recently led me to listening to The Game Design Roundtable, a game design podcast hosted by Dirk Knemeyer & Jon Shafer.

On a recent episode, Dirk Knemeyer talked about one of the projects he’s been working on called War Stories. The goal of the project is to develop a tabletop strategy game that streamlines and simplifies the process of playing. Most such games require lots of charts, tables and reference materials. The design team wanted to get rid of as much of these extraneous parts as possible, and they did this by making the few pieces they did use more intelligent.

My personal favorite result of this process is the way the space of the game, the map, works. The spaces on the map vary in size proportionally with how easy that terrain is to cross. So easily crossed terrain is very large and hard to cross terrain is small. This allows you to simplify movement by setting a piece’s movement ability to a fixed number of spaces. The movement modifiers present in similar games are now simply inherent to the map. No math required!

I really like the idea and I spent some time exploring it myself. You can see some of the results below. In this example, each map piece is made up of 19 hexes and contains either 3 or 5 spaces. Each space contains either 1, 3, 5, 7 or 9 hexes. These rules allowed me to narrow the number of possible configurations. Each column is one of 9 possible permutations of number and size of spaces within these constraints. There are more possible configurations in each category. I chose ones I felt were most distinct and interesting, generally avoiding symmetry where possible to make them feel more organic.



Sphere Points

I spent some time dressing up the sphere points script for a video. The points are now added one at a time at the same spot, resulting in some nice swirling effects as they spread out. I also added a bit of color to further emphasize the three dimensionality of the form. There were some artifacts from the encoding when the sphere spins that I couldn’t get rid of, but it doesn’t look too bad. You can see it below or click Here for a bigger version.

Gather Round

Someone recently asked a question in the Cornell scripting group about equally distributing points on a sphere. There was a quick response to the question, pointing to some of the classic spiral distribution algorithms. This came with the caveat that, depending on the number of points you have, there is no mathematically perfect solution. My first reaction was, why try to calculate the position of each point when you could just have the points figure it out for themselves? I may be showing my partiality towards self organization, but nobody pulls out a calculator before blowing a bubble, you just throw it out there and let nature do it’s thing.

So I opened up processing and set up a basic physics simulation, throwing points on a sphere at random and instructing them to stay as far away from each other as they could. The points repel each other depending on how close together they are. Points right next to each other yell “Get away!” and run the other direction, while points that are far from each other call out hesitantly “Keep your distance!”. The result is that each point gets its own space, and each space is roughly equal in size. I say roughly because, even though we aren’t using a single mathematical algorithm to place every point, there’s no getting around the fact that there is no perfect solution to this problem (outside of special situations, such as a dodecahedron or Icosahedron). You can see the result for 100 points below. I added some lines between the closest points to make the space easier to understand in a still image (it looks great in motion so I’ll try to put up an animation soon).

As I typed this up, I searched around and found that a paper on this method of point distribution was published in 2004 called Discretizing Manifolds via Minimum Energy Points. The authors thought this title was a bit too dificult to digest, so they also call it the Poppy-Seed Bagel Theorem (I see what they did there).

New Year Honey

A new year and the end of another long posting hiatus. I’ve recently had to take on more responsibilities at work, leaving me with less time for “extracurricular” actives. It seems that when time is short, this blog is the first thing to get ignored. However, overall I feel good about the number and quality of posts I made over the course of last year. While none of the work I posted was particularly sophisticated, I still managed to average about two posts a month. I’ll be happy if I can maintain that pace through the coming year, which should be very busy.

One of the projects I’ve been working on is an interior with a honeycomb motif. I did a few initial sketches manually to show the client the idea. But, now that we have the approval to take the design in this direction, I’ve started using processing to more thoroughly explore the possibilities and develop a more robust system. Here is the very first result, showing a random distribution in a hexagonal grid with three states: void, outline and solid.

Technicolor

I finally got the triangles and the lines playing together nicely. It’s been really interesting exploring gradual hue changes and how they compare to the gradual RGB value changes I was doing before. These studies where inspired by some really nice work done a by graphic artist named Simon Page. It’s a really great set dealing with color and geometry, two of my favorite things!

Tri Colors

As usual, I’m eager to add some color to the hex line sketches I did yesterday. I’ve started looking at some basic color variations based on the Sierpinski triangle. This is slightly different than most of my previous color scripts because I’m worknig in HSB mode instead of RGB. Each generation varies slightly in Hue and Saturation. Eventually I want to have something like this replace the black background of the hex lines I posted yesterday.

Attractor

Apologies for another long hiatus from posting. I have not had much free time to work on my own projects as I have been so busy with work. I did, however, spend a little time playing with the behaviors and the look of the flocking script I posted last month. Its always fun to watch the little guys fly around, but I will probably be dropping the flocking behaviors soon and trying something new.

Edit: And of course, posting a new video made the old one stop working. It seems this plugin cannot show more than one video at a time. So it’s back to figuring out a good way to share video.

Swarms of things

Some of the recent drawing agent work I’ve seen has inspired me to revisit one of my first loves, multi-agent systems. I have a good bit of existing code for multi-agent systems already so the first thing I’ve done is put together the core pieces I need to get some classic flocking going. If you are not already familiar with him, Craig Rynolds is the great grandaddy of flocking behavior with his classic ‘boid’ rules. These deal with three core behaviors: Cohesion, Separation and Alignment. Cohesion is the tendency for each agent to try and move towards nearby groups of agents. Separation is the tendency for agents to move away from agents they are too close to. Alignment is the tendency for agents to travel in the same direction as other nearby agents. You may notice that these three behaviors don’t exactly overlap, in fact they almost seem to work against each other. The result is that the ultimate behavior of the agent is a negotiation between each of the core behaviors. So given a few simple behavioral rules, one can see some very complex group behaviors emerge.

I spent some time balancing the behaviors to get the results I wanted and generated a video. I then uploaded the video to vimeo and it looked terrible. I asked for help making it look better but was told that “given the nature of the video, vimeo’s transcoders would not be able to transcode it properly”. This is very frustrating. Once again I found myself searching for a better way to share videos. Ultimately I had to abandon the video sharing sites and host the video myself and play it with VideoJS. This means a little more work for me, but the results are much better. Now if I can just figure out how to make it stop autoplaying. As far as the video itself, there’s nothing really groundbreaking here. Just some basic flocking and random colors. This will be the foundation for some new experiments.