Formula for SPP Cycle Time / Suns

The place to discuss scripting and game modifications for X³: Terran Conflict and X³: Albion Prelude.

Moderators: Moderators for English X Forum, Scripting / Modding Moderators

User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Formula for SPP Cycle Time / Suns

Post by Litcube »

Does anyone know the exact formula? Can anyone spot the relationship? It's non-linear:

Code: Select all

Suns    Cycle Time (Seconds)
0	     305
100	   239
150	   215
200	   196
250	   180
300	   166
350	   155
400	   145
450	   136
500	   128
User avatar
jocan2003
Posts: 629
Joined: Tue, 6. Mar 07, 17:48
x4

Post by jocan2003 »

Make me think of a diminshing return
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Got it.

Notes on constants:
533 = Production of size 1 solar power plant in a 100% sector
3600 = Seconds in an hour
239 = Cycle time of 100% sector as a base
900 = production of a x1 ware based on 4 relval per hour if it wasn't energy

Therefore:

constant a = (3600/239)*553

b = [ a/900 ] + [ (Suns / 50) -2 ]

Cycle time = INT( 3600 / [ (900*b) / 553 ] )

EDIT: typo



Edit: I have a rounding error somewhere
Last edited by Litcube on Fri, 17. Dec 10, 22:23, edited 1 time in total.
User avatar
jocan2003
Posts: 629
Joined: Tue, 6. Mar 07, 17:48
x4

Post by jocan2003 »

Oh boy for me 2 and 2 =22 your math are way over my limited knowledge haha
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

I'm wrong. Something's off once I hit 850 suns, but up until then, it'd disturbingly accurate...
User avatar
jocan2003
Posts: 629
Joined: Tue, 6. Mar 07, 17:48
x4

Post by jocan2003 »

Hardcoded up to 800 maybe?

Didnt really check with sun% but man you did find it! thats great :D even if its only accurate to 800 higher than that better place the SPP straight in the sun orbit! hehe
Last edited by jocan2003 on Fri, 17. Dec 10, 04:58, edited 1 time in total.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Hrm. Oddly, it is hardcoded after a certain point, which is good news. Even if we don't have the formula, at least we have a lookup table that will cover every possible combination up to the hardcoded 2100% sun:

Code: Select all


Begin Log
Sun   Cycle   Products Per Cycle
0	  305	1106
100	239	1106
150	215	1106
200	196	1106
250	180	1106	
300	166	1106	
350	155	1106	
400	145	1106	
450	136	1106	
500	128	1106	
550	121	1106	
600	114	1106	
650	109	1106	
700	104	1106	
750	99	1106	
800	95	1106	
850	91	1106	
900	87	1106	
950	84	1106	
1000	81	1106	
1050	78	1106	
1100	75	1106	
1150	73	1106	
1200	70	1106	
1250	68	1106	
1300	66	1106	
1350	64	1106	
1400	62	1106	
1450	61	1106	
1500	118	2212	
1550	114	2212	
1600	112	2212	
1650	108	2212	
1700	106	2212	
1750	104	2212	
1800	102	2212	
1850	98	2212	
1900	96	2212	
1950	94	2212	
2000	92	2212	
2050	90	2212	
2100	90	2212	
2150	90	2212	
2200	90	2212	
2250	90	2212	
2300	90	2212	
2350	90	2212	
2400	90	2212	
2450	90	2212	
2500	90	2212	
2550	90	2212	
2600	90	2212	
2650	90	2212	
2700	90	2212	
2750	90	2212	
2800	90	2212	
2850	90	2212	
2900	90	2212	
2950	90	2212	
3000	90	2212	
3050	90	2212	
3100	90	2212	
3150	90	2212	
3200	90	2212	
3250	90	2212	
3300	90	2212	
3350	90	2212	
3400	90	2212	
3450	90	2212	
3500	90	2212	
3550	90	2212	
3600	90	2212	
3650	90	2212	
3700	90	2212	
3750	90	2212	
3800	90	2212	
3850	90	2212	
3900	90	2212	
3950	90	2212	
4000	90	2212	
4050	90	2212	
4100	90	2212	
4150	90	2212	
4200	90	2212	
4250	90	2212	
4300	90	2212	
4350	90	2212	
4400	90	2212	
4450	90	2212	
4500	90	2212	
4550	90	2212	
4600	90	2212	
4650	90	2212	
4700	90	2212	
4750	90	2212	
4800	90	2212	
4850	90	2212	
4900	90	2212	
4950	90	2212	
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

On a guess, I took the inverse and made a graph of Suns vs inverse cycle time, and it is pretty much perfectly colinear (up until the hump, but then if you adjust for *2, it is fine)


I suspect, the hard coded issue, may be something related to integerish issues.




Yes, it looks very linear (Also the patter of the smoothing seems to suggest it is just rounding errors - until the constant numbers)

And using a browser regression tool:

y = 1.017851107·10-2 x + 3.556046392
Y is ... 1/cycletime/products
X is suns (as an integer)


Hmmm... Thou the 90.. I do find that strange (perhaps 90 is some base number?)
Last edited by s9ilent on Fri, 17. Dec 10, 07:28, edited 1 time in total.
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

Hm. Neat. Can you write that in a formula to get the cycle time and products per cycle?
User avatar
s9ilent
Posts: 2033
Joined: Wed, 29. Jun 05, 01:45
x4

Post by s9ilent »

I could.. but eh.. lazy :S (It's only just 5 oclockish and I'm brain dead.. can't inverse functions :S )

I really don't know about the products (I had always assumed it was a constant until I saw this)



I'll try to get the time.. let see...
Yeah.. brain fail :( ill try again tommorow :S
User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 »

Your formula is almost correct. Use 553, instead of 533. Then, to calculate the number of products produced use: simply multiply 553 * the SPP factory size, i.e. M = 2, L = 5, XL = 10. I'm not sure why at 1500 the cycle time & qty produced doubles, but the formulas will give the same result.
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

That was a typo (now fixed). The formula still isn't correct. The cycle times in the formula slowly drop below real levels as you approach higher numbers.
User avatar
em3e3
Posts: 2245
Joined: Tue, 15. Aug 06, 00:04
x3tc

Post by em3e3 »

Not according to Excel. :) Numbers are spot on, except for 0% suns (304 instead of 305) and any sun percentage > 1450. At that point, the Cycle and Products Per Cycle numbers in your table are exactly double what mine are.

Also, I simplified your formula, now that you did all the hard work. :D

Code: Select all

INT ( 2212 / ( 2212/239 + suns / 50 - 2 ) )
8^)

Online Complex Calculators - X3:TC • X3:R • X2
Online Ship Compurator - X3:TC
jlehtone
Posts: 22486
Joined: Sat, 23. Apr 05, 21:42
x4

Post by jlehtone »

em3e3 wrote:I'm not sure why at 1500 the cycle time & qty produced doubles, but the formulas will give the same result.
That you should guess from the Mines: Cycle time would fall below 60 sec, so they double everything.

Nice work in any case. 8)
User avatar
Litcube
Posts: 4254
Joined: Fri, 20. Oct 06, 19:02
xr

Post by Litcube »

What the bloody hell. You (I) are (was) right. I spent hours yesterday smacking my head against my desk over this. I wonder where I went wrong.


Edit: Just like mines, the entire formula if multiplied by INT(59.9/result)+1

Return to “X³: Terran Conflict / Albion Prelude - Scripts and Modding”