Rework Reactor Neighbor Bonus to Promote Interesting Layouts

Post your ideas and suggestions how to improve the game.

Moderator: ickputzdirwech

againey
Inserter
Inserter
Posts: 37
Joined: Thu Jul 31, 2014 10:57 pm
Contact:

Rework Reactor Neighbor Bonus to Promote Interesting Layouts

Post by againey »

TL;DR
Extend nuclear reactor neighbor bonus to indirectly connected reactors, with bonus based on distance, in order to encourage experimentation with layout, getting away from the simple 2-by-X design.
The Motivation
Regarding nuclear reactor design, the developers have indicated that their hope would be that reactor mechanics would encourage elaborate and creative layouts, without one simple layout being clearly optimal and dominant. And while there's been plenty of discussion about laying out the heat pipes, heat exchangers, turbines, and steam tanks, it appears that an incredibly simple 2-by-X layout of reactors has become the agreed-upon gold standard for the core layout. A rather boring 1-dimensional design, with no need for further experimentation to find out if it can be made better.

This, I believe, is due to two reasons, and has led me to think about ways to alter this dynamic and make more elaborate layouts competitive compared to simplistic layouts.

The main reason is how the neighbor bonus applies only to directly connected and perfectly aligned reactors, up to a maximum of three neighbors. The result is that a 2-by-many layout maximally utilizes the neighbor bonus, with only the four reactors on the end getting two thirds of the bonus instead of the full bonus. No matter how else the reactors are laid out, there's no way to get more than this; there will always be at least four reactors with only two neighbors. And pretty much every other near-optimal design greatly complicates the ability to route fuel cells to the reactors. (I almost came up with some clever designs to solve the fuel transport issue, except I need an underground belt that can go under two adjacent reactors, 10 tiles, and that doesn't exist in vanilla.)

The second reason is that the heat loss caused by long heat pipes encourages players to maximize the perimeter length:reactor ratio, so that the maximum number of heat exchanger groups can be placed within a short distance of the reactors. The one-dimensional layout provides this maximum ratio, as the perimeter length is exactly proportional to the number of reactors. In contrast, a more square or circular design would minimize the ratio, such that the perimeter length is proportional to the square root of the number of reactors.

The 2-by-many layout is therefore a dominant strategy, optimal in two key ways, and there's no reason to try anything else, because anything else would be sub-optimal.
The Solution
Alter the neighbor bonus to also include reactors connected through heat pipes and other reactors, with the amount of bonus inversely proportional to the distance (or better yet, the distance squared).

Example: Let's say that the neighbor bonus between any two reactors is (C / distance)^2. I'll set C = 2.5, because it produces numbers easy to work with, but it could be set to anything for balance purposes. (Similarly, instead of squaring things, a custom power could be used for further balance tweaking.)

Now consider a layout of five reactors, with one in the middle and the other four placed one on each side of the first, like a +. The reactor in the center is at a distance of 5 away from each of the four outer reactors, so its reactor bonus is 4 * (2.5 / 5)^2 = 1 = 100%. Each of the four outer reactors is a distance of 5 away from the center reactor and a distance of 10 from the other three, giving each of them a bonus of 1 * (2.5 / 5)^2 + 3 * (2.5 / 10)^2 = 1/4 + 3/16 = 7/16 = 44%. So the five reactors combine produce an output equivalent to 7.75 independent reactors, a 55% cumulative bonus.

What if we wanted to expand this setup? Let's line eight more reactors around, creating a diamond or diagonal square layout. (For now, we'll ignore the space need to supply fuel; I'll address that in a bit.)

Code: Select all

      [R]
   [R][R][R]
[R][R][R][R][R]
   [R][R][R]
      [R]
The center reactor still has the 100% from the four immediate reactors, plus it now has an additional bonus from the eight outer reactors at a distance of 10, so an extra bonus of 8 * (2.5 / 10)^2 = 1/2 = 50%, for a total bonus of 150%. The four intermediate reactors are now fully surrounded too, so they get the 100% just like the center reactor in the first example, plus three more reactors at a distance of 10 and 5 reactors at distance of 15, for a total bonus of 100% + 3 * (2.5 / 10)^2 + 5 * (2.5 / 15)^2 = 1 + 3/16 + 5/36 = 133%. Finally, the outer reactors are distance 5 from one reactor, distance 10 from 3, distance 15 from 3, and distance 20 from 5, for a bonus of 1 * (2.5 / 5)^2 + 3 * (2.5 / 10)^2 + 3 * (2.5 / 15)^2 + 5 * (2.5 / 20)^2 = 1/4 + 3/16 + 1/12 + 5/64 = 60%. The net effect is that 13 reactors together generate heat equivalent to 24.6 independent reactors, an 89% cumulative bonus.

Continuing the pattern will result in ever increasing bonuses, but at a diminishing rate of return. This is both good for people who are willing to go to any length to squeeze out more performance, as well as for people who are looking for a "good enough" balance that suits their personal preference.
The Benefits
Because of the inverse square formula, the best bonuses will come about when the shape of the reactor complex spreads out in all directions equally, and the weakest bonuses will result from lining things up as one long row. This sets up a competition between attempts to maximum the neighbor bonus and attempts to have sufficient perimeter length to organize heat exchangers around relatively short heat pipes. As a result, players would surely look for creative ways to balance these competing objectives optimally. Further, the best balance will depend on how compact people can make their heat exchanger layouts. Someone who can figure a way to cram more heat exchangers around a short heat pipe will require less perimeter around the reactors, allowing them to instead make their reactor layout more circle/diamond/square-ish* and thereby increase the neighbor bonus effect.

Of course, fuel has to be delivered to reactors. Since in this system they can receive the neighbor bonus through indirect connections, it would become possible to leave gaps between the reactors, connected by heat pipes**, which would allow room for inserters and running belts or placing logistic chests. But don't spread things out too much, because any increase in distance between reactors lowers density, which lowers the neighbor bonus. So once again, players would be encouraged to find creative ways to weave logistics in with their reactors to maximize density while still effectively getting the fuel where it needs to go.
Notes
*The optimal shape is dependent on the distance measurement used. Manhattan distance would result in a diamond as an optimal shape. Manhattan plus equal-cost diagonal connects would result in a square. Euclidean distance or anything approximating it (such as diagonals costing 40% more than straight connections) would result in a circle (or circular approximation).

**The distance through heat pipes and through intermediate reactors could be weighted differently. For example, a connection from one reactor to another that has to pass through an intermediate reactor might be more efficient than two reactors connected to each other through 5 units of heat pipe. The former might compute bonus based on a distance of 10 units, while the latter might be based on a distance of 15 (2.5 through half of the first reactor, 5 * 2 through the heat pipes, and 2.5 through half of the second reactor.) Or it could be the opposite, where heat pipes are better conduits than reactors themselves. All depends on balance tweaking.

***A basic implementation could determine the per-reactor neighbor bonus simply by running something like Dijkstra's algorithm on each reactor. This is approximately O(n log n) for each reactor, so the total cost for any cluster of connected reactors would be O(n^2 log n). Not exactly a pleasant cost, but it only has to be paid whenever the reactor network changes, and even for 64 reactors, the work is proportional to 24K "steps", and I wouldn't be at all surprised if a typical computer eats through that work no problem. But even if the devs absolutely loved this overall suggestion, it'd be prudent to implement a basic version of the algorithm early to validate my optimism, before proceeding to implement the full feature. I also would not be surprised if there's a more intelligent way to calculate the neighbor bonus of all the reactors in a single process, reaching perhaps O(n^2) or O(n log^2 n). I was thinking for a moment of the Floyd-Warshall algorithm, but that's O(n^3) because it presumes the worst case number of connections between nodes, which a strictly 2D graph will not even remotely exhibit.
JohnyDL
Filter Inserter
Filter Inserter
Posts: 535
Joined: Fri May 16, 2014 3:44 pm
Contact:

Re: Rework Reactor Neighbor Bonus to Promote Interesting Layouts

Post by JohnyDL »

Another strategy might to be partial bonuses for partial connectedness if there was a 25% bonus for each adjacent tile and no more than 100% per reactor certain offsets and combinations of offsets might provide greater than 300% bonus at the cost of heat pipes being distant and interesting balances needing to be met again forcing new better more interesting strategies to be developed.

Combine that with the inverse square approach of bonuses being transmitted by heat pipes (and not jumping through reactors) losing some % over distance you'd end up with competing between clusters of reactors that all touch with few heatpipes and none touching reactors all linked by heat pipes which allow shorter heatpipe links but losing the direct link effect
User avatar
AileTheAlien
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sat Mar 11, 2017 4:30 pm
Contact:

Re: Rework Reactor Neighbor Bonus to Promote Interesting Layouts

Post by AileTheAlien »

I'm surprised this wasn't discussed more. (Maybe there was another thread earlier in the last year?) 2xN reactors are boring! Originally, reactors were going to not only encourage unique setups (like proposed here), but also have cooling towers, and partially-heated water or steam to get more efficiency! I actually would want all systems pushing reactors in different directions - improved adjacencies, cooling towers, and partially-heated water/steam. Maybe you heat up your water first with coal, then later with nuclear. Maybe 100% nuclear. Maybe cooling tower afterwards, then get that fluid cycled back into another heater to get more efficiency. Different adjacencies to balance!
ManaUser
Filter Inserter
Filter Inserter
Posts: 262
Joined: Sat Aug 12, 2017 9:41 pm
Contact:

Re: Rework Reactor Neighbor Bonus to Promote Interesting Layouts

Post by ManaUser »

This seems like a good idea. What we have now really is kinda boring. I also feel that the current neighbor bonus (100%) is a little too strong. The fact that building your second reactor quadruples your power is kind of a shock! Taking non-immediate neighbors into account might help make that ramp up a little more gradually. But frankly, it probably wouldn't hurt to lower it a bit even for the best case.
Post Reply

Return to “Ideas and Suggestions”