Handy (interesting?) formula

Started by The Beatles, November 03, 2003, 03:30:56 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

The Beatles

 This evening on the bus home I was in a state of Extreme Boredom. I don't do this often, but I had neglected to bring a book, stupidly enough, and the conversation of some cocky freshmen in the back failed to engage me. So I pondered RWL a bit. As you may or may not know, I recently had a RWL near-death experience (© Mikalae), so... that's where my thoughts turned. I was curious just how many attacks need to kill you off given that you start with t land, m percent of your land is taken from you per turn, and when that would be zero, about g acres are taken per turn.
This proved to be more complicated than I thought. Not difficult, but the end result surprised me. I'll put it into a script tomorrow, if I have time, but anyhoo, for your benefit, here is the best formula I could come up with.
I recommend that you take m = 9.3 and l = 2, because in practice that seems to be correct. That, or 3.




~Beatles

wolf bite

 I must say: ?Wow?!  It is not that I can follow this completely, but a few questions.  I am not second guessing you, just thinking.  You gave the meaning of L and M, but not for the other factors you using.  How far is the veritable for amount of land taken, and then are you using an average of that amount?  Also, the amount of land taken would change based on the type of attack.  So if the type of attack and the average of that type where already calculated in a sub formula that could be dropped in, then you would simply have to keep dividing land by average of land taken?

Land - average of % of land taken for type of attack = loss (0 =1) to the power of land?

Wolf Bite
********************
Grand Master Wolf Bite
********************
Wolf Pack =  Klowd19, Blood Wake, Sonoras, Giggles

The Beatles

 I'm sorry if I explained it badly yesterday, I was a bit tired. So, then.
m is the multiplier by which your land goes down per attack. Suppose 7% is taken per attack, then 93%, or 0.93 is the multiplier.
If the land taken would be zero, in practice, I notice that usually 2-3 acres are taken by attack. That is g.
There is no quantity l. That's a one.
t is the total land you start with.

Delta, then, is the attacks it should take to kill you. That is, assuming m = 0.93 and g = 2 are about right.


[edit]I just tested this.
http://rwcenter.net/tokill.php?land=6000
Yesterday, I had about 6000 acres of land. 113 attacks, my formula says.
Note how reasonably it acts:
http://rwcenter.net/tokill.php?land=5000 : 110
http://rwcenter.net/tokill.php?land=6000 : 113
are only 3 attack apart, which in our experience of the game is reasonable. Now I'll check my attacks.


[edit2]Now, with a value of 3 for g:
http://rwcenter.net/tokill.php?land=6000&g=3 I get 128 attacks. That is weird, I'll check it right away. It shouldn't do that. It should depend inversely. I may have to modify the formula.

At any rate, the formula is reasonably good. I have 143 defenses, so about 108 of those were for my kill.... I'll check this thing about g though right away.


[edit3]I'll work on this some more during my spare time and come back in an hour or so. Or 2, don't know how long my appointment will last.

The Beatles

 Ok, so I was brain-dead yesterday. I didn't realize that the threshold depends only on m, not on t. Very silly of me. That allows for a much simpler formula. Apologies. So, here is the new formula. I've tested it and it works fine, coming within 1-2 attacks of actual simulation values. Cheers!



Once again, I recommend:
m = 0.93
g = 2


I'll try to make a formula you can stick in Army Management in-game based on the taylor series for natural log.

The Beatles

 So then....
ln(m) ca. -0.072570692834835430711573347903846
ln(1-m) ca. -2.6592600369327780629306301659255
ln(100) ca. 4.6051701859880913680359829093687

So then:
((4.6051701859880913680359829093687-2.6592600369327780629306301659255-ln(t))/(-0.072570692834835430711573347903846))+(7/2)

Now for an approximation for ln(x):
Too hairy, this formula is bad enough without that. I'll ask Retto, but if not, this may be the only way.

[edit]m = (0.9lf + 0.93 lu)/(lf+lu)
where lf = free land, and lu = used land
is that right, someone?

Gen. Volkov

 Cept for on thing, there is a chaos factor built into RWL, so you don't always take the same percent each turn. Oh byt the way Beatles.. like the return to your old siggy.
It is said that when Rincewind dies the occult ability of the entire human race will go up by a fraction. -Terry Pratchett

cloud says: I'm pretty sure I'm immune to everything that I can be immune to...brb snorting anthrax.

Sticker334 says(Peace Alliance): OMG! HOBOES

The Beatles

 Mm? Izzat my old siggy?
Volkov, what you're talking about is random multipliers. But those average out on the long run, so my results are pretty lovely accurate.

[edit] My results are pretty lovely accurate, eh? AD! I'm getting my baseball bat!
[edit2]o.O I don't have a baseball bat... just realized... and I don't really play sports. AD! I'm getting my skiffs!

Gen. Volkov

 *Nods* Yep it certainly is... anyway, I see your point about the multipliers, I retract my previous statement.
It is said that when Rincewind dies the occult ability of the entire human race will go up by a fraction. -Terry Pratchett

cloud says: I'm pretty sure I'm immune to everything that I can be immune to...brb snorting anthrax.

Sticker334 says(Peace Alliance): OMG! HOBOES

The Beatles

 No, Retto won't add logs to his formula parser. So I will toddle off and do a Taylor approximation of natural log.

Riverpaw

 
QuoteIt could take ca. -INF attacks to kill you.

:lol:
You need to make an input form... or at least something to make sure this doesn't happen when $_HTTP_GET[land] = NULL .
I am back. First to notice gets a cookie...

*ten years later*

Oh.

The Beatles

 No, it's your own problem if you screw with it. I don't want to make a foolproof program, I want to make something that will respond intelligently to intelligent users. If you get something like that, go and gloat, I could care less.

Veranor

 Idiots and malicious users are the only reason software takes so long to develop.
#127.0.0.1 rovl.org

Riverpaw

 What?! It was funny... Besides, it wan't my fault... I assumed there was an input form...
I am back. First to notice gets a cookie...

*ten years later*

Oh.