Verified:

nah1986 Game profile

Member
54

Feb 21st 2023, 17:33:19

https://github.com/...arth-Empire-SuperComputer
Okay, I changed the code. It no longer needs anything except standard C++ libary.

For the developers of earth empire. Can you help me.
I get with my code
Tax Revenues with max pop=1.08827e+06
but, in the web browser game, I get $1,100,528
Everything is open source. Can somebody help me find the problem?

Gerdler Game profile

Forum Moderator
5077

Feb 21st 2023, 21:04:56

I can see one error

'/90000' should be '/18000'. For whatever reason this was changed either when they remade the game from E2025 or somewhere during the EE times.

You didn't specify enough other stuff for me to see if that is enough, but that was the part I thought was wrong and it seems to be.

Gerdler Game profile

Forum Moderator
5077

Feb 21st 2023, 21:06:18

I dont know where you have it else but I was looking in main.cpp

nah1986 Game profile

Member
54

Feb 22nd 2023, 1:33:04

in main.cpp, line 320 and line 339 are comments

LittleItaly Game profile

Game Moderator
Alliance & FFA
2177

Feb 22nd 2023, 4:44:32

link no longer worked in your post. had to google it. https://github.com/...arth-Empire-SuperComputer

also perhaps this will get you closer: https://wiki.earthempires.com/index.php/Formulas
LittleItaly
SOL Vet
-Discord: LittleItaly#2905
-IRC: irc.scourge.se #sol
-Apply today @ http://sol.ghqnet.com for Alliance

Gerdler Game profile

Forum Moderator
5077

Feb 22nd 2023, 5:32:28

Originally posted by nah1986:
in main.cpp, line 320 and line 339 are comments

I'm assuming thats the formula you are using... I'm just telling you its wrong and how to fix it.

The one LI linked you on the game wiki which is also wrong, it has the exact same error as the one in your github. The game code has been changed since.

Requiem Game profile

Member
EE Patron
9092

Feb 22nd 2023, 13:34:06

This isn't the most intuitive but there is a lot of information about the game buried within the Announcements forum. There are many posts labeled "Changeset _" you might spend some time searching around.

There could be other random posts with information. Mostly search for posts created by Qz, Pang, and Slagpit.

Other than that you can purchase game currency and reverse engineer the formulas with the test server: alphaui.earthempires.com

Good luck!

Gerdler Game profile

Forum Moderator
5077

Feb 22nd 2023, 14:53:58

It may have been mentioned in a changeset, yes.

It is A LOT of work to try to reverse engineer formulas from the ground up. The pop formula would be quite easy but already at the complexity of the PCI formula would be a lot of work unless you know the structure of the formula, such as the factors that go into it. Fortunatly, the PCI formula is out there and its the exact same structure as before.

Then theres real hard things that no one has reverse engineered so far. Stuff that actually matters, even.

Requiem Game profile

Member
EE Patron
9092

Feb 22nd 2023, 15:13:14

Cool. Just giving him other options to explore in case it wasn’t known to him. Typically C++ programmers are very capable of great things.

Gerdler Game profile

Forum Moderator
5077

Feb 23rd 2023, 7:05:04

Originally posted by nah1986:
in main.cpp, line 320 and line 339 are comments

Have to change row 26.

It's my bad for not checking how it was written there.

I guess thats the only place?

Just change it to 18000 and check the results. You have the old PCI formula. I have no idea if there are other issues as well, but we can't know that without using the current PCI formula. :)

nah1986 Game profile

Member
54

Feb 26th 2023, 10:21:33

I just right now copy the value from advisor page. Utopia angel had like a science calculator were you could see how much you could improve your science.

nah1986 Game profile

Member
54

Feb 26th 2023, 10:26:54

Anyway, it seems Utopia Angel is no longer used and I can't find it anywhere., but the fact it that this software is inspired by Utopia Angel

Gerdler Game profile

Forum Moderator
5077

Feb 26th 2023, 20:10:16

Utopia angel was great. Utopia now has some integrated tool for calculations and discord "spy op"-sharing(i forget what they are called but the intel ops in utopia).

I'm not very good at coding so I just use excel or google sheets for stuff like this.
If all you got is a hammer every problem looks like a nail. :)

nah1986 Game profile

Member
54

Mar 1st 2023, 14:49:56

So, I am now trying to make the code work as a communist indie. What is the industrial cost per: Troop, Jet, Turret, Tank and Spy?. Also is industrial production (industrial zones)*(communist bonus)*industrial tech or (industrial zone)*(communist bonues + industrial tech)?

Tmac Game profile

Member
890

Mar 1st 2023, 15:06:01

The first one. IC×tech×govt bonus. I think everything is multiplied in this game.

As for how much a base indy produces I don't know exactly. I came up with 1.86 jets or turrets or troops per IC before, but someone else prob knows exactly as well as the tank/spy values.

Gerdler Game profile

Forum Moderator
5077

Mar 1st 2023, 16:48:58

hmm iirc:
Troops 1.86
Jets 1.86
Turrets 1.86
Tanks 0.4
Spies 0.62

Edited By: Gerdler on Mar 1st 2023, 17:27:38. Reason: Fixed spies number.
See Original Post

Tertius Game profile

Member
EE Patron
1459

Mar 1st 2023, 17:20:12

It's actually .62 spies, but that's correct otherwise.

Gerdler Game profile

Forum Moderator
5077

Mar 1st 2023, 17:26:15

Hah. Thats so weird. I never knew that. All I knew is if I'm indy and do all spies I get a lot of spies fast!

Celphi Game profile

Member
EE Patron
6302

Mar 2nd 2023, 6:10:37


(() => {


class Country
{
constructor({ tax_rate, networth, land, ent, bus_tech, gvt_pci_bonus, population })
{
this.tax_rate = tax_rate;
this.networth = networth;
this.land = land;
this.ent = ent;
this.bus_tech = bus_tech;
this.gvt_pci_bonus = gvt_pci_bonus;
this.population = population;
}

getPCI()
{
return this.getTwoDecimalRound(
22.5
* (1 - this.tax_rate)
* (1 + ((this.networth/this.land)/18000))
* (1 + (2 * (this.ent/this.land)))
* this.bus_tech
* this.gvt_pci_bonus
);
}

getRevenue()
{
return Math.round(this.getPCI() * this.population * this.tax_rate);
}

getTwoDecimalRound(val)
{
return (Math.round(val*100))/100;
}
}

const country = new Country({
tax_rate: 0.35,
networth: 4708,
land: 100,
ent: 0,
bus_tech: 1,
gvt_pci_bonus: 1,
population: 803
});

console.log(country.getPCI());
console.log(country.getRevenue());

})();


Output:
14.66
4120

Numbers work for me.

Note: The function with (val*100)/100 is required due to precision bug in all coding languages.

Edited By: Celphi on Mar 2nd 2023, 6:19:19
Resistance is futile. You will be assimilated.

Celphi Game profile

Member
EE Patron
6302

Mar 2nd 2023, 6:24:24

It would be a fun project to try to "solve" this game with reinforced machine learning. Sorta like how alphazero works.
Resistance is futile. You will be assimilated.

nah1986 Game profile

Member
54

Mar 7th 2023, 15:10:32

Celphi
I know. Not having classes in my code would not be considered a good thing in C++ class.
I have been just putting something together for 9 years. "Just something to help you play the game"

nah1986 Game profile

Member
54

Mar 7th 2023, 15:39:00

https://github.com/...r/blob/main/makeMoney.cpp
Can somebody tell me why this line 15 is not opening google.com on my Ubuntu? Do, I need to run it on sudo?

Celphi Game profile

Member
EE Patron
6302

Mar 9th 2023, 14:28:30

Resistance is futile. You will be assimilated.

nah1986 Game profile

Member
54

Mar 12th 2023, 21:06:17

So, has anyone actually used my software? I have worked 2 h as a master's of engineering reviewing finished software. (This is not a joke). It was always a team project to build something in programming class that was more than command line based.

nah1986 Game profile

Member
54

Mar 31st 2023, 7:12:09

Celphi what SDK is used with coding this game? I have just programmed with Gedit on Ubuntu.

nah1986 Game profile

Member
54

Apr 11th 2023, 11:35:38

So anybody using this software? What features would you like me to implement. Right now the software can predict profit for communist industrialist, democratic casher.

Gerdler Game profile

Forum Moderator
5077

Apr 11th 2023, 12:08:26

I don't use this only because I have it in Excel and google sheets and they are more my kind of toys.

I suppose implementing it for more strategies wouldn't be that hard as you got casher down which is the hardest mathematically. And of course tax income is part of all the other strategies as well so you done half the work there already.

TPT formula from memory is something like

Tech per turn = 3 + Labs * 0.17 * (1 + labs/land)

Food production formula something like:
Food production = (0.4 * unbuilt acres + 5.3 * farms) * govt food bonus * agri tech level

nah1986 Game profile

Member
54

Apr 11th 2023, 13:43:45

This game is little bit like chess. There was 50 dollar chess games in the 90s, it is no longer top selling game, but it refuses to die.

Tertius Game profile

Member
EE Patron
1459

Apr 11th 2023, 15:23:44

Just confirming both of those formulas above are correct.

nah1986 Game profile

Member
54

Apr 17th 2023, 13:05:47

OK
I don't actually calculate unused land as producing food, since I though that unused land is only temporal.
FarmProduction = agrciculturaTech*5.3*Farmint*GovermentFarming(govermentString); 615 main.cpp

nah1986 Game profile

Member
54

Apr 19th 2023, 15:27:03

I updated the code so it shows spy strength

https://github.com/...arth-Empire-SuperComputer

nah1986 Game profile

Member
54

Apr 24th 2023, 10:41:29

Hello, is there any feature that people would like me to code to improve the software?

Celphi Game profile

Member
EE Patron
6302

Apr 25th 2023, 20:14:19

Geez why C++?!

Why not python?
Resistance is futile. You will be assimilated.

nah1986 Game profile

Member
54

Apr 26th 2023, 7:10:00

I was doing a C++ course and play Earth Empires. That is the original reason of the language choice

nah1986 Game profile

Member
54

May 6th 2023, 16:53:37

Hi, I just added minimum jets to break opponent with standard strike/ standard strike+10%/planned strike/ planned strike+10%. At this moment it does not take into account enemy technology

nah1986 Game profile

Member
54

May 6th 2023, 16:54:58

or enemy Readliness

nah1986 Game profile

Member
54

May 15th 2023, 6:57:02

Okay, so the tax rate is between 1 - 70 %.
I could program to show that with lower tax rate there would be more people, but there would not be much profit, since the tax you get from people is so little.

nah1986 Game profile

Member
54

May 15th 2023, 12:37:08

Okay, so I updated the open source project at Github, right now if you first type '1' and paste standard advisor report.
and then type '500' , it will give you report about how many people will settle on your land. I think this number is somewhat. It seems to be off by 2. So likely a rounding error. Anybody interested in trying to find the bug in the source code?

nah1986 Game profile

Member
54

May 16th 2023, 21:02:11

Okay, so. At the moment, I have gotten close result calculating max population and max PCI with 40% tax rate.

for PCI, I get 30.8466
but in the game, in reality it is 31.49

Code can be read at

https://github.com/...omputer/blob/main/pci.cpp
Do, I need to break the calculations into 6 lines, like it is above?


22.5
* (1 - this.tax_rate)
* (1 + ((this.networth/this.land)/18000))
* (1 + (2 * (this.ent/this.land)))
* this.bus_tech
* this.gvt_pci_bonus

nah1986 Game profile

Member
54

Jun 20th 2023, 11:42:03

Okay, so I am having trouble at this moment with
https://github.com/.../blob/main/goverments.cpp

lines 92 to 111


//std::cout << "military tech " << (1.0+(1.50*GvtTech-1.00)*GvtTech*(exp(2.71828)-1.0*points/(780+5.75*land)) << std::endl;
//puts("TODO");
return 1.0;

this just returns 1.0, can somebody program this for me?

nah1986 Game profile

Member
54

Jul 18th 2023, 11:57:49

okay, I may have gotten that to work.
Can somebody find the rounding error that explains why I get
with 346 industrial complexes, 103.0% industrial tech. There is a mistake by one unit when I produce 100% turrets. The numbers are "895" and "894"

nah1986 Game profile

Member
54

Aug 10th 2023, 10:35:03

so the guy who have military alliances do you see somewhere streght of your ally's military?

Gerdler Game profile

Forum Moderator
5077

Aug 13th 2023, 17:20:05

Yes, you can click them on relations page.

nah1986 Game profile

Member
54

Aug 14th 2023, 11:31:30

Hi, so what defensive strength formula? Also, is there like a page in alliance that shows how strong your allies are?

nah1986 Game profile

Member
54

Aug 22nd 2023, 14:50:08

Okay, I got $89926.8 dollars as my tax income when cashing, but ingame. I got $89,943 . Maybe the accuracy of this is enough? Do you guys think, I should include estimate how much food the population eats? as that is dependent on population. In reality the only function of the population is to contribute as tax payers. Maybe, I should make a number about how much tax revenue a single person brings to the country and compere that to how much it cost to feed that single person.

nah1986 Game profile

Member
54

Sep 6th 2023, 10:41:35

Okay, now I can reliably predict if a standard strike or planned strike will be success. I can also predict cash incomes for democratic casher. I hope to release the software soon

nah1986 Game profile

Member
54

Sep 14th 2023, 18:35:48

So, I used my software to attack a theocracy and fasicim. The defemces held, its possible I copy-pasted something wrong. Is anyone interested in trying to find a bug?

Celphi Game profile

Member
EE Patron
6302

Sep 15th 2023, 13:11:18

Sure. Post code for attacking. It's likely you're missing the oversend requirement.
Resistance is futile. You will be assimilated.

Gerdler Game profile

Forum Moderator
5077

Sep 15th 2023, 15:01:41

Originally posted by nah1986:
Okay, I got $89926.8 dollars as my tax income when cashing, but ingame. I got $89,943 . Maybe the accuracy of this is enough? Do you guys think, I should include estimate how much food the population eats? as that is dependent on population. In reality the only function of the population is to contribute as tax payers. Maybe, I should make a number about how much tax revenue a single person brings to the country and compere that to how much it cost to feed that single person.

That could be rounding in the PCI or some rounding error in your own numbers.

I always calculate;
tax income per turn
tax income per turn while cashing
tax income per turn - food cost of pop
tax income per turn while cashing - food cost of pop

I also calculate those per acre.

Once you did one its so easy to do all that in a sheet.

neversilence

Member
202

Sep 15th 2023, 21:43:21

Don't let Gerdler fool you with his impeccable math skills. All his powers lay within the exploit(s)!

Edited By: neversilence on Sep 15th 2023, 22:05:11