Jump to content
XCOMUFO & Xenocide

Starting Funding


stewart

Recommended Posts

Must... have... more... numbers!  =b

 

- Zombie

 

Roger that. I made some minor tweaks to my setup that should allow it to run longer without crashing.

 

Sometimes the monitor program chokes trying to read the save file. If this is a problem for you, I have a new version. However I am not sure my fix is stable so I won't post it if your not having trouble.

Link to comment
Share on other sites

  • Replies 148
  • Created
  • Last Reply

Top Posters In This Topic

I haven't had a chance to run some automatic trials yet, but I will let you know if I encounter any trouble. :)

 

Zombie can you give us a present breakdown of the stats per total.

 

ie when total = 5985 to 6015. Also what is the n for each of these totals; are some more likely than others?

Okay my first calculation was just determining n for each funding level. Some surprising results to show (please scroll down the codebox, I didn't want to clutter my post with a huge table):

 

Funding     Count
 5985       608
 5986       599
 5987       651
 5988       634
 5989       652
 5990       648
 5991       605
 5992       657
 5993       654
 5994       647
 5995       713
 5996       642
 5997       670
 5998       673
 5999       646       647

 6000      1705 

 

I'll try and crunch some more numbers tonight concerning the funding ranges for each country when based on the world funding. :)

 

- Zombie

Edited by Zombie
Link to comment
Share on other sites

I think this represents a "fudge factor", let me think on it for the implications and what it is saying; I'd sure like that country-by-country data though, then at each level the fudge factors contribution on the data is minimized.

 

Well I can think of explanations for most of it, but the 6000k one escapes me; I'm scratching my head on that one.

 

I'm thinking that my termination test /might/ not reach equilibrium at 0 because of a possible "fudge factor". Unfortunately it /may/ be nessessary to conduct the same test on a per-funding-level basis, in order to eliminate the fudge factor. These tests would then be expected to converge at 0.

 

What do you think?

Link to comment
Share on other sites

Who? Those interested in numbers, obviously. They can go great lengths for the sheer sake of accuracy - even though there may sometimes be easier ways to find these answers.

 

I'm a simpleton who's more of a min-max person myself. I lost the plot after "What are the...". ;)

 

- NKF

Edited by NKF
Link to comment
Share on other sites

I hate to be a killjoy, but...

 

 

Who cares?

Well, I do. Granted, this information is not vital to normal players. But then again, I'm certainly not normal. ^_^

 

Edit: And why, Zombie?

Please see the second post in this topic. I pretty much spell out the reason why. :wink1:

 

- Zombie

Link to comment
Share on other sites

Who? Those interested in numbers, obviously. They can go great lengths for the sheer sake of accuracy - even though there may sometimes be easier ways to find these answers. 

 

I'm a simpleton who's more of a min-max person myself. I lost the plot after "What are the...".  ;)

 

- NKF

 

 

For me its the technical challenge.

Here is a .zip goodie bag.

 

http://www.darksun.lunarpages.com/XCOM/scr...XcomFunding.zip

  • D3Dwindower included
  • compile version of AutoIt script included
  • text version of script if you don't want to run an exe from a stranger
  • New script gives the option once a cycle to end it.
  • New script somewhat resistant to programs that steal focus, or cat clicks with the mouse. (Both of which I had problems with)

Just copy the files into a new copy of UFO Gold Edition. Start my other program pointing at game_10, the run the script.

Link to comment
Share on other sites

Thanks, SaintD. :)

 

Can't really do anything right now as I am still crunching numbers for stewart. After that I might just dedicate some processor time. =b

 

- Zombie

Link to comment
Share on other sites

Thanks, SaintD.  :)

 

Can't really do anything right now as I am still crunching numbers for stewart. After that I might just dedicate some processor time.  =b

 

- Zombie

 

 

You won't be doing it for me. As I recall I was doing this for you and Stewart.

 

We need to lure some more peeps into this party.

:happygroup:

Link to comment
Share on other sites

  • 2 weeks later...

N would now be... 81,268! Only 18,732 more values till 100,000! Thanks for the numbers SaintD. :P

 

Looks like I have a bunch more numbers to crunch now. Without those extra values, my Excel file is now close to 8MB! Adding those extra values and it's up to 22MB. LOL

 

- Zombie

Link to comment
Share on other sites

You may have to split into and excel file for each funding level; does excel have file size problems?
Link to comment
Share on other sites

  • 2 weeks later...
N would now be... 81,268! Only 18,732 more values till 100,000! Thanks for the numbers SaintD. :P

 

Looks like I have a bunch more numbers to crunch now. Without those extra values, my Excel file is now close to 8MB! Adding those extra values and it's up to 22MB. LOL

 

- Zombie

 

18,732? How about 31,087 in funding10.csv?

 

 

Does excel have file size problems?

 

Not really.

 

-D

Edited by SaintD
Link to comment
Share on other sites

18,732? How about 31,087 in funding10.csv?

Sure, the more, the merrier. 112,355 values should hopefully be enough. And now, let the number crunching begin. :)

 

- Zombie

Link to comment
Share on other sites

Tired? Never. I have been working on this project for over 2 years now. That's longer than some people have even played the game. Any type of progress in this stage is always gratifying - be it 1 more value or 31,087. It all brings us one step closer to a better understanding of how countries fund. =b

 

- Zombie

Link to comment
Share on other sites

Tired? Never. I have been working on this project for over 2 years now. That's longer than some people have even played the game. Any type of progress in this stage is always gratifying - be it 1 more value or 31,087. It all brings us one step closer to a better understanding of how countries fund.  =b

 

- Zombie

 

 

Zombie, you are the craziest person I have even done a project with . Please crunch us up some numbers so I can know if I need to do another 100K or we can move on to the next crazy project.

 

-D

Link to comment
Share on other sites

Zombie, you are the craziest person I have even done a project with . Please crunch us up some numbers so I can know if I need to do another 100K or we can move on to the next crazy project.

I'l' take that as a compliment. :Hyper:

 

Anyway, I'm working on it right now. Will let you know ASAP if more trials need to be done. :D

 

- Zombie

Link to comment
Share on other sites

You may have to split into and excel file for each funding level; does excel have file size problems?

Turns out, yes it does. The max is 65536 lines or 2^16. Looks like I'll need to break it down as 100k+ lines won't load. LOL

 

Edit: Nevermind, I'll sort in stages by funding level then stick those numbers in their own worksheet. :)

 

- Zombie

Edited by Zombie
Link to comment
Share on other sites

  • 1 month later...

Over the next few days I'm going to be dumping lots of numbers here as they are calculated. For the first analysys, I sorted by total funds received. So far, all I have is a breakdown according to n and funding level:

 

Funding     Count     Percent
 5985       2556       2.24
 5986       2589       2.27
 5987       2542       2.23
 5988       2654       2.33
 5989       2621       2.30
 5990       2648       2.32
 5991       2620       2.30
 5992       2643       2.32
 5993       2704       2.37
 5994       2622       2.30
 5995       2694       2.36
 5996       2676       2.35
 5997       2663       2.34
 5998       2682       2.35
 5999       2707       2.38
Average     2641       2.32   n=39621, 34.77%

 6000       7717       6.77

 6001       4499       3.95
 6002       4484       3.94
 6003       4416       3.88
 6004       4406       3.87
 6005       4451       3.91
 6006       4398       3.86
 6007       4462       3.92
 6008       4456       3.91
 6009       4385       3.85
 6010       4473       3.93
 6011       4483       3.93
 6012       4388       3.85
 6013       4513       3.96
 6014       4400       3.86
 6015       4396       3.86
Average     4441       3.90   n=66610, 58.46%

Total n = 113,948

As you can see, the average of 6000k happens 6.77% of the time which is 1.74 times more often than a fund between 6001-6015k and 2.92 times more often than 5985-5999k. Broken down even more, 6001-6015 happen 58.46% of the time, the average happens 6.77% and 5985-5999 is 34.77%. Interesting. :)

 

Next up is some more interesting (or should I say boring) numbers on a per-country basis at each funding level. Cheers! :D

 

- Zombie

Edited by Zombie
Link to comment
Share on other sites

Apologies, everyone. I must have transcribed some numbers in my last post as things were not coming out properly. Here is the revised table:

 

Funding     Count     Percent
 5985       2556       2.26
 5986       2589       2.28
 5987       2542       2.24
 5988       2654       2.34
 5989       2621       2.31
 5990       2648       2.34
 5991       2620       2.31
 5992       2643       2.33
 5993       2704       2.39
 5994       2622       2.31
 5995       2694       2.38
 5996       2676       2.36
 5997       2663       2.35
 5998       2682       2.37
 5999       2707       2.39
Average     2641       2.33   n=39621, 34.96%

 6000       7117       6.28

 6001       4499       3.97
 6002       4484       3.96
 6003       4416       3.90
 6004       4406       3.89
 6005       4451       3.93
 6006       4398       3.88
 6007       4462       3.94
 6008       4456       3.93
 6009       4385       3.87
 6010       4473       3.95
 6011       4483       3.96
 6012       4388       3.87
 6013       4513       3.98
 6014       4400       3.88
 6015       4396       3.88
Average     4441       3.92   n=66610, 58.77%

Total n = 113,348

Well, I spent around 4 straight hours this evening doing some massive number crunching on the funding numbers. Looks like this project may be coming to an end very, very soon. You heard me. Like maybe by the end of next week.

 

Why the sudden change? While crunching the reams of numbers, I began to recognize that certain patterns were developing. And patterns are my friend, as it means an in-depth statistical analysis is not necessary. (Makes sense too, as the programmers of the game usually kept things rather simple). After formulating a working theory, I took a closer look at the data. Indeed, it still held.

 

See the table above? My theory revolves around the info presented in it. I'll give a basic idea here, but just remember that this is still a theory yet. Funding numbers are not based exclusively off of a certain countries funding level. (For instance, France's funds are a fraction of the United States' funds.) Funding seems to be based off of a total first. A number is drawn according to the chances listed above: ~4% for 6001-6015, ~6% for 6000, and ~2% for 5985. Then each country has its contribution calculated according to the funding number drawn.

 

That's the "just" of it. More info on this will be presented if the next analysis holds. So far, so good though. *knocks on wood* Gotta love it when a plan comes together. =b

 

- Zombie

Link to comment
Share on other sites

Funding seems to be based off of a total first. A number is drawn according to the chances listed above: ~4% for 6001-6015, ~6% for 6000, and ~2% for 5985. Then each country has its contribution calculated according to the funding number drawn.

 

This seems like a very plausible way to program it. Especially since the total funding is always in such a narrow band. Also, in a previous message I conjectured "Maybe it has a pool of money that it randomly distributes to the countries".

 

Here is my current guess about how the code works, and it might help you find a pattern.

 

The countries are dived by the game something like this:

 

group 1, USA, Canada, Brazil, Austraila

group 2, Japan, China, Russia, India

group 3, S. Africa, Nigeria, Egypt, Italy

group 4, France, Germany, UK, Spain

 

Each country that is not bold is randomly assigned a value based on it's range of possible values. THEN the bold country is assigned the remainder of the funding +/- up to 8.

 

Canada = random(69, 214)

Brazil = random(265, 631)

Austrailia = random(253, 578)

USA = 1983 - (Canada + Brazil + Austrailia) + random(-8, 8);

 

And so on for the other groups.

 

-Dustin

Link to comment
Share on other sites

Here is my current guess about how the code works, and it might help you find a pattern.

 

The countries are divided by the game something like this:

 

group 1, USA, Canada, Brazil, Austraila

group 2, Japan, China, Russia, India

group 3, S. Africa, Nigeria, Egypt, Italy

group 4, France, Germany, UK, Spain

 

Each country that is not bold is randomly assigned a value based on it's range of possible values. THEN the bold country is assigned the remainder of the funding +/- up to 8.

 

Canada = random(69, 214)

Brazil = random(265, 631)

Austrailia = random(253, 578)

USA = 1983 - (Canada + Brazil + Austrailia) + random(-8, 8);

 

And so on for the other groups.

Good guess, but just from inspection of the data I can tell at least part of this is wrong. But once I/we have everything figured out, a quick search of the executable may yield more information on how it is formulated. That's my hope at least, as that will close the case on funding forever. :)

 

Don't worry stewart, help is on it's way. =b

 

- Zombie

Link to comment
Share on other sites

Here is my current guess about how the code works, and it might help you find a pattern.

 

The countries are divided by the game something like this:

 

group 1, USA, Canada, Brazil, Austraila

group 2, Japan, China, Russia, India

group 3, S. Africa, Nigeria, Egypt, Italy

group 4, France, Germany, UK, Spain

 

Each country that is not bold is randomly assigned a value based on it's range of possible values. THEN the bold country is assigned the remainder of the funding +/- up to 8.

 

Canada = random(69, 214)

Brazil = random(265, 631)

Austrailia = random(253, 578)

USA = 1983 - (Canada + Brazil + Austrailia) + random(-8, 8);

 

And so on for the other groups.

Good guess, but just from inspection of the data I can tell at least part of this is wrong. But once I/we have everything figured out, a quick search of the executable may yield more information on how it is formulated. That's my hope at least, as that will close the case on funding forever. :)

 

Don't worry stewart, help is on it's way. =b

 

- Zombie

 

I was just guess about the groups for one. Plus, who knows how the really did it. My programming style is pretty different from C programmers. I "grew up" on interpreted/JIT languages. C programmers code is usually more optimized for the machine than the metaphors of the problem (and a good thing since the machines were so slow and memory starved). I am always surprised at the way C programmers do things. It's never super clear what's going on, but it's usually very effecient.

 

Inspecting the EXE for how this works isn't trivial and is certainly not something I would be any good at.

 

-D

Link to comment
Share on other sites

Ok, I just pulled the ultimate mins and maxes from my data. Just excuse the parts missing (such as the averages). They will be added in due time. :wink1:

 

Country          Min      Max    Range
USA              558     1224     667
Russia           170      507     338
UK               182      530     349
France           254      679     426
Germany          193      549     357
Italy             96      369     274
Spain             75      332     258
China            192      534     343
Japan            344      844     501
India             83      350     268
Brazil           247      652     406
Australia        226      612     387
Nigeria          125      412     288
South Africa     259      663     404
Egypt             94      374     281
Canada            36      277     242

 

- Zombie

Link to comment
Share on other sites

Well, here is the latest table including the averages and fully updated min/max:

 

Country		  Min	  Max	   Ant Ave	 Act Ave
USA			  558	 1224		 891		 891
Russia		   170	  507		 339		 338
UK			   182	  530		 356		 353
France		   254	  679		 467		 473
Germany		  193	  549		 371		 368
Italy			 96	  373		 235		 233
Spain			 75	  335		 205		 203
China			192	  534		 363		 361
Japan			344	  844		 594		 592
India			 83	  350		 217		 218
Brazil		   247	  652		 450		 443
Australia		226	  612		 419		 413
Nigeria		  125	  412		 269		 264
So. Africa	   259	  670		 465		 458
Egypt			 94	  374		 234		 233
Canada			36	  277		 157		 158

World		   5985	 6015		6000		6002*
Sum			 3134	 8922		6028		6002
Diff		   -2851	+2907		 DNA		 DNA
Term				+56					  26

DNA = Does Not Apply

Diff = Sum - World

Averages are rounded to the nearest integer.

* = I haven't checked this one yet, but it should be really close to 6000-6002. The absolute difference would therefore be 27 +/-1. Will update this soon.

 

Ahem. See the +56 for the termination test? Yup, I saw it too. Not too good as it would imply there are more mins out there which add up to 56k less than 3134 (3078). In the long-term (think: n=1,000,000+) the termination test may be fine, but in the short-term it doesn't really fit the bill as there are absolutely more mins and maxes out there (yes, you heard me right). How do I know? Stay tuned for my next post where I will put up some very interesting numbers and introduce some theories which I have been hashing out for the past week or so. :)

 

- Zombie

Link to comment
Share on other sites

With the necessary formalities out of the way it is time to report some significant discoveries concerning funding. Before this is done however, let's review a bit. If you may remember, total funding distribution is broken down into 3 separate categories: 5985-5999k ≈ 2.33%/level, 6000k ≈ 6.28% and 6001-6015k ≈ 3.92%/level. So I made the leap of faith that since the distributions within those ranges are identical, then so should the funding range of each individual country. This was a key insight and after some number-crunching, it turned out to be true. Countries fund differently in those 3 categories. For instance, Italy contributes within a certain range when total funding = 5985-5999k, a different range when it is 6000k and another range when it is 6001-6015k. This means that instead of breaking funding down by 31 levels or 16 countries, you can focus your efforts on 3 categories which saves lots of time. :wink1:

 

Traditionally, everyone (including myself) tended to focus on the ultimate Min and Max a country could possibly fund. While this is fine for a general understanding, it doesn't actually solve anything. Breaking the total down into categories provides a better insight into how funding is determined. Now we all know what the ultimate Min and Max is. It is used every day by weathermen for reporting temperatures. Ultimate Min = the low temp for the day (a.k.a. the Minimum Min), while Ultimate Max = the high temp for the day (a.k.a. Maximum Max). There are also a couple other categories which are rarely reported: the Minimum Max and the Maximum Min (lowest high and highest low, respectively). My results will be reported as 4 columns (Min-Min, Max-Min, Min-Max and Max-Max), so be familiar with these methods.

 

I'd like to propose some additional nomenclature when dealing with these 4 columns. Max-Min and Min-Max will thankfully remain the same, while the Min-Min and Max-Max will get one of two descriptors: Floating or Capped. A "cap" is the defined upper or lower limit a range will reach, while something that "floats" does not seem to have a defined upper or lower limit. These are necessary to describe what is going on. (I prefer to use these names instead of "bounded" or "unbounded" as the latter term hints at a range which could reach infinity). So here are the numbers broken down first into 3 categories 5985-5999k, 6000k and 6001-6015k, and second by country and the max/min columns I proposed:

 

							 5985-5999k
		CAPPED							 FLOATING
Country	 Min-Min	 Max-Min	 Min-Max	 Max-Max
USA		   600		 604		1199		1224*
Russia		230		 232		 486		 507*
UK			240		 242		 505		 530*
France		320		 324		 657		 679*
Germany	   250		 254		 526		 549*
Italy		 160		 162		 356		 369
Spain		 140		 141		 316		 332
China		 245		 249		 516		 534*
Japan		 400		 405		 814		 844*
India		 150		 152		 331		 350*
Brazil		300		 303		 626		 652*
Australia	 280		 284		 579		 612*
Nigeria	   180		 183		 386		 412*
So. Africa	310		 312		 642		 663
Egypt		 160		 162		 352		 374*
Canada		104		 112		 257		 277*

			   6000k
	   FLOATING	FLOATING
Country	 Min-Min	 Max-Max
USA		   564		1214
Russia		184		 506
UK			200		 522
France		277		 667
Germany	   204		 536
Italy		  97		 373*
Spain		  86		 335*
China		 200		 520
Japan		 368		 829
India		  95		 334
Brazil		262		 635
Australia	 226#(Tie)   597
Nigeria	   133		 408
So. Africa	270		 670*
Egypt		 107		 350
Canada		 52		 272

						 6001-6015k
	   FLOATING							 CAPPED
Country	 Min-Min	 Max-Min	 Min-Max	 Max-Max
USA		   558#		583		1193		1199
Russia		170#		193		 457		 460
UK			182#		202		 477		 480
France		254#		288		 636		 640
Germany	   193#		207		 497		 500
Italy		  96#		111		 318		 320
Spain		  75#		 94		 278		 280
China		 192#		208		 485		 490
Japan		 344#		374		 796		 800
India		  83#		102		 297		 300
Brazil		247#		261		 597		 607
Australia	 226#(Tie)   249		 556		 573
Nigeria	   125#		136		 358		 360
So. Africa	259#		274		 614		 620
Egypt		  94#		115		 318		 320
Canada		 36#		 57		 219		 220

* = Ultimate Max
# = Ultimate Min

From these tables it is pretty obvious what is happening with the ultimate (floating) max and mins. If an ultimate max is going to occur, most likely it will show up when total funding is between 5895-5999k. Likewise, the ultimate min will usually happen when total funding is between 6001-6015k. In some instances the 6000k funding level will precipitate an ultimate min or max, but the probability is rather low. Why?

  1. If a range is floating at both ends it has a larger range and therefore a lower probability of spawning a min or max than a range which is capped at one end.
  2. Out of 100, there are 84.77 ways of getting a min when funding is between 6001-6015k and only 15.23 ways of hitting a min when funding is 6000k. By the same tolken, there are 90.35 ways of getting a max when funding is between 5985-5999k and only 9.65 ways of hitting the max when funding is 6000k. That's not to say that it is impossible to get an ultimate high or low when funding is 6000k, it all depends on the roll of the dice.

What may be surprising is the idea of localized capped mins and maxes. When you start to think about it though, it does make sense to set some limits at the outer boundaries so that the calculated range doesn't overflow (or underflow) the defined range. It is also handy to have a floating boundary as it can even out any significant highs or lows incurred during the calculation process.

 

As I said before, the ultimate mins and maxes just show the possible outer limits - not the definite limits. Therefore, capped mins and maxes are the only way to peer deeper into the actual mechanics of funding:

 

			CAPPED	  CAPPED
Country	 Min-Min	 Max-Max	 Range	 Average
USA		   600		1199		600		900
Russia		230		 460		231		345
UK			240		 480		241		360
France		320		 640		321		480
Germany	   250		 500		251		375
Italy		 160		 320		161		240
Spain		 140		 280		141		210
China		 245		 490		246		368
Japan		 400		 800		401		600
India		 150		 300		151		225
Brazil		300		 607		308		454
Australia	 280		 573		294		427
Nigeria	   180		 360		181		270
So. Africa	310		 620		311		465
Egypt		 160		 320		161		240
Canada		104		 220		117		162

See all those nice even mins and maxes? That was like gold for me. Searching for these values in the executable is possible and may even shed more light on the subject by editing. No luck yet, however. One thing is for sure though: the game is using either the actual mins and maxes I list, using just a min or a max and then modifying that number up or down by 50% for the other one, or it is only using the average and calculating the min and max by multiplying by 2/3 or 4/3. Any of these methods is possible right now. It may also be using percentages. As an example, when the United States has a max-cap within the 6001-6015k level, the average percentage is really close to 20%. (20% of 6001 is 1200.2 while 20% of 6015 is 1203. The difference between the two values is 2.8 or only 0.2%). Conceivably, the game could go as far as multiplying by a nice even number (think: 6000k) and ignore the actual range as the difference is insignificant. In any event, the capped percentages of the total would be the following:

 

			CAPPED	  CAPPED
Country	 Min-Min	 Max-Max	 Average
USA		 10.01%	  19.96%	  14.99%
Russia	   3.84%	   7.66%	   5.75%
UK		   4.01%	   7.99%	   6.00%
France	   5.34%	  10.65%	   8.00%
Germany	  4.17%	   8.32%	   6.25%
Italy		2.67%	   5.33%	   4.00%
Spain		2.34%	   4.66%	   3.50%
China		4.09%	   8.16%	   6.12%
Japan		6.68%	  13.32%	  10.00%
India		2.50%	   4.99%	   3.75%
Brazil	   5.01%	  10.10%	   7.55%
Australia	4.67%	   9.54%	   7.11%
Nigeria	  3.00%	   5.99%	   4.50%
So. Africa   5.17%	  10.32%	   7.75%
Egypt		2.67%	   5.33%	   4.00%
Canada	   1.74%	   3.66%	   2.70%

So how do I explain those uneven ranges for the United States, Brazil, Australia and Canada? Right now I'm leaning to integer rounding as that error is common throughout the game. It could also be the game attempting to get the necessary total funding level out of a partial list, but this seems unlikely as a floating boundary would take care of all problems.

 

This brings up another important question. Is there a "true" ultimate Min and Max, or are they completely unbounded? Well, after 113,348 trials I would expect to see some really high or low numbers popping up, but this never happened. This is what leads me to believe that a completely unbounded limit (or at least bounded by 0 for the min and 2^31 for the max) is not used. Most likely there is a true ultimate min and max for each country, probably determined from the capped min and max and further modified by a percentage. But this is only conjecture and needs to be researched. The final way to tell would be finding those percentages in the executable or running 886,652 more trials. I think most of you would agree that the executable is a better choice. For the sake of accuracy, I'll maintain that floating mins and maxes are used until this riddle can be solved.

 

With Zombie on the case, nothing is impossible or out-of-reach. I have been working on this project for over 2 1/2 years - either directly gathering numbers, formulating theories, consulting stewart for his expert opinions or analyzing reams of mind-numbing data. All this work seems to have finally paid-off big-time as we now know quite a bit more about how funding is determined. Hopefully the smaller questions can be answered so this baby can finally be put to rest. B)

 

- Zombie

Link to comment
Share on other sites

I need to chew on all of this Zombie, but great job.

 

Could you please post the numbers for every funding level though please.

Link to comment
Share on other sites

Could you please post the numbers for every funding level though please.

Sure, no problem. I'll work on that today. :)

 

- Zombie

Link to comment
Share on other sites

Um, yeah. So typing 1984 numbers is out of the question as that would take too long and would also introduce errors. A simple cut and paste from Excel to notepad sucks as the formatting is lost. The easiest solution is to create an Excel file with the necessary information and attach it (see below).

 

I also made a .pdf copy in Adobe format so that those withot Excel can view it. (In Adobe Acrobat, click on "View" and then "Fit Visible" to make the numbers visible. You can also press CTRL + 3). Anything else, just give me a shout. :)

 

 

- Zombie

Link to comment
Share on other sites

  • 7 months later...

Sfnhltb from the X-COM wiki has found the "Capped Min-Min" values I presented a few posts back in DIPLOM.DAT. I guess that closes the book on this subject except for the fact that Canada has a DIPLOM.DAT value of 110, while emperically I got a low of 104. Not sure what is happening there yet. One idea is an error in data collection. I'll need to look at the data again to make sure the total funding is correct for this value, but I'm almost positive I programmed my Excel worksheet to notify of a conflict immediately. The other idea is that Canada plays "clean up" in terms of funding. In other words, since it is last on the list it may be the last value calculated to come out to the total funding number. I'll let you know what I find out.

 

If you guys are reading along with me here, the game only defines the "Capped Min-Min" values. It then modifies those values according to the total funding number rolled (assumption here). Let me crunch some numbers and get back to you tomorrow... :)

 

- Zombie

Link to comment
Share on other sites

Hiya Zombie, how's it going?

 

This is all super-great stuff. But I sure hope it can be summarized, instead of needing to read and understand the progression/evolution of information across the whole thread. :P We're on Post 142, for Pete's sake, hehe. If you or Sfn could summarize it on the wiki - with sub-pages if needed - that would be wonderful.

Link to comment
Share on other sites

Sure I'll do it (that is unless Sfnhltb beats me to it). Still, like I mentioned above, there is some more calculating which needs to be completed. Once that is wrapped up and the ideas are fresh in mind it should be easy to finish that page off. :)

 

- Zombie

Link to comment
Share on other sites

Just postulating a method to come up with a distribution like this programatically:

 

Take the min funding level, multiply by 100 to 199% for each country. Sum that lot up and you get a total, which is going to average about 6241 (as the base funding totals 4175), and leaves us with a range between 4175 (if we roll 16 straight 0's, which could take an awful long time, like universe ending...) and 8308. We do this so the countries have some variance game to game, so its not always best to be protecting the same few places in the start (well, to some extent anyway).

 

But for game balance reasons - and to stop people restarting game after game until they come up with near 8 million to start each game - especially when you consider that the funding increases are proportionate to the current funding, it would make some games massively easier than others - we need to get a fairly fixed value, so we settle on 6 million.

 

So there is two ways of adjusting the funding I see as likely to be used - first work out the total funding we rolled, divide 6 million by that number and use that as a factor to all 16 nations. In this variant the variance of +-15 would be explained by rounding errors in the algorhythm. This wouldnt explain why the 6001-6015 come up more often that those below easily though

 

The is another way you might do it though, especially back in the dark ages. Work out the total funding, if it is greater that 6015, take one off every country and recalculate, so you take 16 off the total at a time. Repeat until you are in the range 6000-6015 (taking off more at this point would put you below your target), all of these numbers you would expect to see the same amount of times on average (except 6000, because of the other part that logically follows).

 

If we are under 5985 then add 16, 1 to each country, until we get to the range 5985-6000, which again will all be very evenly distributed within that set. Because 6000 is part of both sets, it will appear more often than both sets, about as often as the average appearances of the other two sets added together.

 

What would we expect to see - the smaller funding countries will have large ranges - because if they roll low, when everyone else rolls high (or vice versa) they will get the 1 taken off (or added) to their already low (or high) number and break well outside their normal min/max.

 

We would also expect on the high side that the max's are all sacrosanct - because you will only be taking values off. You only can get the cap when you literally get a first roll that happens to be the range 6000-6015 exactly, even if you roll 6016 for all, you all will get one off the cap so no one can get a maximum this time.

 

Theorectically if every country got its highest value apart from Canada, and it got its minimum (110), then the 2000k+ all the countries have to shed to get down from the 8 million that can, over 100 would be assigned to Canada, so in theory with a skewed enough roll, it could possibly get zeroed (not a signed value, so cant go negative).

 

This would suggest, if true, that you would never get all the mins and maxs - or anywhere near them. You need to roll something close to 16 100 sided dice in exactly the right results to find a single absolute min/max (there might be a range of up to 15 'spare' values for the other countries that they could have and still get the absolute minimum, due to the rounding as we add/remove towards the 6 million figure, which on 16 dice would add up to millions of possibilities, but what is that compare to 16^100?). Once you got one minimum or maximum, that just leaves you 31 more to get though...(well in theory by 16^100 repeats you would expect to have most of the mins/maxes actually, and even google wouldnt help you with this search - as its much smaller than that 16^100...)

Link to comment
Share on other sites

Actually just rechecking the numbers on the Max-Max, what I wrote first and then deleted, that the initial range is 100-200% of the number in DIPLOM.DAT is the starting point, I think I was looking at the wrong column when I adjusted it to 100-199%.

 

I guess another thing that could be done to try and check the above theory is see the >6000, <6000 distribution and work out what proportion of values you would expect to see in those ranges given the approach I outline, if it would give the same distribution either side of the divide as is seen in practise, that would be another point in its favour.

 

Note I had thought of this method before seeing the difference in the means, so for me that very significantly backs up the idea, as its pretty hard to see a way of getting such a clearly stepped distribution without something similar, and the extremes of places the Canada suggest that it cant be anything like a proportionate adjustment being made.

 

Hmm, just thought of another possible thing to check - if the adjustment towards 6 mill is applied equally to all countries, then you would expect them all to break their starting limits by about the same sort of number (quite high variance though, as you are only looking at outliers) - with the larger funding countries breaking them by a smaller absolute amount on average (as when they are low, its much less likely that the entire fund is high, whereas the small countries have very little impact on the sum, so can get more extreme results more often).

Link to comment
Share on other sites

So heres what I would expect for the averages, Start Min is from DIPLOM.DAT, the max is assuming it is 100-200% of the min when first calculated, the range follows clearly enough, as does the averages (maybe the limited number selection and rounding might throw this off a little if I did the full list, but its going to be pretty close to halfway between min and max as its a linear dice throw I am assuming with 101 equally likely values.

 

These would give an average initial funding of 6112.5 as calculated at the base of that row, which is marginally over 7 lots of 16 too high for the desired final funding target, so we take 7 off the starting average and come up with the Adjusted Average.

 

Note it matches the Act Averages on the last page within +-1 for all 16 countries.

 

Country        StartMin  StartMax  StartRng  StartAve  AdjAve	  Act Ave   
USA            600	   1200	  600	   900	   892.96875   893	 
Russia		 230	   460	   230	   345	   337.96875   338	 
UK			 240	   480	   240	   360	   352.96875   353	 
France		 320	   640	   320	   480	   472.96875   472	 
Germany        250	   500	   250	   375	   367.96875   368	 
Italy          160	   320	   160	   240	   232.96875   234	 
Spain          140	   280	   140	   210	   202.96875   203	 
China          245	   490	   245	   367.5	 360.46875   361	 
Japan          400	   800	   400	   600	   592.96875   593	 
India          150	   300	   150	   225	   217.96875   218	 
Brazil		 300	   600	   300	   450	   442.96875   443	 
Australia      280	   560	   280	   420	   412.96875   414	 
Nigeria        180	   360	   180	   270	   262.96875   263	 
S Africa	   310	   620	   310	   465	   457.96875   457	 
Egypt          160	   320	   160	   240	   232.96875   233	 
Canada		 110	   220	   110	   165	   157.96875   158	 
Total		  4075	  8150	  4075	  6112.5						
										 7.03125

Link to comment
Share on other sites

And finally, probably, the absolute limits, according to the formulas you can work out quite rapidly I guess,

 

AbsMin = StartMin - ((8150-6000-StartMin)/16)

 

AbsMax = StartMin * 2 + ((6000-(4075+StartMin))/16)

 

Clearly these might be off about +-1 from rounding and such, and you will never see one in your lifetime even if they are accurate.

 

Country        StartMin  AbsMin	AbsMax								  
USA            600	   503	   1283									
Russia		 230	   110	   566									 
UK			 240	   121	   585									 
France		 320	   206	   740									 
Germany        250	   131	   605									 
Italy          160	   36		430									 
Spain          140	   14		392									 
China          245	   126	   595									 
Japan          400	   291	   895									 
India          150	   25		411									 
Brazil		 300	   184	   702									 
Australia      280	   163	   663									 
Nigeria        180	   57		469									 
S Africa	   310	   195	   721									 
Egypt          160	   36		430									 
Canada		 110	   -18 (0)   333

 

Canada is a special case, it could in theory go negative, but the storage is unsigned if i remember, so it would zero, presumably (or if badly coded wrap around and they would give you 32M at the start, except the cap in the last couple of bytes kicks in and they would be 2M.)

Edited by sfnhltb
Link to comment
Share on other sites

  • 3 months later...
Sfnhltb from the X-COM wiki has found the "Capped Min-Min" values I presented a few posts back in DIPLOM.DAT. I guess that closes the book on this subject except for the fact that Canada has a DIPLOM.DAT value of 110, while emperically I got a low of 104. Not sure what is happening there yet. One idea is an error in data collection. I'll need to look at the data again to make sure the total funding is correct for this value, but I'm almost positive I programmed my Excel worksheet to notify of a conflict immediately. The other idea is that Canada plays "clean up" in terms of funding. In other words, since it is last on the list it may be the last value calculated to come out to the total funding number. I'll let you know what I find out.

 

If you guys are reading along with me here, the game only defines the "Capped Min-Min" values. It then modifies those values according to the total funding number rolled (assumption here). Let me crunch some numbers and get back to you tomorrow... :)

 

- Zombie

Ok, time to bump this again. I have been very busy as of late gathering together all the known info in the executable. While searching it I happened across the diplom.dat (and starting funding!) info. For anyone interested, it starts at byte 469,241 (or 469,341 if you open the CE executable with 100-column widths in MS-Edit) and ends at byte 469,816 (469,916 in MS-Edit). Follows the same pattern as as diplom.dat so there really isn't much new to report here. :wink1:

 

I tried editing some values in the executable and most took hold. Couldn't get the status of a country to start out at anything other than 3 (happy), so it's possible that 3 is the default no matter what value you edit in the executable. Oh well. Would have been funny to see countries unhappy right from the start of the game which would force you to gain their trust (and funds) back, eh? :D

 

- Zombie

Edited by Zombie
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...