Resource icon

Utility: TechCalc 2.01

I've been working on an update on the Tech Calc. I had to rewrite the SourceCode from the ground up, because I lost the old code.

I know I fixed some bugs that were in 1.5, like the Gunpowder showing the wrong cost.

I've also added plenty of new features! Like:

  • 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 simple Combat Calculator.
  • A simple *regular* calculator, that can add, subtract, multiply and divide, with numbers with up to 2 decimals.
  • An area where you can keep short notes.
It will be released sometime next week (or this week). Anyways, it will be out sometime week 51.




Btw, anyone know how to implement one of these?:
 
This version sounds great! Good job, Grey fox!

:goodjob:

One suggestion: since you added a combat calculator, why not make it complete with the barbarians bonus and the land defense bonus?

I usually use the tech calculator and the combat calculator. Two in one would be awesome.
 
Originally posted by LaRo
One suggestion: since you added a combat calculator, why not make it complete with the barbarians bonus and the land defense bonus?
I've been thinking you could add that yourself. It's just to write 2.7 if it's a fortified spearman spearman on a plains for example.

Do I *really* need to add those buttons?
 
Originally posted by Grey Fox
Btw, anyone know how to implement one of these?:
IIRC it has a 'value' property that will always return the value, and the control itself will do the 'plus' and 'minus' functions.

Or do you mean what dll is the control part of?

I should admit that I have used it in VB, C Sharp and VB.NET, but not C++ (as you appear to be using).
 
I might be able to Release the program today.

IF it wasn't for a stupid problem... When I try to divide 9/10 (both floats). Like this variable = number/10, I get the result; 0.899999991672 or something like that. When it should be 0.9.

And I'm SO frustrated and SO angry right now because of that... ARR!!! :mad: :cry:
 
Originally posted by Grey Fox
IF it wasn't for a stupid problem... When I try to divide 9/10 (both floats). Like this variable = number/10, I get the result; 0.899999991672 or something like that. When it should be 0.9.
This is pretty standard behaviour for a float. A float only has about 6 significant digits of decimal accuracy (Note that if you output 0.899999991672 to 6 signifcant figures you DO get 0.9). If that's not good enough you could always use a double or a long double!
 
Originally posted by Dianthus

This is pretty standard behaviour for a float. A float only has about 6 significant digits of decimal accuracy (Note that if you output 0.899999991672 to 6 signifcant figures you DO get 0.9). If that's not good enough you could always use a double or a long double!
The strange thing is that I DON'T get this problem in a DOS version of this calculation. There I get 0.9 plain and Simple.

And how should a double or a long double help me? I don't want MORE decimals...

How can I fix this? 6 significant figures :confused:
 
Definitly use doubles in a small prog like this! The overhead is non-existent on this scale and the precision isn't going to need thinking about again.

Regarding the control GreyFox - IIRC it is in COMCTL32.ocx.
 
YEY! :D :goodjob:

Changing to double fixed all my troubles!


It's a wonder I didn't destroy any furniture or damage myself during my frustration...
 
Originally posted by Grey Fox
And how should a double or a long double help me? I don't want MORE decimals...
If you have more precision (I.e. by using double or long double) then there will be less rounding in performing calculations and it will be possible to store more binary places, so making it possible to store more decimal places. Note that even a number like 0.1 takes quite a lot of binary places as decimal fractions don't convert well to binary fractions.

Originally posted by Grey Fox
How can I fix this? 6 significant figures :confused:
I just did a quick google for "significant figures" and came up with this site.

EDIT: Oh, and I'm glad to see you've fixed it now :goodjob:
 


Here are some of the new features:

  • 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. (Thanks vbraun for the suggestion!)
  • You can now enter how many turns you've researched.

Happy Civing! :D

And report all bugs, problems, suggestions and praise here in this thread ;)

Did a small update after 3 downloads.
Updated to version 2.01 after 14 downloads.
Updated version 2.01 once again after 3 downloads.
 

Attachments

  • techcalc2.01.zip
    19.8 KB · Views: 2,937
Thank you for your continued efforts on this project. :)
 
Originally posted by Grey Fox
Here are some of the new features:
  • 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).

....

And report all bugs, problems, suggestions and praise here in this thread ;)
The use of a textfile is a good idea, but I've got a better one :). How about reading a .sav/.bix/.bic/.biq file to extract the tech costs, map modifiers, difficulty modifiers? You could also extract the Nr. of Civs with tech, Nr. of Civs left, Beakers per Turn, Gold invested from the .sav file!
 
Originally posted by Dianthus

The use of a textfile is a good idea, but I've got a better one :). How about reading a .sav/.bix/.bic/.biq file to extract the tech costs, map modifiers, difficulty modifiers? You could also extract the Nr. of Civs with tech, Nr. of Civs left, Beakers per Turn, Gold invested from the .sav file!
I already got that idea ;)

The problem is.
...
I can't do it :p

I got the code to unpack the saves somewhere... although, I have no idea how to read a hexfile, and then comes the problem of how the files are structured...

Maybe in a future version.
 
Originally posted by Grey Fox
The problem is.
...
I can't do it :p
Well, I've got some C++ code for reading those files which I currently use in my CIVReplay stuff. I'll let you have it for a very low cost (nothing is pretty low, right :)) if you're interested.
 
Originally posted by Dianthus

Well, I've got some C++ code for reading those files which I currently use in my CIVReplay stuff. I'll let you have it for a very low cost (nothing is pretty low, right :)) if you're interested.
Sure, I'll PM you my email adress :)
 
Top Bottom