# Fit as many overlapping generators as possible

Rimworld is a tile-based videogame. One of its constructibles in the wind generator: The wind generator itself occupies a space of 7x2 and can be placed facing the 4 cardinal directions.

In order for it to work optimally, it is required that it has free (unoccupied) space for 10 tiles in front of it and 6 tiles to its back, for its entire 7 tile width, as shown in the image.

What is the optimal placement for wind generators, ie most generators per area?

For an answer I expect a description or even better an image which explains the setup, and a percentage of tiles used by the generators. In order to calculate this percentage, we have to be able to isolate a (hopefully rectangular!) area which can be validly replicated when tiled in the map. I will make a first (obvious and probably suboptimal) answer to showcase this.

Here's simple 2-D pattern that seems to tile quite efficiently:

The area of the each tile (blue square) is $$21\times21 = 441$$ tiles, and it contains $$4\times14=56$$ generators tiles, for a ratio of $$\frac{56}{441} \approx 12.7\%$$

The trick here is that

it's easy to double the density to $$\frac{112}{441} \approx \mathbf{25.4\%}$$ by adding a copy of the pattern, staggered so that the required empty spaces (marked in pink in the image above) overlap. This happens nicely as long as the copy is moved 9 to 12 tiles both horizontally and vertically.

The final pattern looks like this:

POST-TICK EDIT: managed to find an even better pattern with $$\mathbf{26.88\%}$$ utility. Green is the back side, the large square's sides are made of two generators each.

The repeating pattern's (red square) side is $$7+2+14+2=25$$ tiles long, and it includes $$12$$ generators, which take up $$\frac{12 \times 14}{25\times25} = \mathbf{26.88\%}$$ of the total area.

• This seems very, very promising! Mar 30, 2019 at 18:07

I decided to place the wind generators together pinwheel-fashion:

The repeated section looks like this:

To calculate the efficiency:
There are $$70+70+16+9 = 165$$ empty squares, $$4\cdot14 = 56$$ filled squares, for an efficiency of $$\frac{56}{221} = 25.339\%$$.

Sadly this is not quite as efficient as Bass's solution, but ever so close.

In my first attempt I put them together more tightly, around a 2x2 square, but then the other intermediate square area was 5x5, leading to an efficiency of $$24.88\%$$. In my current one the intermediate squares are 3x3 and 4x4. For maximum efficiency you would want those intermediate squares to all be equal size, but that is impossible on this grid. Bass's solution is the essentially exactly that but with parts shifted to make things grid-aligned.

• This is a bit late but... I am perplexed by your answer. Your repeated section is not rectangular...and I've tried to find one but it seems difficult. How are you certain these two rectangles form a repeated patter in 2d space? Is there some maths behind? Apr 14, 2019 at 9:41
• It is essentially the herringbone pattern but shifted slightly which causes those unused squares in between. If you look at my first picture, find the four unused 3x3 squares, and draw a large diagonal square connecting their centres, then that large diagonal square is a repeating section. Those diagonal lines cut through the rectangles, though you can reconfigure the section by removing bits from one side and adding it to the matching other side, and so rebuild the rectangles and get the repeating section I gave. Apr 14, 2019 at 10:55

As mentioned in the question, here is an example of an answer: This 20x7 tile setup can be validly tile-replicated, as the required open space of the left generator which is "out of bounds" correctly loops to the right to coincide with the open space of the right one: Since we've established validity, the ratio is: 28 generator tiles/140 total tiles=20%

• @hexomino based on the answer it sounds like the game field wraps left to right Mar 30, 2019 at 13:51
• @Amorydai Ah, okay, thanks. Will delete my comment in that case. Mar 30, 2019 at 16:20