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 - Creation & Customization > Utility Programs

Reply
 
Thread Tools
Old Dec 07, 2002, 09:44 PM   #1
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
Post Utility: TechCalc

This program is based on mydisease's Tech Research Formula he posted in the Civ3 General Discussion forum. Here!

TechCalc 2.01
For all versions of Civilization III. (Patched versions).

Here's a preview


***********************************
TechCalc Readme VERSION 2.0
Programmer: Grey Fox, AKA Fredrik Henriksson
Formula: mydisease
This is a free program and I hope you enjoy it!

***********************************
This is a program that calculates your tech cost
based on various factors:
- Which tech you are researching.
- Map Size.
- Difficulty.
- Number of Civs that you have contact with that has the tech.
(Including you if you have the tech. Can be checked in the Diplomacy Screen)
- Number of Civs left (including YOU!)
- Gold already invested.

Turns left on the technology is based on:
- The Tech cost
- Beakers per turn. (Gold into Science, check in F1 screen in Civ3)
- and Gold already invested.
------------------------------------------------------------
Thanks to:
- mydisease for figuring out the Tech Cost formula!
- anarres for helping me with some problems and suggesting features!
- kring, for noticing that v.1.01 didn't have an icon.
- vbraun for suggesting the Gold Lost feature!
- and everyone that has downloaded the program so far (Although I don't know how many) and to those that will download it in the future. That is my reward, that people uses my program and appreciate it.

------------------------------------------------------------
Revisions
------------------------------------------------------------
Additions v.2.01
- Added a button for adding the Beakers Per Turn to the Gold Invested edit box.

Fixes v.2.01
- Fixed the rounding problems with the Turns Left.
- Fixed some rounding problems with the Combat Calculator and some other issues.
----------------------------------------------------------
Additions v.2.0
- Program reprogrammed from the foundation up.
- Ability to load textfiles with the Tech Names and costs (which makes it possible to change the use of the program, to use it with a mod, Scenario, Conquest, or another version of the game).
- A Combat Calculator, with everything needed to be useful.
- A simple *regular* calculator, that can add, subtract, multiply and divide.
- An area where you can keep short notes.
- You can now see how much gold that will be lost.
- You can now enter how many turns you've researched.
------------------------------------------------------------
Additions v1.5
- Added Function to calculate Turns left.
- Added a "Gold Invested" edit box.
- Added a new icon.

Changes v1.5
- Changed the integer limit on "Nr. of Civs left" and "Nr. of Civs with tech" to 31, from 32.
- Changed the interface to fit with the new features.
- Removed the Static Dll file from the .exe-file. (The file only takes about 35 kb now)

Fixes v1.5
- Fixed the TechCost calculation formula. It should work almost perfect now.
- Fixed the Invisible-Icon bug.
------------------------------------------------------------
Additions v1.01
- Added human error check on number insertions.

Changes v1.01
- Changed the interface just a little.

Fixes v1.01
- Fixed the Tech List.
- Fixed the Formula Rounding errors.
------------------------------------------------------------

Please report bugs etc in this thread.
Suggestions on improvements are always welcome.

UPDATED: December 16th - 2003
This file is 19.5 kb
TechCalc v2.01

This file is 453 kb
mfc42.dll - needed for those who can't run the program
__________________
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

Last edited by Thunderfall; May 18, 2004 at 03:49 PM.
Grey Fox is offline   Reply With Quote
Old Dec 07, 2002, 10:45 PM   #2
Toasty
Old Guard
 
Toasty's Avatar
 
Join Date: Nov 2001
Location: Tampa, FL
Posts: 3,637
You didn't include the science funding.
__________________
1.29b2
EQUALITY
Toasty is offline   Reply With Quote
Old Dec 08, 2002, 10:14 AM   #3
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Excellent

@Toasty, I think it tells you the total cost of a tech. If you want to know number of turns left (as I think you do), then it would need also the exact number of beakers collected so far. The only way to do this is from the savefile, but this is not the intended useage methinks.
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."
anarres is offline   Reply With Quote
Old Dec 08, 2002, 10:35 AM   #4
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
GreyFox, this is excellent. I appreciate the work you have done - I was considering something similar myself as I could never be bothered to work out the numbers by hand and was using a spreadsheet.
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."
anarres is offline   Reply With Quote
Old Dec 08, 2002, 02:02 PM   #5
kring
Asst Cook & Bottle Washer
 
kring's Avatar
 
Join Date: Dec 2001
Location: Wichita,KS,USA
Posts: 1,210
Thank you Grey Fox.
__________________
Looking for cIV and Civ3 terrain and resource mods. 1.52 1.29f 1.27f 1.22
kring is offline   Reply With Quote
Old Dec 09, 2002, 12:23 AM   #6
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Grey Fox, have you been taking programming lessons from the Firaxian "Play The World" School of Programming? I am no programmer but I can infer the following errors from the results your program gives:

1. There is a hole in the first half of the tech tree in the middle ages. The missing techs being (after Construction) Monotheism, Feudalism, Engineering, Theology, Chivalry, Invention, Printing Press, Music Theory, Education, Gunpowder, Banking (then Astronomy). However, the techs named after Construction refer to the tech costs of all the techs in the correct order so all the actual costs are offset by 11 backwards (after Construction, before then they are fine).

2. All costs for Monarch are noticeably too low and costs for Deity sligthly too low. The inverse of both of these cost factors (ie. 1/9 and 1/6) gives recurring roots so I suspect that the error will be due to rounding done by the computer at too early a stage. I know little about programming but can you not do it so the program works outwards from the most internal bracket and this way avoid rounding at this point.

3. Devaluation rate is not working properly, this being especially noticeable for very early techs. As no. of civs that know the tech increases, cost should decrease in a fairly linear manner, but in fact your program gives big drops. I think the most internal bracket(or is it the most infernal bracket) is rounding up to the nearest 1 rather than the nearest .1 and this is causing the problem. Mathematically this part of the formula is better expressed:

.1 * ROUNDUP[10 * COST * N/ROUNDDOWN(CL * 1.75)]

Where ROUNDUP and ROUNDDOWN is to the next integer.

I think the devaluation when other civs have the tech isn't working correctly even taking this into account.

4. No. of civs with tech cannot be bigger than no. of civs left. You might want to put an internal check to make sure this is the case before calculating.

5. By giving no. of civs left a range of 1 to 31 (rather than 1 to 16) you are hypothesising that the formula I found for 1.29f is also true for Play The World. It may well be the case, but bear in mind that nobody has tested this hypothesis and I don't have Play The World and so can't test it.

6. You write "Nr.", bravely defying the general consensus of "No.". Ah well, its a free country.

7. Its two megs! That's 2/3rds the size of the civ3 executable!

Sorry if all that was a bit critical.
mydisease is offline   Reply With Quote
Old Dec 09, 2002, 04:00 AM   #7
anarres
anarchist revolutionary
 
anarres's Avatar
 
Join Date: Apr 2002
Location: www.civ3duelzone.com
Posts: 6,070
Quote:
Originally posted by mydisease
4. No. of civs with tech cannot be bigger than no. of civs left. You might want to put an internal check to make sure this is the case before calculating.

7. Its two megs! That's 2/3rds the size of the civ3 executable!
Not that GreyFox needs me, but I can answer these:

4. When I tried putting a greater number of civs with the tech than is in the game, it gave me '0' as an answer. This seems appropriate action in this case. A different logic on the form would make it harder to use.

7. It has a static DLL built in. This is to ensure that if you don't have the DLL used by GreyFox on your machine it will still work anyway as the necessary parts of the DLL are incorperated in to the file. A smaller version could be built, but then you may not be able to use it. Otherwise complain to micro$oft

I'm looking forward to the technical issues being resolved as well, I hadn't reached that far in techs in my game yet .

Edit: anarres learns to spell
__________________
Civ3 Duel Zone | Come join the PBEM ladder today!
Calculate the probability of Culture Flips: Flip Calc
"Too many of us look upon Americans as dollar chasers. This is a cruel libel, even if it is reiterated thoughtlessly by the Americans themselves." - Einstein
"We are undergoing a period of history that will, in years to come, be compared with the anti-communist hysteria that dominated US headlines in the 1950's."

Last edited by anarres; Dec 09, 2002 at 04:05 AM.
anarres is offline   Reply With Quote
Old Dec 09, 2002, 06:43 AM   #8
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
Quote:
Originally posted by mydisease
Grey Fox, have you been taking programming lessons from the Firaxian "Play The World" School of Programming?

Hehe, I'm not perfect
Quote:
1. There is a hole in the first half of the tech tree in the middle ages. The missing techs being (after Construction) Monotheism, Feudalism, Engineering, Theology, Chivalry, Invention, Printing Press, Music Theory, Education, Gunpowder, Banking (then Astronomy). However, the techs named after Construction refer to the tech costs of all the techs in the correct order so all the actual costs are offset by 11 backwards (after Construction, before then they are fine).
Oops, sorry... copy/paste error here...

Quote:
2. All costs for Monarch are noticeably too low and costs for Deity sligthly too low. The inverse of both of these cost factors (ie. 1/9 and 1/6) gives recurring roots so I suspect that the error will be due to rounding done by the computer at too early a stage. I know little about programming but can you not do it so the program works outwards from the most internal bracket and this way avoid rounding at this point.
I am working outwards, from the most inner bracket. Check next qoute.

Quote:
3. Devaluation rate is not working properly, this being especially noticeable for very early techs. As no. of civs that know the tech increases, cost should decrease in a fairly linear manner, but in fact your program gives big drops. I think the most internal bracket(or is it the most infernal bracket) is rounding up to the nearest 1 rather than the nearest .1 and this is causing the problem. Mathematically this part of the formula is better expressed:

.1 * ROUNDUP[10 * COST * N/ROUNDDOWN(CL * 1.75)]

Where ROUNDUP and ROUNDDOWN is to the next integer.

I think the devaluation when other civs have the tech isn't working correctly even taking this into account.
Yes, the devaluation error is because I totally left out the .1 in the 2nd rounding. The reason for that is because I had no Idea how to implement it.

Quote:
4. No. of civs with tech cannot be bigger than no. of civs left. You might want to put an internal check to make sure this is the case before calculating.
Can't number of civs that have the tech be bigger then nr of rivals left, by 1? (because you could do the check you everyone have the tech, including you for whatever the reason )

and yes, I was too lazy to implement a check...

Quote:
5. By giving no. of civs left a range of 1 to 31 (rather than 1 to 16) you are hypothesising that the formula I found for 1.29f is also true for Play The World. It may well be the case, but bear in mind that nobody has tested this hypothesis and I don't have Play The World and so can't test it.
Sorry, the range of civs left should be 32. This is because you can play with up to 31 Rivals in PTW (and 24 in Civ3), so if you play with that many you should be able to use the program. And yes I think it will work for PTW, and if it doesn't... well so be it.

Quote:
6. You write "Nr.", bravely defying the general consensus of "No.". Ah well, its a free country.
Yes I'm brave!
No, sorry I forgot. It's "Nr." in swedish, and I'm swede... Will change that immediatelly.

Quote:
7. Its two megs! That's 2/3rds the size of the civ3 executable!
Yep I know... that's because a static library is included which might not be needed in some windows versions, but most probably in the 9x versions... but I will make the next version without it, and we'll see. (I really included it by mistake, but if Mac users can use the file because of it, it's nice having it included...)

Quote:
Sorry if all that was a bit critical.
No, don't be sorry.

The reason to why I released the program was to get feedback from mainly you. Especially about if the formula worked as I did it.

Well Thank you!

I will get right on the bugfixing!
__________________
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

Last edited by Grey Fox; Dec 09, 2002 at 06:51 AM.
Grey Fox is offline   Reply With Quote
Old Dec 09, 2002, 08:30 AM   #9
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
Quote:
Originally posted by mydisease
Mathematically this part of the formula is better expressed:

.1 * ROUNDUP[10 * COST * N/ROUNDDOWN(CL * 1.75)]

Where ROUNDUP and ROUNDDOWN is to the next integer.
So, should I use that instead of:

ResearchCost = Down((MM/CF)*(Cost-Up.1(Cost*N/Down(CL*1.75))))

??
__________________
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 09, 2002, 10:51 AM   #10
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
Ok, I think I fixed all bugs and errors now (exept the static dll).

I got one question to you mydisease.

This part of the formula = Up.1, does that mean that 1.45121 should be rounded to 1.5?
__________________
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 09, 2002, 02:01 PM   #11
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Quote:
Originally posted by Grey Fox
Can't number of civs that have the tech be bigger then nr of rivals left, by 1? (because you could do the check you everyone have the tech, including you for whatever the reason )

and yes, I was too lazy to implement a check...
I think you misunderstand the civs left(CL) bit of the formula. This means the number of civs left INCLUDING your civ, NOT the number of rivals. And hence number of civs that have the tech can only equal number of civs left if every civ including you has the tech.

Quote:
Originally posted by Grey Fox
This part of the formula = Up.1, does that mean that 1.45121 should be rounded to 1.5?
Yes, that's exactly it. So try:

ResearchCost = ROUNDDOWN((MM/CF) * (Cost - (.1 * ROUNDUP(10 * COST * N/ROUNDDOWN(CL * 1.75)))))

In fact, I might change the formula to this. It works out the same and its less ambiguous. Though my maths teacher would kill me if he saw all those round brackets.

And I was only joking about "no.", actually I kind of like "nr." better.
mydisease is offline   Reply With Quote
Old Dec 09, 2002, 02:21 PM   #12
mydisease
Kalokagathian
 
mydisease's Avatar
 
Join Date: Apr 2002
Posts: 97
Quote:
Originally posted by mydisease
I think you misunderstand the civs left(CL) bit of the formula. This means the number of civs left INCLUDING your civ, NOT the number of rivals. And hence number of civs that have the tech can only equal number of civs left if every civ including you has the tech.
Though, in fact, I'm being an idiot on this one and you are right no. of civs with the tech can be bigger than no. of rivals by 1.

And quoting myself .uuurgh
mydisease is offline   Reply With Quote
Old Dec 09, 2002, 02:44 PM   #13
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
Quote:
Originally posted by mydisease


Though, in fact, I'm being an idiot on this one and you are right no. of civs with the tech can be bigger than no. of rivals by 1.
You'r sure?

I'm done with the formula now. All roundings are in, and it's based on your first formula, not the new one you posted here.

I justed checked it in game. It seems to work quite nice when I included my own civ in the Nr. of rivals left edit box.
__________________
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 09, 2002, 05:39 PM   #14
Stuck_as_a_Mac
Aptenodytes forsteri
 
Stuck_as_a_Mac's Avatar
 
Join Date: Apr 2002
Location: NYC
Posts: 3,932
gf: as the name implies, i use macs. i would be happy to test this out for you, as soon as .net comes back on line. just PM me to remind me, seeing as i am a tad *understatement* forgetful
__________________
Think Different
DG7: Attack of the other 6 DGs Yeaagh Somewhat Confused?
The Beatrice is Back
Stuck_as_a_Mac is offline   Reply With Quote
Old Dec 09, 2002, 06:58 PM   #15
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
I'm sorry, CivFanatics.net doesn't work at the moment.

So I can't upload the newest version.

I will upload it to my own server, temporarily.


EDIT: Updated the first post with a new url to the newest version. Beta 1.01.
__________________
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

Last edited by Grey Fox; Dec 09, 2002 at 07:07 PM.
Grey Fox is offline   Reply With Quote
Old Dec 09, 2002, 07:19 PM   #16
Admiral PJ
Chieftain
 
Join Date: Dec 2002
Location: Essex, England
Posts: 3
It works well for me, but I should try the latest version,
it only allows 2 civs with the tech already I think.

Would be nice if users could change the techtables used, maybe from reading a text file.. for different mods.
In my mod I have increased mostof the tech costs as my tiles produce more money as all my laborers make -1 in taxes so cost a lot.
__________________
Admiral PJ
Peter J.T
Lux Invicta team of Apolyton PBEM Demo game1.
Admiral PJ is offline   Reply With Quote
Old Dec 09, 2002, 07:23 PM   #17
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
Quote:
Originally posted by Admiral PJ
Would be nice if users could change the techtables used, maybe from reading a text file.. for different mods.
I will add this in a future version. (I'm still learning windows programming, so don't expect it tomorrow )
__________________
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 09, 2002, 07:29 PM   #18
Quillan
Monkey Butler
 
Quillan's Avatar
 
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 97
tourney link

Hey, i haven't looked at the program yet, although i'm sure it will be a great help for the lazy (myself included).

Just FYI grey, your link for the tourney doesn't work... i'm interested, so pls post other info or PM me!
__________________
- Quillan
Pigeon Bane,
Squirrel Scourge.
Quillan is offline   Reply With Quote
Old Dec 09, 2002, 07:37 PM   #19
Grey Fox
Dreadnought
 
Grey Fox's Avatar
 
Join Date: Dec 2001
Location: Sweden
Posts: 8,025
Re: tourney link

Quote:
Originally posted by Quillan
Just FYI grey, your link for the tourney doesn't work... i'm interested, so pls post other info or PM me!
It's because Civfanatics.net is down. Go to the Tournament forum here at Civfanatics if you want to learn more about the competition.
__________________
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 09, 2002, 09:38 PM   #20
LaRo
Dead Rat
 
LaRo's Avatar
 
Join Date: Nov 2001
Location: on the road
Posts: 492
Number of civs you know have the tech...

Do you include your own civ?

E.G. I am alone with my brother and I want to sell him astronomy.
X civs you know have the tech
__________________
...
LaRo is offline   Reply With Quote
Reply

Bookmarks

Go Back Civilization Fanatics' Forums > CIVILIZATION III > Civ3 - Creation & Customization > Utility Programs > Utility: TechCalc

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
In need of a new utility Slavic Sioux Civ4 - Creation & Customization 3 Jun 19, 2006 09:21 AM
Anyone know where the utility.... Requies Civ4 - Creation & Customization 1 Dec 07, 2005 11:01 AM
New Utility Please computerdude113 Civ3 - Creation & Customization 3 Nov 30, 2002 09:35 AM
Utility? "the stick" Civ3 - Creation & Customization 4 May 30, 2002 06:20 AM
Utility Help chiefpaco Civ3 - Macintosh 0 Mar 27, 2002 12:55 PM



All times are GMT -6. The time now is 01:28 AM.


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