Some interesting things

Started by taekwondokid42, May 19, 2013, 09:43:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

taekwondokid42

I'll keep editing this post as I find interesting things because I've started diving into the code of rwl. Hopefully all of these interesting things can be turned into a wiki, and maybe one day we can even have a dynamic wiki that updates if the code gets updated! (that's a ways away, don't get your hopes up)

1. buildings cost $2500 + .1*land
2. you can build land*.015+4 buildings per turn
3. If you hit 'borrow max' when you are above the max loan, the game will just reset your loan to the max. It looks like it's supposed to take money from you, but testing has revealed that this doesn't happen. Your loan just disappears.
4. you destroy buildings at a rate of land*.02+2
5. buildings give you 1/5 the build cost when you destroy them
6. Each time you receive turns, 3% of the overdrafted cash from your account in Cluny's hut is placed into your wallet. You still get interest.
7. the amount you can save is (1,800,000 * networth * (1 + markets/land) * / (sqrt 500,000,000 + networth)) -1
8. the amount you can loan is the amount you can save divided by 5.

Kilkenne

Do you actually have a copy of RWL's code or are you using QMT or something like that?

If you have both of them, you'll know the amount of difference that I'm referring to; And a lot of the issues.

windhound

Ish.

We already have a self-updating guide of sorts.  The race page pulls values from the database.
Pulling formulas directly into the guide wont work though, somewhat because they take a bit of tweaking to be human readable to someone who doesn't know what the variables mean, and mostly because line numbers change as the code gets edited so I'm not sure how you'd tell the game which formula the guide needed.  I'm not sure I'd worry about a self-updating guide, formula changes are fairly rare and with a wiki its easily changed anyways.

The game does have a mini-wiki built in -- same one as FAF, just setup differently.  It used to function fine, I can't remember which part broke but its probably simple enough.  The biggest problem with the wiki was that it was out of date, which is perhaps worse than not being there at all.

But yeah, I mean, the formulas have all been tweaked many times throughout the past ten or so years. 
Some may even be original to the QMT code its based on, but I'm guessing most have been changed at some point or another.  The reasons for their current values will be unknowable, but there was a reason at the time...  even if it was "this seems close enough."
A Goldfish has an attention span of 3 seconds...  so do I
~ In the beginning there was nothing, which exploded ~
There are only 10 types of people in the world: Those who understand binary, and those who don't

taekwondokid42

Added #3, when you hit 'borrow all' and you have more than the max on loan, your loan is reset to equal the max, no money is taken from your account. (it looks like money was supposed to be taken from your 'wallet' but testing revealed that this doesn't actually happen. Free money!)

Shadow

ill fix that when I get back. good catch!
<=holbs-.. ..-holbs=> <=holbs-..

taekwondokid42

I actually re-factored the code for build.php, bank.php, and now I'm working on demolish.php. Windy has been getting the files as I've been changing them. Everything works the same but the code is now up-to-date php (rwl uses a lot of old php that doesn't work anymore. The server runs fine because the server runs old code, but if you updated the server to the newest version of php you'd get a lot of warnings and a few errors).

Just helping out :)

Shadow

cool. if you could keep a general changelog (if you aren't already) I'd appreciate it.
<=holbs-.. ..-holbs=> <=holbs-..

taekwondokid42

Yeah sure. If you want me to bcc all my emails to windy about the code to you also, I'll be happy to do that as well.

Shadow

I won't be able to see the code here, so no need for that. I just need to know where to look for your handiwork.
<=holbs-.. ..-holbs=> <=holbs-..

taekwondokid42

Found a new interesting one (#7):

Your maximum save value is: (1,800,000 * networth * (1 + markets/land) * / (sqrt 500,000,000 + networth)) -1

which is a really complicated equation! but that also means that having markets improves by up to 2x the amount you can save and take out as a loan.

but why is the equation so complex?

Shadow

to get proper diminishing returns at high net. its not even that complex...
<=holbs-.. ..-holbs=> <=holbs-..

Kilkenne

BUT SHADOW YOU HAVE MISSED THE POINT, EVERYTHING YOU HAVE EVER DONE IS WRONG

taekwondokid42

#12
I was just doing loose tests, but after experimenting with workers and tax rates I found:

40% tax rate is the optimal 'income' zone, though race bonuses might affect it slightly (I don't think it would, but I didn't check - I got these numbers using a +0% workers race bonus)

The difference in income between 40% tax and 32% tax is about 5%, meaning the gains are pretty small but will add up. The worker difference between these numbers is about 15%, which means if you want troops or leaders then 32% is the clear winner, but if you only need workers for income then 40% is a better number.

The difference in income between 24% tax and 32% tax is about 15%, and the difference in workers is about 10%. There are some clear tradeoffs, but if you are running a strategy that doesn't need income at all, there's still a clear advantage to having 24% tax vs. 32% tax.

The difference between 19% and 24% is about 5% workers, small but it adds up.
The difference between 11% and 19% is again 5%, but now your income is very much suffering, almost certainly not worth going this low.

And finally, at 5% tax you get _less_ workers than at 11%. In fact, 11% tax is the maximum number of workers you can have, so there is never any reason to go below 11%. And other than healing there's little advantage (less than 1% worker gain) to being less than 15% tax.

So keep your tax rate above 15%, and unless you really have no use for income, keep it above 19%. 30-32% represents a bit of a goldilocks zone where you are getting lots of extra income at only a small cost in terms of worker volume. 40-41% represents the highest your tax rate should ever be unless you are in a specific scenario that requires a quick and dirty cash infusion. (edit: thanks Shadow)

Shadow

70 is useful if you are 0 cash anx in the red and need a very short cash injection to get out of a jam
<=holbs-.. ..-holbs=> <=holbs-..