Maximum "productivity" from placement

Maybe experience players know this, but it would be nice to see max productivity/research/wealth before placement based on current settlement.

 

For example:

I just took over a colony, and I am Durantium refinery, I can either place with next to 2 basic factories, Antimatter Power Plant and a Solar power plant

Or I can place it next to 4 basic factories, Antimatter Power plant, so is 2 basic factories bonus better than Solar Powerplant bonus? I don't crunch numbers so not going to take the time to figure it out, but a city planning computer could easily do this, so the game should be able to inform me which is better.

 

Though the fact that the colony was poorly layed out makes me think the AI doesn't know any better.

129,273 views 24 replies
Reply #1 Top

No two factories give 5% more manufacturing, but the adjancencies are +2 instead of +1. But that only provides a 5% difference, so that might make up for it depending the layout. Depending on the layout it would probably be better putting the solar power plant in the center, but the anti matter plant is better with a plus three bonus.

Reply #2 Top

I don't crunch numbers so not going to take the time to figure it out,
*sigh* You know, in the time you took to post this, you could have done the calculation allready.

As the admiral allready pointed out, you can simplify the problem a lot:

  • You don't have to consider the base bonusses of any building.
  • You don't have to consider the adjacencies of the anti matter PP and 2 of the factories, because those ar present in both situations.

Which leaves: adjacency of a DR and 2 basic factories:
 - Two adjacencies taken by the DR from the two factories (+2 manufacturing)
 - Two adjacencies given by the DR to either factory (+10% manufacturing for each basic factory)
 - In total: +2 manufacturing for the adjacencies taken and +20% manufacturing for the adjacencies given by the DR

And: adjacency of a DR next to a solar PP:
 - Two adjacencies taken by the DR from the solar PP (+2 manufacturing)
 - Two adjacency given by the DR to the solar PP (+10% manufacturing)
 - In total: +2 manufacturing for adjacency taken and +10% manufacturing for the adjacency given by the DR

*sigh* I allways die a bit inside when I see people not do simple calculations and resort to more effort involving solutions :(

but a city planning computer could easily do this,
...

Reply #3 Top

See a city planner can easily do it... lol

 

 

Reply #4 Top

Quoting Syrkres, reply 3

See a city planner can easily do it... lol
 

And so can you!  ;)

Reply #5 Top

A city planner "assistant" can't do this for you. Because it can't know what you plan for the future.

What is optimal for putting the DR right now may no longer be optimal when you want to place another factory right afterwards. But, what if you don't want to put a factory there, and a research center is better for your purposes.  Mathematically, locally greedy solutions are in no way guaranteed to be globally optimal.

 

Also, remind me again how hard it is to just place the building, look at the adjacencies (which are helpfully shown), delete it from the build queue, and then do it for the other place?

 

 

Reply #6 Top

Quoting zuPloed, reply 2


I don't crunch numbers so not going to take the time to figure it out,

*sigh* You know, in the time you took to post this, you could have done the calculation allready.

As the admiral allready pointed out, you can simplify the problem a lot:

 

    • You don't have to consider the base bonusses of any building.

 

    • You don't have to consider the adjacencies of the anti matter PP and 2 of the factories, because those ar present in both situations.

 


Which leaves: adjacency of a DR and 2 basic factories:
 - Two adjacencies taken by the DR from the two factories (+2 manufacturing)
 - Two adjacencies given by the DR to either factory (+10% manufacturing for each basic factory)
 - In total: +2 manufacturing for the adjacencies taken and +20% manufacturing for the adjacencies given by the DR

And: adjacency of a DR next to a solar PP:
 - Two adjacencies taken by the DR from the solar PP (+2 manufacturing)
 - Two adjacency given by the DR to the solar PP (+10% manufacturing)
 - In total: +2 manufacturing for adjacency taken and +10% manufacturing for the adjacency given by the DR

*sigh* I allways die a bit inside when I see people not do simple calculations and resort to more effort involving solutions :(


but a city planning computer could easily do this,

...

 

Well some peoples minds are not mathematically inclined, especially mine. When i first look at your post it just looks like gobbldygook.

Take me an hour to knuckle down and try to understand it, or i could simply go and play the game. I know which one i will chose! lol

Reply #7 Top

Quoting Mystikmind, reply 6

Well some peoples minds are not mathematically inclined, especially mine. When i first look at your post it just looks like gobbldygook.
The complexity of the problem is: Counting. And decide which number is higher.

I will let this stand here - without further comment.

+1 Loading…
Reply #8 Top

When I place a building it would be nice to see (in the total section [productivity/research/money]) the current total and "new" total once built. Clearly the program can do that because once it's built it computes the total, so I just want to see "proposed" new total before it's actually built (but after it's been placed).

 

Reply #9 Top

Well, I am not entirely unsympathetic to this idea, it would add a little bit of comfort, granted.

But:

I would estimate - as simple as the problem looks - you will have someone put in somehting in between half an hour to a couple of hours to implement it and test it. This is time he won't use to do more awesome or important stuff, like improve the AI or fix a bug, which allows the AI to build multiple unique buildings.

And from that perspective my preference is to expect people to catch up on their 4th grade math. This may be a bit self-righteous, since math allways came easy to me, but in this case I am not embarassed to be self-righteous. Besides, it's really just basic calculus (like deciding on whether 2 pears or 2 apples are cheaper), it won't hurt you ;).

Reply #10 Top

So is a better to replace the "AntiMatter factory" with a normal factory in mid/late game or is the base + still better? Is 50% + bonus% better than Antimatter base + plus +3 to adjacent factories (+3 .vs. +1).

 

Logically it seems the +3 antimatter seems better, but whenever I take over a planet the Antimatter (and similar buildings) are always to the side (not surrounded) so I ask is the game smarter than me or what?

 

 

Reply #11 Top

Quoting Syrkres, reply 10

Logically it seems the +3 antimatter seems better, but whenever I take over a planet the Antimatter (and similar buildings) are always to the side (not surrounded) so I ask is the game smarter than me or what?
Most certainly not. I modified the AI Governors for planets an study how the AI behaves. I can guarantee you, it is not smarter and if it makes a better choice then you, it does it by accident.

The AI has a very simple greedy algorithm (I think), it asks:

"Am I placing a hub (e.g. anti matter plant) or a normal improvement?" If it places a hub it looks first for spots with many adjacent tiles. When it has done that or places a normal improvement, it asks: "Where do I get the highest adjacency from existing improvements/ planet tiles for the improvement type I am placing?"

An example of where this goeshorribly wrong is the following:

There are no special tiles or trad ressources and the AI wants to place a research lab, a farm and a factory. There are 3 spots adjacent to the colony capital. So when it decides where to build its improvements, it will put all three next to each other and waste their adjacencies.

I have seen worse: 4 tiles next to capital and the AI places: farm, factory, farm, factory in the four spots near the capital so none of the four give adjacenies next to each other.

You can do a way better job, but taking your first look at the planet and saying: ok there are 3 groupings of tiles, regardless what happens, this one grouping will be all manufacturing, this one all food and this one all research. even disregarding possible tile bonusses (e.g. you have two tile bonusses for manufacturing in different spot groupings).

Reply #12 Top

AI Improvement placement is bad, real bad. Ignore what they do.

Reply #13 Top

AI improvement placement has gotten better. It still has a ways to go. I suspect it is one of those areas that gets ongoing incremental changes that won't be dramatic or visible but will slowly improve this portion of their game over time.  I don't think the math is all that hard, to reference the above discussion, but the possibilities and trade offs get subtle, involving what emphasis you want or need from the planet, improvements that offer combinations of adjacencies, colonizing events, and especially planning for future terraforming. AI for GC3 is a multi-year effort.  They have been doing some of the more obvious work we have been pointing out, but there should be ongoing progress to look forward to. It has me excited in a slow patient way.

Reply #14 Top

Well, I have gotten the Thalans to build pretty neat homeworlds with the AIGovernors + AITechgovernors + changing improvement tags + increasing the replacement immunity from level 3 to 5. You can find that AI in Horemvores Tweaked AI.

I made list of things to improved here. Feel free to go through it and suggest things which you feel will still be missing.

Reply #15 Top

Quoting zuPloed, reply 7


Quoting Mystikmind,

Well some peoples minds are not mathematically inclined, especially mine. When i first look at your post it just looks like gobbldygook.

The complexity of the problem is: Counting. And decide which number is higher.

I will let this stand here - without further comment.

 

If you happen to see me understanding complex maths in any other thread, that is just because my mood was different that day! lol

Reply #16 Top

Also, more to the point:

Any such placement assistant requires a lot of coding.

First, there's the code to not do calculations until you hover the new building over a hex for some number of seconds (5?).

Second, code to temporarily delete any building that hex already has in it from any estimation.

Third, code to calculate the new current Manufacturing/Research/Economic values (because, you have to recompute ALL of them)

Fourth, code to display some sort of pop-up with the new values in some reasonable form.

---

Of that, only the 3rd likely can reuse existing code.

There's a bunch of copying and manipulation (because you're effectively having to copy the entire planet layout as a structure, before doing any new calculations), since I'm presuming that GC3 is written in some sort of Object-Oriented language, and Deep Copy of an object (which I'm assuming a Planet is) requires a lot of code that I'm pretty sure isn't there already (where else is such a thing happening?)  Then you've got to write the code for #1, #2, and #4, plus debug and QA it.

Honestly, that's a week of developer/testing time.

Reply #17 Top

Quoting trims2u, reply 16

Also, more to the point:

Any such placement assistant requires a lot of coding.

First, there's the code to not do calculations until you hover the new building over a hex for some number of seconds (5?).

Actually it should be very simple because they already have the code, the game already computes the total once a building IS BUILT.

They just have to take that routine and call it whenever I place a building.

 

(Mockups below): 

 

#1 Normal Production listed - nothing added

#2 Basic Factory Added (once it is built the total WILL show the new total). I want it to show that before I actually take a turn.

 

#3 Antimatter Factory added - again it already shows current production and WILL show new production once fully built. I want to see the "proposed/new/estimate" production before I take a turn. 

Reply #18 Top

Nope. That code only applies to calculations after the building is placed.  I.e. the #3 thing I indicated.

That is, the only code that's existing is to calculate planetary production given a fixed configuration. 

What an advisor has to do is store state between the existing and proposed configurations, do the calculations (and store them) separately, plus add in the UI elements to display that properly.  So, you're either stuck with modifying the existing Planet Object to add a bunch of new fields, or you do a Deep Copy of the Object to try out the new configuration on it.  All that's new code that has to be written and tested (especially to see how other existing code now deals with the modified Planet Object).

Remember that it has to recompute and display for all categories.

Also, there has to be logic in there to deal with the situation of multiple buildings in the build queue. Do you display just what is going to be happening after the next building is built? Or all the buildings in the queue?  What about the situation where you want to replace an existing building with a new structure (but, obviously, don't want to destroy the existing building until you're sure)? 

This is not a trivial ask to display some information already held elsewhere. This is a whole new feature, with the appropriate coding and QA requirements I just detailed.

 

As zuPlod said, this is something that's far simpler to do a rough calculation in your head (i.e. "Counting") than to get the exact count via programming.  For the vast majority of these situations, it's really only comparing adjacency totals between before and after, and that's a simple matter of looking at the displayed counts, summing them, multiplying by 5%, and then applying that to the Base Manufacturing (or whatever) displayed in the popup.   Estimation is simple to do for a human, but much more involved for a computer.

 

E.g.:

 

I'm adding a Anti-Matter plant with 4 adjacent buildings that benefit. Each building gets a +3 bonus, or +15%. So I'm adding +60% to my base manufacturing.

Or, I'm adding a new Factory: it gets a base +15%, 4 adjacent buildings get +1 (+5%), but the factory gets +1 from each of them. So, 15 + 4 x 1 x 5 + 1 x 4 x 5 = +55%.

 

This is the kind of math everyone should be comfortable doing in their head, quickly, on the fly. If you are not, I think this is an excellent opportunity to teach yourself something that should be a basic skill for everyone in a modern civilization. Seriously.  This is the kind of arithmetic you should be using everyday while shopping. Or playing D&D. B)

Reply #19 Top

I am saying place the building, drop it down, double click the square. Just as soon as I do that it should be able to calculate the new "proposed" total. THAT IS WHAT I WANT.

 

I then want to "Destroy" the building and check it against the other type to see which one will produce more when I place it. Not sure how this is so hard to understand.

 

I am NOT saying hover over, think about placing select a build, no PLACE IT...

Reply #20 Top

But your ask doesn't meaningfully reduce the amount of coding, except for the initial UI work of "hover".  All the rest of the work I outlined still has to be done.

Still have to maintain the new Planet Object (or modify the existing one). Still have to create a new UI element for the display of the information. Still have to figure out if you calculate for one building or multiples. Etc....

 

This is a case where it sounds easy, but the coding requirements aren't.

 

Reply #21 Top

Trim2u ? How so.

Currently doesn't the game TOTAL the current manufacturing? Isn't that the number bottom left corner? Manufacturing 23.0??????

So they already have code which totals a planets values (once a building is built).

What I would like to see is when you place a building (place; not hover; not click -if you do nothing else in X rounds it WILL be built at which time it's total WILL be added to the planet total) It puts another set of numbers under the numbers currently shown (or maybe next to them - placement location really doesn't matter to me) which shows what the planet total WILL be when the building is completed.

So all they have to do is when you place a building, it runs the total crunching methods, which then shows you what the NEW total WILL be. Simple. In fact the UI work is probably the hard part- where to place, etc.

Reply #22 Top

Nope. Not that simple.  Note that I'm not saying it can't be done - it absolutely can be.  It's just that what you describe sounds very simple, but the implementation of it requires a significant amount of new code and changing existing code's behavior, which in turn increases complexity and requires significant testing to insure no ill side effects are unintentionally introduced.

First off, I'm guessing here about the code implementation, but it's reasonably straightforward so I shouldn't be off much.

Currently, there's a structure that holds the location of all the buildings on a planet. Each location likely has a flag, too: Built/Not Built. The "Not Built" flag is for stuff in the build queue. The current algorithm walks through the structure, doing all the calculations necessary, and ignores that buildings with the "Not Built" flag.  Later, the "builder" function runs at the end of the turn, looks at the Build Queue, and calculates if the top building is finished. If so, then it changes that building's flag to "Built". Rinse, Repeat.

Now, for your feature, I have to modify that structure-walker to not only count the "Not Built" building, but then go over to the build queue and figure out which of those "Not Built" buildings is next, so I can display the calculation based on using just that one additional building.  And NO, you can't say "well, I only want to see it for the building I just placed", because that would absolutely destroy the concept of the build queue by forcing only one building to be placed at a time. You'd also have to build in sufficient code to handle when someone reorganized the build queue.

The problem boils down to this:  you're assuming just a single instance:  nothing in the build queue, placing just one new building, and asking for the computation to be done to show the projection.  We can't support that. The General case has to be solved instead, which involves multiple buildings in the queue, possibly being reordered.

You can't put sufficient constraints on your feature without avoiding a general-case solution, because we want to support the general case of having a build queue.  In addition, the "Hover" feature is programmatically no different than what you're proposing; you do the exact same amount of work trying to keep track of what's being built, what isn't, and how that impact everything. That is, your ask is no less complex than the Hover feature, it just does it only once rather than as you move the mouse over the spaces.

The end result is that you're doing far more than just issuing a recalculation on the "new" building map. It's a whole lot of new code that touches multiple parts of the system. Little of it involving the new counting, but lots of it handling the extra bits of information and decisions that need to be made to set up things for the counting in the first place.

---

All this is a bit academic, because, frankly, the feature doesn't provide much of anything in additional information to the user.  It's not really relevant that you know Planet X produces 96 rather than 95 manufacturing. That is, the absolute number is useless (unless you're doing completely idiotic levels of micromanaging, in which case GC3 should NOT indulge that behavior).  What you're interested in knowing is approximately how much it improves. Particularly so you can chose between improvements and/or locations. What you're after is figuring out whether putting building X in location Y is better than putting building W in location Z.  All this feature does is provide a bit of a crutch; it doesn't actually address the "optimal building" placement problem.

Like I said above, this is a feature better suited to human brainpower, as it can do the rough calculations far faster and easier than the computer can, because the computer is trying to solve the general case (since it cannot be told to only limit itself), and all you care about is the specific instance.

Reply #23 Top

Quoting trims2u, reply 22

All this is a bit academic, because, frankly, the feature doesn't provide much of anything in additional information to the user. It's not really relevant that you know Planet X produces 96 rather than 95 manufacturing. That is, the absolute number is useless (unless you're doing completely idiotic levels of micromanaging, in which case GC3 should NOT indulge that behavior).
This.

Using trims example above: 4 factories, another factory or antimatter pp: The added benefit is the difference of 55% (90% if you upgrade the factory to the max) or 60%, which makes a difference in total manufacturing in 145% and 150% or if all factories are max upgraded: 290% and 320%. This shouldn't be costing you the game or anything. You really can ignore it if this is too hard (or simply not fun) for you.

Quoting trims2u, reply 22

All this feature does is provide a bit of a crutch; it doesn't actually address the "optimal building" placement problem.
As soon as you are considering durantium refineries and population, too, this feature really starts to fall apart, because at low population durantium refineries (thulium data archives/promethion reserves) are favored, but soon your population will grow and something else might have given you a higher benefit.

And you are still not considering, what trims said in the very beginning, that a greedy algorithm (take the highest bonus at every step of the way, as your feature would motivate to do) does still not produce ideal end results.

TL;DR: stop min-maxing if you don't like doing calculations, you are mising nothing. Don't use anti matter power plants, you will be fine.

(btw, the planet in your pictures above would profit a lot mre from some more populations and starbases around it, this is how you really make it a monster)

If you are min-maxing considering population I might be inclined to help you with the math, because this is about finding the zero of a parabola (still not university math, hence not complex in my opinion). But I won't help you with counting and multiplication. As trim2u said, consider it an exercise you can do along with your hobby (there is no better exercise).

Reply #24 Top

double post, pls delete, sry