UGO
Civilization Fanatics' Center  

Welcome to Civilization Fanatics' Center.

You are currently viewing our site as a guest which gives you limited access to our site features. By joining our free community, you will be able to participate in the discussions, search the forum, send private messages, vote in polls, upload your own screenshots to the gallery, and access many other special features. Registration is fast, simple and absolutely free, so sign up today! If you have any problems with the registration process or your account login, please contact support.

Go Back   Civilization Fanatics' Forums > CIVILIZATION III > Civ3 - Strategy & Tips

Reply
 
Thread Tools
Old Aug 11, 2002, 07:10 PM   #1
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Lightbulb Research cost formula v1.29f

This is the formula for research cost for v1.29f. I have attached an image of the formula as it is easier to visualize that way than in plain text. Also it is now simplified even more for your pleasure .

Research Cost = - Research done so far

I'll also write it out for those who cannot view images.

Research Cost = [MM * [10*COST * (1 - N/[CL*1.75])]/(CF * 10)] - Research done so far

Research Cost and research done so far are in gold.

Square brackets indicate truncation /rounddown

MM = map modifier(tech rate on world sizes tab in the editor)
Tiny 160
Small 200
Standard 240
Large 320
Huge 400

CF = AI cost factor(as on the difficulty tab in the editor)
For the purposes of the research cost formula, CF has a maximum value of 10.
Chieftain 10
Warlord 10
Regent 10
Monarch 9
Emperor 8
Deity 6

COST = technology cost as on the civilization advances tab in the editor.

N = number of civs on the diplomacy screen that have discovered the tech.

CL = number of civs left in the game

There is only one part of the formula that varies during the game: (1 - N/[CL*1.75]). There are two ways in which you can increase it to lower tech cost:
1. Increase N by exploring and buying comms to add civs to your diplomacy screen.
2. Decrease CL by killing civs.

NB. This formula is relevant for research cost of the AI civs, not just the human player. If you are interested in the research cost of a specific technology for a specific AI civ, N refers to the number of civs on that specific AI civ's diplomacy screen that have discovered that specific tech. In general, there are two ways in which you can increase AI tech cost:
3. Keep N low by not selling comms to AI civs.
4. Keep CL high by not killing civs.
And technically...
5. Keep N low by not getting techs yourself.

Obviously points 2. and 4. are contradictory so choose whichever fits your playing style. Personally I choose point 2.

Last edited by mydisease; Dec 15, 2002 at 09:14 AM.
mydisease is offline   Reply With Quote
Old Aug 11, 2002, 08:19 PM   #2
Qitai
.
 
Qitai's Avatar
 
Join Date: Jan 2002
Location: SG.MY.TW.US
Posts: 1,177
GREAT WORK!!!!

I like to try to simplified this to
Research cost = MM*DM*(COST/100) *[1 - N/(CL*1.75)] - Research done so far.

This is less accurate since I drop all the roundings but easier to remember.
Qitai is offline   Reply With Quote
Old Aug 12, 2002, 06:20 AM   #3
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Yes, I agree with the simplification, in fact it is essentially the previous approximation to the formula that I had. But even with the simplification you still need one rounding because most of the answers will not be integers. So the simplest formula to give an integer answer is:

Research cost = DOWN{MM*DM*(COST/100) *[1 - (N/(CL*1.75))]} - Research done so far.

Indeed, I don't know why Firaxis don't use this formula as it is less complex and gives better answers.

Also I forgot to mention the changes from 1.21f to 1.29f. There were two changes:
1. CL*1.5 in 1.21f is now CL*1.75 in 1.29f. This lowers the rate at which research cost falls making researching a more viable option (as you are now more unlikely to have sufficient gold to buy techs)
2. DMs were all 10 in 1.21f, but some are now increased in 1.29f. This means techs are now more expensive for the human player on Monarch, Emperor and Deity.
mydisease is offline   Reply With Quote
Old Aug 16, 2002, 03:02 AM   #4
Franses
Chieftain
 
Join Date: Aug 2002
Location: Netherlands
Posts: 18
Nice work

I can not find the difficulty multiplier in the editor. Could you?
Franses is offline   Reply With Quote
Old Aug 16, 2002, 03:16 AM   #5
Lt. 'Killer' M.
Deity
 
Lt. 'Killer' M.'s Avatar
 
Join Date: Dec 2001
Posts: 7,486
Franses: which multiplier do you mean? it should be on the difficulty level tab.....
Lt. 'Killer' M. is offline   Reply With Quote
Old Aug 16, 2002, 03:24 AM   #6
Shabbaman
rebuffing the rebels
 
Shabbaman's Avatar
 
Join Date: Feb 2002
Location: the new civduelzone.com!
Posts: 3,571
Thumbs up

Mydisease, you never stop, don't you
__________________
"Our words are backed with NUCLEAR WEAPONS!"
Shabbaman is offline   Reply With Quote
Old Aug 16, 2002, 08:14 AM   #7
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Difficulty multipliers aren't in the editor. I had to work them out.

And hopefully I will stop now unless Firaxis change it again.
mydisease is offline   Reply With Quote
Old Aug 16, 2002, 09:01 AM   #8
Franses
Chieftain
 
Join Date: Aug 2002
Location: Netherlands
Posts: 18
Quote:
Originally posted by Lt. 'Killer' M.
Franses: which multiplier do you mean? it should be on the difficulty level tab.....
The one called DM in above formula. I understand from mydisease that it is not in the editor. That is a pity but shows and makes the derivation of the formula even more impressive.
Franses is offline   Reply With Quote
Old Aug 16, 2002, 10:08 AM   #9
Lt. 'Killer' M.
Deity
 
Lt. 'Killer' M.'s Avatar
 
Join Date: Dec 2001
Posts: 7,486
ah, OK, that one... Iwas thinking of the AI advantage one...
Lt. 'Killer' M. is offline   Reply With Quote
Old Aug 16, 2002, 10:01 PM   #10
Qitai
.
 
Qitai's Avatar
 
Join Date: Jan 2002
Location: SG.MY.TW.US
Posts: 1,177
DM = max{10, 1/AI prod advantage}
Qitai is offline   Reply With Quote
Old Aug 17, 2002, 07:56 AM   #11
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Can you explain that cryptic comment Qitai?
And where is AI production advantage in the editor? I don't see it on the difficulty levels tab.
mydisease is offline   Reply With Quote
Old Aug 18, 2002, 06:05 AM   #12
Qitai
.
 
Qitai's Avatar
 
Join Date: Jan 2002
Location: SG.MY.TW.US
Posts: 1,177
I mean cost factor. Sorry.
Cost factor = {20, 12, 10, 9, 8, 6} for the various difficulty level.
So The above gives {10, 10, 10, 11.1, 12.5, 16.7}. Slight difference from yours.
Qitai is offline   Reply With Quote
Old Aug 18, 2002, 06:39 AM   #13
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Yes, I think you are right. In fact the deity one should have been 16.7 when I wrote it, but I rounded down by mistake. Or 16.6recurring to be exact, but I don't know how to get the dot above the 6. That only leaves the Monarch figure and I've currently got a Monarch game on the go in the Modern Age, so I'll check it out. If you are right, then this simplifies it formula to this:

Research cost = MM*COST*MIN.1(1/CF) - UP{MM*MIN.01(1/10CF) * UP[COST*10N/DOWN(CL*1.75)]} - Research done so far

Which is slightly less complicated(especially seeing as I don't know the proper notation for rounding up to 0.1 if the figure is below that). I'll check out the figure for Monarch now, hopefully its 1/9.
mydisease is offline   Reply With Quote
Old Aug 18, 2002, 08:17 AM   #14
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
I've tested it and the Monarch figure is 11.1 (or 1/9 with the new formula). I also tried changing the AI cost factor in the editor and research cost varied with its inverse, so the new formula is correct. Thanks Qitai!

Last edited by mydisease; Aug 18, 2002 at 01:31 PM.
mydisease is offline   Reply With Quote
Old Dec 03, 2002, 04:19 AM   #15
Flrec
Chieftain
 
Join Date: Jan 2002
Posts: 1
Excellent work, NRJ.
Flrec is offline   Reply With Quote
Old Dec 06, 2002, 01:35 PM   #16
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
You register just to say that Tony?
Pretty but sad.
mydisease is offline   Reply With Quote
Old Dec 06, 2002, 10:07 PM   #17
WillJ
Coolness Connoisseur
 
WillJ's Avatar
 
Join Date: Aug 2002
Location: USA
Posts: 9,475
Great work, mydisease! This is now my first subscribed thread.
__________________
\/\/ | |_ |_ (_/
WillJ is offline   Reply With Quote
Old Dec 07, 2002, 09:46 PM   #18
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
I just made a program based on your Formula, mydiesease.

Here http://forums.civfanatics.com/showth...063#post640063 , I call it TechCalc.

Please try it out.
__________________
GreyFox.ME - a blog about Gaming and Me | ~SolidDread@DeviantArt | FfH2ComicStrips | My Mods
Read Welcome To China! - Play Fall from Heaven 2 a Dark Fantasy Civ4 mod -> Download here - PDF Manual

Rise from Erebus - R i f E - Member of the R i f E team. - Chat about FfH stuff @ #erebus
Grey Fox is offline   Reply With Quote
Old Dec 10, 2002, 11:33 AM   #19
Charis
Realms Beyond
 
Charis's Avatar
 
Join Date: Dec 2001
Location: Midwest, USA
Posts: 1,837
Put on your programmer hat

Very nice job inferring the formula!

I think you're close, but I'm certain the actual formula is even easier.

Think a minute like a progammer. He's using *integer* math -- speed and efficiency are huge concerns. He's not using VB and functions roundoff or roundup. There is NO function used, other than the built in truncation when using integer math.

Example1 - if a programmer using integer math wants something to the nearest 10th, he'll use: [10*n]/10
The square brackets denote simple integer truncation (rounddown)

Example2 - he will NOT use any decimals whatsoever. If something looks like 11.1, it's 100/9. If it looks like 1.75, it's 4/7.
They will use min and max when needed to put bounds on factors.

Guaranteed the programmer is not using a complicated function for these things, but the simplest possible.

How does this formula fit your data?
CF = Min(AI_Production_Advantage, 10)

Research cost = MF*COST/CF * [ 10 - 40*N/CL/7 ]/10

(It might be 40*N/CL/7 or 40*N/(7*CL) or 40*N/7/CL, but it's
almost surely being done with integer math. That mean's it's not 40/7 together as that would truncate immediately to 5)

Examples from your response to GreyFox
1) Bronze Working, Regent Map, 8 of 10 civs have it:
ResCost = 240*3/10 * [10 - 40*8/10/7 ] / 10
= 72 * 5 / 10 = 36 beakers
2) Integrated defense, 0 of 10 civs know it, huge map, Monarch
ResCost = 400*360/9 = 16,000

Do your "fits" with pure integer math and truncation, no roundups or 'nearest tenth' - see if this formula is it or very close.

Charis
Charis is offline   Reply With Quote
Old Dec 12, 2002, 03:10 PM   #20
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Ignoring MM/CF as it is the same in both formulae:

COST - UP.1(COST*N/DOWN(CL*1.75))
= COST - UP(COST*N*10/DOWN(CL*1.75))*0.1

You feel this can be abstracted to (square brackets denoting truncation):

COST * [10 - 40 * N/(7*CL)]/10

There are two errors in the derivation of this formula. First, you ignore the truncation of (CL * 1.75). This means that the results your proposed formula gives are too low. Secondly, you take a common factor of COST out of the UP bracket, ignoring the effect this will have on the rounding. This also means that the results your proposed formula gives too low results. This happens over the entire range of the formula:

Ex.1 Tiny Map, Regent, 4 civs, Pottery, 1 civ on your diplo screen has it
My way: UP.1(2*1/DOWN(4*1.75)) = UP.1(2/7) = .3
2 - .3 = 1.7
DOWN(1.7*160/10) = 27
Your way: [10 - 40*1/(7*4)] = [10 - 1.4] = 8
2 * 8/10 = 1.6
1.6*160/10 = 25.6 = 25
It is necessary to truncate at this point as well, as gold comes in integer values only.
Relative error = (27 - 25)/27 = 7.5%

Ex.2 Huge Map, Regent, 21 civs, Integrated Defense, 1 civ on your diplo screen has it
My way: UP.1(360*1/DOWN(21*1.75)) = UP.1(360/36) = 10
360 - 10 = 350
DOWN(350*400/10) = 14000
Your way: [10 - 40*1/(7*21)] = [10 - .27] = 9
360 * 9/10 = 324
324*400/10 = 12960
Relative error = (14000 - 12960)/14000 = 7.5%

So, clearly not the correct formula. However, I do see your point, the formula written at the top of this thread will not be how it is written in the code for civ3. But I am fairly sure that it is the simplest mathematical way to express a formula which always gives the correct results for Research Cost.
mydisease is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION III > Civ3 - Strategy & Tips > Research cost formula v1.29f

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Unit Cost Formula Gary Childress Civ3 - Creation & Customization 7 Jan 13, 2009 09:19 PM
PTW--Still need v1.29f? ButSam Civ3 - General Discussions 2 Apr 18, 2003 03:56 PM
Technical issues for making v1.21g(MAC) play like v1.29f or PTW (PC) cracker Civ3 - Macintosh 13 Feb 24, 2003 10:33 AM
v1.29f crashes Klasanov Civ3 - Technical Support 1 Jan 22, 2003 12:36 PM
does anyone know the spy mission cost formula? Exsanguination Civ3 - General Discussions 0 May 13, 2002 03:17 PM



All times are GMT -6. The time now is 07:28 PM.


Powered by vBulletin®
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
This site is copyright © 2000 - 2009, Civilization Fanatics' Center.
Support CFC: Amazon.com | EB Games | Amazon UK | Amazon DE | Amazon CA | Amazon FR