Page 1 of 1

How Does Serfs Per 10 Houses Work?

PostPosted: 16 Nov 2014, 14:07
by Vatrix
When I was fixing TSK campaign, I found this:

Nevolníci/10 domů = Serfs per 10 Houses
ImageImage

How can I find out how many serfs will AI have?

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 16 Nov 2014, 14:45
by Lewin
So the AI has 12 houses. For every 10 houses, you've said that the AI will have 20 serfs. So for every 1 house they will have 2 serfs. Therefore for 12 houses they have 2*12 = 24 serfs.

It would probably be clearer if we called it: "Serfs per house" and made the range 0.1 to 5.0. Just divide the number by 10 to know how many serfs there will be per house.

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 19 Nov 2014, 13:05
by pawel95
I see you are using the ingame editor to fix the campaigns? I forgot totaly, but I used Lewin´s 0.3 Mission editor only. If I´m correct, some lines will be ignored by newer (Lewins or INgame) Editors and deleted?!

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 19 Nov 2014, 15:51
by Vatrix
I see you are using the ingame editor to fix the campaigns? I forgot totaly, but I used Lewin´s 0.3 Mission editor only. If I´m correct, some lines will be ignored by newer (Lewins or INgame) Editors and deleted?!
I don't know how it exactly works. Version 0.3 is just a text editor for it I think, I use it for changing BGR colors in Remake. Newer versions change the mission code somehow. (For example instead of market there's inn)

I haven't found any problems using in-game editor, maybe I just didn't look enough for minor changes...

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 20 Nov 2014, 10:42
by Lewin
I see you are using the ingame editor to fix the campaigns? I forgot totaly, but I used Lewin´s 0.3 Mission editor only. If I´m correct, some lines will be ignored by newer (Lewins or INgame) Editors and deleted?!
I don't know how it exactly works. Version 0.3 is just a text editor for it I think, I use it for changing BGR colors in Remake. Newer versions change the mission code somehow. (For example instead of market there's inn)

I haven't found any problems using in-game editor, maybe I just didn't look enough for minor changes...
It's fine to use the in-game editor for editing original KaM campaign scripts as long as the mission is thoroughly tested. Theoretically it shouldn't cause any changes, but occasionally re-ordering can cause unexpected results like different AI behavior. Testing will spot issues like that.

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 20 Nov 2014, 21:31
by Ben
As far as I know, it's been a while since Pawel worked on this missions anyway, so the Remake, itself, has changed. In my opinion, the changes in the Remake are more relevant than nitpicking about what changes the ingame editor would make.

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 21 Nov 2014, 10:20
by Vatrix
I can also redo whole missions, so I will know exactly all scripts.

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 21 Nov 2014, 21:24
by Vatrix
Another problem, everytime I set serfs per 10 houses to 43 in mission 1 TSK, after saving it gets back to 50. What's the cause?

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 22 Nov 2014, 00:14
by Lewin
Another problem, everytime I set serfs per 10 houses to 43 in mission 1 TSK, after saving it gets back to 50. What's the cause?
That's because of the way it is stored underneath in KaM missions. It's actually called "Worker Factor", and it's calculated like this:
Serfs per house = 10 / Worker Factor

Obviously this makes "worker factor" a very confusing number to use (higher number = less serfs?!), and nobody would understand it. Therefore I changed it to "serfs per 10 houses" for the KaM Remake map editor because that's easy to understand. However, you don't get the same precision, so 43 rounds to 50:

Worker Factor (WF) = 10 / Serfs Per House
50 serfs per 10 houses: WF = 10 / (43 / 10) = 2.32 (rounds to 2)
43 serfs per 10 houses: WF = 10 / (50 / 10) = 2

It was probably a bad decision to make KaM Remake missions backwards compatible with KaM missions since it means we have stupid conversions like this. On the other hand it means KaM missions/campaigns can be run in KaM Remake which is nice...

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 22 Nov 2014, 18:50
by Ben
I think it is time to make plans to ditch static scripts and have dynamic scripts work in the editor ;)

Re: How Does Serfs Per 10 Houses Work?

PostPosted: 22 Nov 2014, 19:21
by Krom
Static scripts are good for static things, so they are set once on mission load and mapmaker does not need to code them in PascalScript by hand ;-)