About

I'm a software engineer who works on game development part time. I teach game development (on gamedev.stackexchange.com and lynda.com). I'm always working on something, and I'll post updates here. Let me know if there's a game development topic you want to know more about, I probably know the answer, or at least where to get one.

Sunday, November 13, 2011

Flow, now with ebbs

Flow has some improvements in speed and looks. One of the updates was moving flow to a separate data layer. This allows the flow to go over short cubes, flow through fortifications and so on. But you saw that last week in my #screenshotsaturday post.

This week I was on vacation in Hawaii, so admittedly I wasn’t working on AOG too much. However, with the long flights and half the trip being stormy-rainy weather, I was able to implement active flows and flow out. Active flows are the flows the player will use to power equipment and they are immune to evaporation. When a flow is active it means there is flow moving through that position to somewhere else on the map. Or somewhere off the map, which is where flow outs come in. When a flow finds the edge of a map, that’s a flow out point. The flow out points take their flow level from their source each cycle. The effect this has is to limit the wide spread of flow once it reaches the edge of a map. Combined with active flows, this forms streams on a flat surface. The series of screen shots below show water spreading out from a source cube. At first a wide spread, then when the edge of the map is reached. The number of active flows decreases because most of the water is flowing off map. The flows that are no longer active eventually dry up and leave only the active flows.

I start by placing a flow source.

The water flows and ebbs spreading out from the source.

It continues to do so, and nears an edge of the map.

When it reaches the edge, the water begins to flow out at those points. Eventually, other water dries up and all that remains is a “stream like” flow from the source to the map edge.

Here I’m showing off some of my debugging tools that shows me the path a flow takes. This one is one of the flow out paths.