top of page

Substructures

First, some background: In Darknet, the player will be hacking through “levels”, each of which represents a computer network that you’re invading. Each level is composed of a bunch of hackable “nodes” (attached to one or more level shells). Some nodes are more valuable, some nodes are more secure, some nodes increase the security of their neighbors, etc.

All of Darknet’s levels are procedurally generated (i.e. they’re assembled by the game rather than handmade by me). There are a lot of advantages to this technique, but the most important advantage is that it allows me to create an infinite number of unique levels. One disadvantage, however, is that it can become difficult to make the levels feel meaningfully unique. Once you understand the general “texture” of a level, they can all start to look and feel the same.

One strategy for solving this problem is to include meaningfully structured sub-elements. Spelunky (an underground adventure-themed game with procedurally-generated levels) does a great job of this. Rather than generating an endless, shapeless blob of a cave, the levels are assembled out of pre-structured “rooms”, each of which can be randomized in its own little ways. Thus, when you go through the level, you see trap rooms and hidden dangers and bottomless pits and well-guarded treasure rooms, rather than just a random assortment of obstacles. The randomization keeps it fresh, but the structured elements bring meaning.

Darknet is far more abstract than Spelunky, but I wanted to see if I could do something similar. So, this week I added a feature that allows me to include pre-structured groups of nodes. In the code, I call them substructures.

Each substructure is defined as a particular arrangement of nodes. Some simple examples would be a hexagon or a line. Because the nodes can increase each other’s security, the topology of each arrangement can have different strategic implications for the player. So, for example, if a valuable node is surrounded by a circle of secure nodes, it’s extremely well-protected, but the player can hack towards it and eventually weaken it from multiple directions. If instead it’s at the center of a spiral of secure nodes, it’s almost impossible to hack your way in, but it’s more vulnerable to special items that weaken the network.

It’s pretty easy for me to define new shapes for these substructures. Also, each substructure is randomizable in a couple of ways: First, I can define any number of “special configurations” that alter the number of nodes in the structure and change which ones will connect to the rest of the network. Second, for each special configuration, I can change the value, size, and security of the nodes in each structure. Even for the simplest of the substructures I’ve defined so far, there are over 150 ways of actually creating it in the level.

The value of these substructures will depend largely on how many strategically meaningful arrangements I can invent, but my hope is that they’ll keep being interesting for a long time as they’re presented in different combinations and in concert with the existing level generation algorithm.

I feel good about adding substructures so far, but it highlights one of the big challenges of my style of game design. Because I like to keep the rules and game elements so simple (4 sizes of nodes, 3 levels of security, no special cases, etc.) it becomes much more difficult to offer a satisfying level of variety. Ideally, I want my games to be dynamically interesting, in the same way that a game of chess can be unique and interesting despite its simplicity and despite having the same “content” every time, but it’s really hard to actually pull that off! We’ll see how far I can get by the time Darknet is released.


Featured Posts
Recent Posts
bottom of page