Return-To-The-Roots / s25client

Return To The Roots (Settlers II(R) Clone)
http://www.rttr.info
GNU General Public License v2.0
476 stars 75 forks source link

[ADDON] Ability to change fixed 70% catapult hit rate (e.g. depending on distance) #181

Open Spikeone opened 9 years ago

Spikeone commented 9 years ago

In the original game the chance for a catapult to hit also depended from node-distance. In RttR there is a plain 70% chance to hit a target. In our forum there was once some statistics from DNG which should also apply Settlers II.

http://www.siedlercommunity.de/c-Das-Militaer-s20.html 1.) 7 Knotenpunkte entfernt: X 1 1 X 1 X X 1

2.) 12 Knotenpunkte entfernt: X X 1 X 1 X X X

3.) 14 Knotenpunkte entfernt: X X X X 1 X X X 1.) 7 Knotenpunkte entfernt: X 1 X 1 1 X X 1

2.) 12 Knotenpunkte entfernt: X X 1 X 1 X X X

3.) 14 Knotenpunkte entfernt: X 1 X X X X X X

MarcusSt commented 8 years ago

@Spikeone What about the other distances? Is it possible to have some kind of lookup table?

Flamefire commented 8 years ago

Trying to fit those values gives a probability function as: y = -54.02344711 ln(x) + 155.1463237 or y = -1.785714286·10-1 x² - 1.607142857 x + 70

The 2nd (quadratic) fit looks better, as we get the 70% around very close distances and it is also easier to implement in fixed-point math (can't use floats for this due to asyncs)

MarcusSt commented 8 years ago

This may not be a bug at all. @jhkl is doing some tests atm and it very much looks like a distance independent 70% hit rate.

jhkl commented 8 years ago

Tested in original S2 Gold Edition (1.51) in Dosbox 0.74:

Kills Stones Distance Direction of Shot Target Building Kill per Stone
62 100 9 Fortress 0,62
70 100 11 Fortress 0,7
64 100 7 Fortress 0,64
77 100 9 Fortress 0,77
76 100 11 Fortress 0,76
708 1000 4 Barack 0,708
688 1000 6 Barack 0,688
694 1000 8 Barack 0,694
703 1000 10 Barack 0,703
693 1000 5 Barack 0,693
689 1000 9 Barack 0,689

Test settings:

s2_004 s2_005

70% seems to be a appropriate hit rate. Distance and type of building does not seem to influence the hit rate significantly.

Spikeone commented 8 years ago

No idea how to post a +1 with a mobile phone, but great testing! We should convert this bug to a addon wish or does anyone disagree?

Flamefire commented 8 years ago

Well done :+1: I guess an Addon is ok, but pretty much at the bottom of the priority list. I don't think this puts much value into the game as one probably won't notice if it is 70% or 60%

Spikeone commented 8 years ago

Well, you do. The first Addon to decrease such problems was the limit addon, less catapults, less chances to hit. If they were less accurate you could allow more catapults, most games wont run with a limit for 3 anymore. That way the building would be used more than it is at the moment