Skip to content

Tag: Wall

[Tech] Creating the Walls

In previous dev-blogs we focused on how things work and look in-game, but we never touched upon how it all comes together. How do certain things work behind the scenes? What might look very easy and obvious for you, might take quite some time to figure out and program.

In order to shed some light on this topic, we sat down with one of our graphics programmer, Florian. He is in charge of smoothing the walls you use in the game to protect yourself against invaders. Our first question for Florian was: What exactly is a graphics programmer and what do they do the whole day?

The answer was not as straightforward as hoped because the job isn’t that easy to explain: He tries to find solutions for the artists so that everything looks nice in the game. Additionally, he also implements special or custom effects.

If we look at the walls, the fortification system, we have different departments working on it: The artists, animators, logic programmer and the graphics programmer. Artists build the walls like rectangular cubes. However, if we put those on the terrain, it would not look ideal – it would look like something is missing.

This is where Florian comes in. He will think about a solution that will transform those rectangular cubes into something smooth and appealing looking. Additionally, he always needs to have an eye on the game performance as some solutions might be too performance heavy.

The goal for Florian is, to have a smooth and “fluid” transition between separate wall pieces in addition with the terrain underneath it.

For his work, he needs to pay attention to several points:

  1. Smooth transition between the wall-pieces
  2. Walls should be aligned with the terrain
  3. Grass and everything connected with the terrain should function and behave properly
  4. Military units need to be able to walk correctly on the wall

This is where the actual work starts. Florian will sit down and brainstorm several ideas. In the world of The Settlers, everything is quite dynamic and assets have to adapt to their environment, most notably the terrain system. As such, the walls need to follow the flow and shape of the ground underneath. The end piece of the wall can change as well, depending on where the player puts the next part. Due to this, the wall needs to be adjustable and flexible enough.

In order to do that, Florian resorts to “splines”. This term normally refers to a wide class of functions. In this case this function is a curve consisting of 5 “control points”. A start, an end and a point in the middle with 1 point left and right of it to determine the properties of the curve. This will make it easy to adjust the wall accordingly.

The control points of the spline are placed directly onto the terrain. Since the walls, like almost every other object in the game, are made from triangles, we can use the spline to project its height on the three corner points of the triangles.

Now we still have the difficulty that the terrain might be higher or lower on the sides of the wall, meaning we will need to flatten it when we place a piece. Even if we upgrade the walls, the spline will not change, as the walls have a predetermined height. Once everything is done and thought of, testing will begin. Placing different wall pieces in-game, trying to break the system and observing how the wall behaves. If everything works perfectly – it never does on the first try – the whole system will be submitted into the game.

What do you think about the work of a graphics programmer? Is there any information missing you are interested in? What topics interest you for a future dev blog? Let us know in the comments below.