Loading...
  OR  Zero-K Name:    Password:   

Overdrive, Underdrive and Quantum Mechanics

28 posts, 2355 views
Post comment
Filter:    Player:  
Page of 2 (28 records)
sort
In this thread it has been revealed by Skasi (actually already 2011) and proven by mostly GBrankTheEloIsALie that current overdrive energy distribution is not ideal. Currently OD energy is distributed proportional to squared mex rates as far as the grid allows it. Connecting mexes can reduce total metal rate, which should actually be avoided by the system in any case.

1. Ideal Solution

GBrankTheEloIsALie calculated the ideal distribution of OD energies (e_1,...,e_n) in a grid with n mexes with base rates (m_1,...,m_n) and OD energy E. (I use the same variables as GBrankTheEloIsALie and add some more.) Total mex rates are M_i=gamma(e_i)*m_i with the "Lorentz-factor" gamma(e_i)=sqrt(1+e_i/4).
Current distribution is
e_i=E*m_i²/p, where p=sum_i(m_i²).
If the grid doesn't provide as much energy as it "wants", it gets its maximum and the rest has to be recalculated.
The easiest representation of GBrankTheEloIsALie's ideal solution is
e_i = m_i²*q/p - 4, where q = E + 4n.
I have proven that it is correct, so if you want to see a proof.. The problem is now that it can produce negative e_i. Those e_i have to be set to 0 and the rest must be recalculated. Thanks to GBrankTheEloIsALie the recalculation is not needed, when "you go through the mexes in ascending order of base income and (...)(i)f that e_i is negative, you subtract m_i² from p and 4 from q and continue." If a mex' e_i is not negative, you can be sure that all following mexes' e_i are not negative, too. The current recalculation when grid is maxed is also needed. Former concerns about the algorithmic efficiency of the ideal solution because of many square roots or recalculations have been eliminated.

I had a look at the source code and it seems as if overdrive does obey emp and disarm, but not slow dmg. Something like "orgMetal*=spGetUnitRulesParam(unitID,"slowRate")" or else should be written there in line 725 and 755 and maybe others. How can allyTeamMexes be sorted by orgMetal after emp, disarm and slow have been applied and then used in another for-structure? Then you only need to replace current
"mexE = allyE*(orgMetal * orgMetal)/ allyMetalSquared"
by the ideal solution and check if you have to change p and q. Maybe you can save a little if you first check if orgMetal of current mex = orgMetal of previous mex, because this will often be true. Then you can just use e_i of previous mex and if it's 0, change p and q.
(Btw why is there "1+mexE/5" instead of "energyToExtraM(mexE)" in lines 761 and 795?)

2. Underdrive

When I thought about how to reduce recalculations and sortings due to negative OD energies e_i in GBrankTheEloIsALie's solution, a really crazy idea came to my mind: Why not leave negative e_i as it is? Call it underdrive. This would only require replacing
"mexE = allyE*(orgMetal * orgMetal)/ allyMetalSquared" by
"mexE = (allyE+4*allyTeamMexes.number())*(orgMetal * orgMetal)/ allyMetalSquared - 4" (not sure about .number())
In most cases it would make no difference. Only when small and big mexes are connected in a grid with low energy, small mexes would be underdriven to provide a little OD energy for the big mexes. The theoretical maximum for the underdrive energy a mex can provide is 4, but usually it will be lower. This could give pylons a little more use, but building generators instead will still be better.

3. Symmetrization

Negative e_i is only possible, because negativity of e_i is not equivalent to negativity of the OD Lorentz-factor's radicand gamma(e_i)=sqrt(1+e_i/4). This can be changed with a symmetrization of the OD function gamma_b(e_i):=1+b*sqrt(e_i), where b is a constant factor that determines the effectivity of OD, for example b=0.3. I found the ideal solution for this and it is exactly the currently implemented solution independently of b! So you would only have to change
"return -1+sqrt(1+(energy*0.25))" in line 256 to
"return b*sqrt(energy)" with a certain b.
This would also solve the problem of extreme OD being too effective atm as it would make low OD more effective and high OD less effective than currently without introducing more complex functions than sqrt (like log). b could also be changed at any time for balance reasons. The break even point of energy, where current OD becomes equally efficient as symmetric OD for a single mex, is at e_i= 4b²/(b²-1/4)² or b=(sqrt(1+e_i/4)-1)/sqrt(e_i).

4. Quantum Mechanics

The whole calculation and especially how adding an assymetry term to the energy (which means the existence of mass in a relativistic sense) creates antimatter (underdrive) reminds me a lot of relativistic quantum mechanics. In the early times of quantum mechanics people also struggled a lot for eliminating the negative energy (underdrive) until they finally had to accept that antimatter exists. The symmetrization is the non-relativistic approximation. It is interesting that the current solution solves the "non-relativistic" approx.

So which of the 3 systems do you prefer? The lower a system's number, the less elegant and more difficult to implement (if not too much) it is, but closer to the current system.
+7 / -0

9 years ago
My expression when seeing the wall of text.

+6 / -3
Here you can see some examples:

One of the most extreme but still realistic examples for underdrive is a grid with m_1=1, m_2=3, E=0. Here the smaller mex transfers 3.2 energy to the bigger one. The smaller one only works at 45% while the bigger one works at 134%. Together they produce 4.02+0.45=4.47 metal compared to 4 normally.

Let's look at a grid with m_1=2, m_2=3, E=2:
Old system: e_1=0.62, e_2=1.38, M_1=2.15, M_2=3.48, M=M_1+M_2=5.63
Ideal: e_1=0, e_2=2, M_1=2, M_2=3.67, M=5.67
Underdrive: e_1= -0.92, e_2=2.92, M_1=1.75, M_2=3.95, M=5.70
Symmetric (b=1/4): e_1=0.62, e_2=1.38 (like old), M_1=2.39, M_2=3.88, M=6.27

Maybe b has to be reduced. Probably b=0.2 would be better. This is closer to the current system for low OD and improves the balance of singu spam in team games a bit. (b=0.16 would be even closer, but maybe high OD becomes too inefficient then.)

Here you can see a graph of current gamma(e_i)=sqrt(1+e_i/4) and symmetric gamma_(b=1/4)=1+sqrt(e_i)/4.
+0 / -0
Skasi
I vote against Underdrive.

[jealous]Pff of course now GBrankTheEloIsALie gets all the praise, even though I reported the bug back in 2011. QQ[/jealous]
+3 / -0
I know you reported it Skasi. The bug wasn't too easy to find, just like the ideal solution. If you and GBrankTheEloIsALie didn't had found it, other people would have done so some months later (like me, but I was too late :P). I do respect you for having found it xD.

I don't vote for a specific system of the 3. They are all good, especially compared to the current one. The higher numbered ones are definitely more elegant, but I guess people will prefer what is closest to the current one, even though the symmetric one has its advantages, too.

Note that any system must use its ideal solution (which the current one doesn't). Otherwise you can always find cases where building pylons reduces total metal rate (needs general proof).
+0 / -0
9 years ago
I vote for underdrive

It has many merits
1. Easy to Understand
2. I think it's easier to implement compared to the other 2
3. It encourages aggression and securing high yield mexes even more to get that incredible boost in economy if quickly connected to grid
+0 / -0
Voting for Symmetrization. It's how the system was actually meant to work (zerg's proof etc.) seeing as it also makes high OD less efficient (@Licho noted recently that extreme OD is more effective than expected).

Against underdrive.
quote:
1. Easy to Understand

"wtf, this mex stopped making metal after adding it to the grid"
quote:
3. It encourages aggression and securing high yield mexes even more

Like if ubermexes weren't encouraged enough. If they are in the middle they're super slippery slope and everywhere else they're easy to porc and ovedrive.

quote:
it seems as if overdrive does obey emp and disarm, but not slow dmg

Obedience is the current behavior.

quote:
Btw why is there "1+mexE/5" instead of "energyToExtraM(mexE)" in lines 761 and 795?

This is used for graphics only.
+3 / -0
Nice that we have supporters of different systems here.

quote:
2. I think it's easier to implement compared to the other 2
It (Underdrive: 2+ lines) is easier to implement than the ideal solution (15+ lines), but not easier than symmetrization (1 line).

quote:
Obedience is the current behavior.
So "mexincomefactor" includes slow rate?

quote:
This is used for graphics only.
Thought so. Is it for the up and down movement and "thisMexM" for rotation speed? Nice to see that rotation speed is approximately proportional to the square root of kinetic energy then.
+1 / -0

9 years ago
quote:
So "mexincomefactor" includes slow rate?

Yes.
quote:
Is it for the up and down movement and "thisMexM" for rotation speed?

It is for the glow graphics. Both up/down and spinning are controlled by the actual extraction rate (thisMexM), ie. are proportional to sqrt(E) but also mex base income.
+0 / -0
9 years ago
Why is all the scientific names, where can I learn this stuff?
+0 / -0
Lynx
9 years ago
Of fundamental importance surely is the rationale underlying overdrive being sqrt(1+e_i/4). Is this truly the most appropriate multiplier to give the desired effect? Should overdriving 1 +10 mex really be superior to overdriving 5 +2 mexes? Somehow this feels odd to me; shouldn't giving speed to 5 monkeys produce a greater effect than would giving speed to the 1 large monkey having the same weight as the five? Shouldn't the exacerbated plurality yield more than the exacerbated individual having the same unexacerbated yield?
+0 / -0
This is a consequence of energy being distributed among the mexes with E=||evector||_1=sum_(i=1)^n(e_i). Another possibility would be giving every mex in the grid the whole OD energy E=e_i forall i in |N intersection [1, n]. Or general s-norm distributions like E=||evector||_s=(sum_(i=1)^n((e_i)^s))^(1/s) with s>1 to make concentrations of energy to single mexes less effective.

gamma must be a concave function so that OD becomes less efficient (for example gamma(e_i)=sqrt(1+e_i/4)). This is to prevent the possibility of exponential economic growth without map control expansion. However it does not prevent convex economic growth, it only limits it from exp to exp(gamma). gamma would have to be of logarithmic or lower order to prevent convex eco growth totally. This must also be considered in the current ROI discussion. A player can grow with exp(gamma) in communism and ROI alike. Communism only adds a constant coefficient 1/N, where N is the number of players in his team.
+0 / -0
I will answer some questions about the basic requirements of the system.

Lynx has raised the question "why do large mexes have to be more valuable for OD?". I suspect the answer goes back to cloud metal map, I don't remember though because I do not think I was in development when OD was added. With the old metal system you could perch many mexes on a single mex spot and they would each receive a portion of the income. If this perching resulted in a higher OD income then that would be an easy way to game the system.

Mex perching is impossible now that we have a snapping mex placement system so that limitation no longer applies. It would be feasible to make OD treat every mex as if it had equal income. This would make the code simpler but intuitiveness issues would remain the same. This leads to the broader question "Should base mex income vary?".

I think base mex income should vary. With the current OD equation variable mex income can be used to regulate the effectiveness of OD on particular maps. High mex income can make a part of the map important but only if you get the infrastructure up to overdrive it. This is used for center mexes on many maps. To support this I think that OD should be more valuable on large mexes.

Fixing the OD equation aligns with the aims of the OD system because there should be no ways to reduce your income by adding pylons.

1. Ideal Solution

I have said the ideal solution can be implemented as long as it is not done naively. The naive solution would be the stop and re-loop when a mex is found to have negative income. I do not want to add more loops.

2. Underdrive
Underdrive would imply that mexes can 'burn' their output to produce up to 4 energy. This energy can only be used on OD. I do not think that this mechanic makes any sense intuitively. Furthermore it is not as easy to implement as it sounds because the UI would need to support negative OD and subtracting metal income is not as simple as adding a negative amount.

3. Symmetrization

This is sqrt(e)/4. My worry here is that it buffs spread solar spam and nerfs high energy OD.

Look at high energy OD. Each number is how much energy you need for an extra mex of income.
Old: 12, 32, 60, 96, 140
New: 16, 64, 144, 256, 400
Overdrive rapidly becomes a bad idea.

Rescaling does not independently fix this change because the low end is already significantly buffed. If each mex has 4/3 energy then they would have %15 OD under the old system and 29% OD under the new system. If you only OD half your mexes for 8/3 energy each you would get 29% OD on them under the old system so it is barely worth connecting them. On the other hand with the new system you would get 41% OD so there are definite gains to be made from putting small amounts of energy next to every mex.

These changes are not necessarily bad. They are just things that have to be discussed under balance and game flow instead of under the guise of a small fix.
+3 / -0
Of course symmetrization is a change to balance. You calculated with b=1/4 here. I said this is probably too high and about 0.2 could be better. I thought it was the idea of OD that it becomes less efficient. Currently efficiency growth is a bit too close to linear maybe. High OD energies can still be very effective when enough mexes are connected. But of course this must be reviewed carefully. Maybe the payback times for certain sets of high energy generators in certain grids could be compared for the different systems (and with different b) to see if symmetrization limits OD efficiency too much in practical situations.
+1 / -0
While I was seeking help with understanding the OD gadget in #zkdev, ATrankhokomoko (and me) started theorizing about other ways that OD could be calculated in grids.

One of those was that grids overdrive by taking total e in the grid and total m in the grid into a single formula (which could differ from the current one). We got lost trying to establish properties of OD functions that would yield undesired behavior ("connecting grids leads to less OD") though. And then I had to leave for vacation. Maybe ATrankhokomoko thought of something in the meantime.

This would be another way in which OD could be changed ("how grids work"), if we're at revamping things.
+0 / -0
Yes, this is partially considered by generalized norms for the energy vector (in your example: infinity norm) explained in the first paragraph of this post and the first two paragraphs of this post. Further calculations can be done on this. Note that finding the ideal solution for concave gamma with s-normed energy vectors requires equality of derivations with respect to (e_i to the power of s).

For the infinity norm E=||evector||_infinity however, math becomes much easier, maybe too easy. Then every mex would get the whole grid energy and no optimization would be needed. But then gamma would have to be changed and also depend on m=||mvector||_1 (the grid's total base metal rate) and be not only concave in e_i, but also in m so that connecting doesn't become too powerfull. I have to think about grid connection monotony.

Maybe you want to try it with other norms. You don't even need to change the energy norm. You can also make gamma concave in ||mvector||_s.

But implementing this will be more work than 1 line for symmetrization.
+0 / -0


9 years ago
After some discussion we are going to go with sqrt(energy)/4 to also test out the nerfed high end overdrive.
+2 / -0
"Note that finding the ideal solution for concave gamma with s-normed energy vectors requires equality of derivations with respect to (e_i to the power of s)."

I am sure it's only a show-off. These concepts are not actually used in ZK.
+0 / -0

9 years ago
Some of that technobabble makes sense even at a glance (sqrt is concave, optimal OD solution does require equal derivatives of dM/dE) so I assume that the physical terms are due to the mathematical interpretation of OD being the same as some existing physical models (in this case it seems that metal and energy are somehow analogical to relativistic mass and energy - which would be especially understandable since DErankBrackman comes from SupCom where metal is called mass).
+0 / -0
I find it fascinating to see that this game has an actual beefy math content.
+0 / -0
Page of 2 (28 records)