Map Database  •  FAQ  •  RSS  •  Login

Petition for release of source code!

<<

Lewin

User avatar

KaM Remake Developer

Posts: 3822

Joined: 16 Sep 2007, 22:00

KaM Skill Level: Skilled

ICQ: 269127056

Website: http://lewin.hodgman.id.au

Yahoo Messenger: lewinlewinhodgman

Location: Australia

Post 27 Jul 2009, 00:05

Well, I've thought about it but I haven't done anything. See, things are changing. With our Remake going so well, and without the many bugs that KaM has, it would almost seem better to request permission to release our Remake officially.

The 12 year old source code would be very hard to work with, (if we can make it compile) and it would probably only be useful to find out more info about decoding. Also, it is unlikly that we would be able to make the old source code work on Vista/Windows 7 without changing the whole graphics engine.
And the programmers would have to find their way around the code that was written by someone else, possibly with few comments AND possibly completely written in German!

Why recompile old code when you can recode it using modern technolegy and avoid the many issues that the old code has?

That said, I would still like the source code for other purposes, knowing how the fighting system works, and the file formats.

Anybody got any comments? I'm open to suggestions.
Lewin.
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 27 Jul 2009, 20:39

I agree that such an old source code doesn't justy the effort to be recompiled.

For a KaM remake you almost need nothing from the source code except the file formats. I don't think you want to copy the path finding algorithms, do you? :wink:

The german language wouldn't be a problem, I think there are enough germans int he community who are willing to help (look at knightsandmerchants.de). For me, the source code would be essential to receive exact results, but since that doesn't depend on single % I don't care about the source code.

How the actual fight is calculated is well known. But not how the KI treats the formations and the enemy seeking.
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 28 Jul 2009, 03:53

How the actual fight is calculated is well known.
Well I disagree, I mean, it's not so clear to me. The official KAM site says nothing about what fighting system it uses, and with the knowledge that it uses
- chances
- attack strength
- defense
- bonus attacks
You still know nothing. It's not even actually clear whether they use hitpoints/damage or just have a kill-chance per hit based on the attack and the defense of the other, or a combination where the chance determines the amount of damage, or maybe it determines only misses/hits?
And even if the general system is known, you wouldn't have the actual values needed to compute anything - the constants that they used inside the code.
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 28 Jul 2009, 06:29

The whole story is done this way:
attack strength of the attacking unit * viewing direction / defence streng of the attacked unit; 1 is the attacking unit, 2 the defending unit.

x12 = A1 * V12 / D2

Then a random number y between 0 and 1 is calculated. If y < x12, then 2 loses a life point. If 2 has 0 life points left, it dies.

All constants were already decoded. For example the Militia has A = 0.35 (35%), D = 1 (you see, D=1 means no defensive capabilities) and L = 3.
Or, the Swordman has A = 0.55, D = 3, L = 3

The values given in the manual are correct concerning the attack values. The defence values are given in "other units". 50% means a defence value of D = 2. From the "battle formula" above you see that D = 2 halves the chance of loosing a life point, thus providing the 50%. The 70% are a rounded 66,67% corresponding to D = 3.

The only thing you yet don't know is the viewing direction. But this is a very important factor for battles.

Lets assume the defending unit stays at a point and looks towards the right ( o-> ). Then the V-values corresponds to the location of the attacking unit:

4...3...2
5..o->..1

If the attacked and the attacking unit face each other, V12 = 1.
If the attacking unit attacks from behind, it gains a factor of V12 = 5!! This makes attacks from behind brutaly and absolutely deadly!

The only remaining mystery is the attack strength of the archers. The bowman hast A = 0.6, D = 2 and L = 1; the crossbowman has A = 1.2, D = 3, L = 1.

You see, a crossbowman attacking from the side ( V12 = 3 ) decrases the life points of the attacked unit with every single shot ( the maximum defence is 3 ), because 3 * 1.20 / 3 = 1.20 is always larger than the random number ( which is maximal 1.00 ).

That's all.
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 28 Jul 2009, 06:59

How do you know that this is how it calculates damage?
<<

JBSnorro

Barbarian

Posts: 106

Joined: 20 Nov 2007, 23:00

Post 28 Jul 2009, 13:12

I suppose all the D and L values for each unit are found in that book?
And did you read anything about regeneration?

And I remember occasions where a Knight attacked a bowman from behind. Sometimes the archer is killed instantly, but sometimes it takes ages.
Your x12 would be over 1 then and so the archer should lose a life-point every strike, and if sometimes the first strike is lethal, he should always die at the first strike(which isn't the case). So I think this is not all of the story.
<<

Siegfried

User avatar

Knight

Posts: 494

Joined: 24 Jul 2009, 22:00

Post 28 Jul 2009, 17:50

How do you know that this is how it calculates damage?
All information I have comes from the strategy book, this one.

The author, Markus Betz, has done many strategy books for strategy games see here, he is especially affiliated with the settlers team.

The book has the subtitle "the official strategy book" and inside the book Betz claims he has been with Joymania for some development time and he has been told all the game's mechanics.

He then presents the battle system as cited above and values on how many production building of each production type you need to get a perfect economy.

For myself I can confirm that his tips are golden. I was stuck in lvl 8 and didn't pass until I got this book as a gift. So I trust the information presented in the book.

I suppose all the D and L values for each unit are found in that book?
And did you read anything about regeneration?
This stands in the book. It also stands in the manual as stated above (OK, the barbarian can't be found in the TSK manual)

But I wonder why you don't know these values? Those are hardcoded in the units.dat which is already well-known. I know a tool by Merchator who makes this values visible.

See, with my notation: Image
H = 3
A = 0.55
D = 3

For the regeneration time the books remains very vague. It only says "in the meantime between two battles the life points are refreshed".
I once heard it takes 20 minutes to restore all hitpoints, but this is unconfirmed and I don't know if that is true.

And I remember occasions where a Knight attacked a bowman from behind. Sometimes the archer is killed instantly, but sometimes it takes ages.
Your x12 would be over 1 then and so the archer should lose a life-point every strike, and if sometimes the first strike is lethal, he should always die at the first strike(which isn't the case). So I think this is not all of the story.
OK, if your memory doesn't trick you (maybe it was a crossbowman?) I have three possible explanations.

First has to do with my own experiences:
From Merchator's Unit editor I see that non-military units have H = 2 and D = 1. I noticed that a unit either strikes a normal unit either with two strikes or it takes him forever, but never between.
Therefore I conclude that the random number generator is not as random as it seems. I often wondered if there's a chance that it gives similiar or even equal numbers in a row. It seems that Joymania has written this function themselves, so maybe they implemented a bad one.

Maybe a bug?

My second idea is, that maybe the attacked unit was moving a tiny litte bit. This causes the attacking unit to miss.

Or, a third theory: I noted there's a bug in the formations. Sometimes, if a single doesn't use the viewing direction the legion has. Then I don't know what viewing direction is used for battle calculation. The unit's or the legion's?

As for short: I don't know what you've seen.
<<

Xoov

Peasant

Posts: 2

Joined: 08 Nov 2008, 23:00

Post 03 Aug 2009, 08:07

Lewin, maybe you can e-mail them and say, that Polish community is the biggest one and we wont't give them any money, because of law of our country, which can be interpreted in this way: after 10 years, beginning on release of program/game, every copy is legal.
TSK was released 11 years ago, TPR only 8. They do not have much time :]
<<

kuba11100

Sword Fighter

Posts: 286

Joined: 16 Jul 2008, 22:00

Location: Poland

Post 03 Aug 2009, 08:27

Nonsense... There's no such a law in Poland (and Zuxxez isn't a Polish company anyway).
<<

Xoov

Peasant

Posts: 2

Joined: 08 Nov 2008, 23:00

Post 03 Aug 2009, 21:06

Did they release KaM in poland?

I cannot say am I right or not, because I am looking for this in documents. I said, what are students told. I think it can be only Urban Legend :D
<<

kuba11100

Sword Fighter

Posts: 286

Joined: 16 Jul 2008, 22:00

Location: Poland

Post 04 Aug 2009, 08:36

It surely IS a urban legend, just like "you have to remove that after 24 hours" and many other.

BTW freeware =/= open source.

The game was published in Europe by TopWare (later bought by Zuxxez).
<<

AIanbach

Peasant

Posts: 1

Joined: 05 Jan 2010, 23:00

Post 10 Aug 2009, 16:52

Hi, it`s me - sorry, that I`m not logged-on, but it takes too many time. I`ll regster as soon as I`ll be able.

Xoov :arrow: Lewin don`t need to e-mail to Polish fans, because they know about everything. A huge news about it is on the front polish KAM site and forum.

kuba11100 :arrow: You`re wrog honey :wink: My mom is a lawyer and she said that in Poland there is similar law, but it means: that product loses personally law after 20 years!! So it took to long. We could have that source legally in..about 2018 :roll:

Xoov :arrow: about Your another question: yes, they released KAM in Poland by TopWare Interactive. MOREOVER there was RE-release - some kind of GOLD GAMES with KAM. And KAM TSK was available for FREE in one of Polish computer magazines in 2003 or 2004.

Cheers
Alanbach
<<

kuba11100

Sword Fighter

Posts: 286

Joined: 16 Jul 2008, 22:00

Location: Poland

Post 10 Aug 2009, 18:19

You`re wrog honey My mom is a lawyer and she said that in Poland there is similar law, but it means: that product loses personally law after 20 years!! So it took to long. We could have that source legally in..about 2018
Which paragraph says that?
AFAIK it lasts until 70 years after author's death. Not so long :wink:
<<

harold

Knight

Posts: 562

Joined: 19 Nov 2007, 23:00

Post 10 Aug 2009, 18:23

That's the copyright law on art. In some countries anyway. Programs shouldn't be the same as art.. but maybe they are?
But if they are, it would not make sense. Software moves fast - after 100 years (70+some years to kill author) the software will be useless, probably the computers then will not even run such old programs.
<<

The Dark Lord

User avatar

King Karolus Servant

Posts: 2154

Joined: 29 Aug 2007, 22:00

KaM Skill Level: Veteran

Location: In his dark thunderstormy castle

Post 15 Aug 2009, 08:02

Damn the source code, long live the remakes!

Return to “General Talk”

Who is online

Users browsing this forum: No registered users and 1 guest