Page 25 of 26

Re: Scripting demo release candidate

PostPosted: 22 Jun 2013, 14:59
by Da Revolution
If you thought you saw them taking wood first in one of the RCs it was probably just a coincidence (since it's currently random).
As far as I know this happened all the time in RC2

Re: Scripting demo release candidate

PostPosted: 22 Jun 2013, 15:10
by Lewin
If you thought you saw them taking wood first in one of the RCs it was probably just a coincidence (since it's currently random).
As far as I know this happened all the time in RC2
Hmmmm it looks like you're right, that's weird. I think I know why, there were bugs in the delivery queue causing priorities to not work right for highest priority deliveries (meaning the first job was always chosen rather than the closest one). We'll try to reimplement this one day (but not as a bug with bad side affects like the one in RC2).

Re: Scripting demo release candidate

PostPosted: 28 Jun 2013, 11:42
by pawel95
Hey Guys, you know I like to compare the Remake with the original games quite often :lol:
So I want to tell you, what I just found in TPR with the "delivering system":

It just interested it could give some important seconds at the beginning of the Game :D

In TPR:

*You place a road-field
*Your labour start to scoop the field WHILE starting to scoop, one serf just going to the storehouse and take some stone, he brings the stone like "just in time" to the labour

In KaMR:

*You place a road-field
*Your labour start to scoop the field WHILE ....nothing happens :)
*Your labour finished scooping and wait for stone NOW the serf is going to the storehouse


=> So it isn´t that important, but after I went back to tpr to check the original balance of TNL ;-) I just saw that on normal maps(Across the desert) where your serfs have nothing to do, behave in an other way. I´m not sure how much it improve the "game speed" but it really looks more fluenty when the Serfs just go to the storehouse while the labour even isn´t waiting for stone, but still scooping.


EDIT: Ok, I see that the serfs are going to the storehouse also, but later than in TPR :D

Thats my finding XD

Pawel95

Re: Scripting demo release candidate

PostPosted: 28 Jun 2013, 11:54
by Siegfried
That's a nice finding!

Re: Scripting demo release candidate

PostPosted: 28 Jun 2013, 11:56
by Krom
I think we could improve that :)

Re: Scripting demo release candidate

PostPosted: 29 Jun 2013, 09:57
by Bence791
I'm not sure whether this would be a good thing, but let me write:
Imo the delivery of timber to the construction sites should be higher priority than timber to weapon/armory workshops. I sometimes have problems like I have my weaponries right next to my sawmills (reducing the delivery time to the least possible), thus way they get all the produced timber, and I can't build anything as long as I don't reduce the distribution of timber for them. Once on Across loc2 I forgot to build a 3rd iron mine north, the one in the middle got depleted and the other couldn't be built since it didn't get any wood bcos of my wooden weapon production :p So I had to kill the deliveries to weaponries ---> no timber delivered ----> less weapons (even if only for 10 seconds, there is a delay).
After all, building shouldn't take all the wood produced, and it can't I think (maybe if you make insane amounts of vinefields, but you know the consequences of that :p).

Good find pawel, though :D

Re: Scripting demo release candidate

PostPosted: 29 Jun 2013, 10:18
by Lewin
@Bence: Construction deliveries are always higher priority than normal ones, so timber to construction sites will always be taken over the weapons workshop. You possible just saw serfs taking timber who picked their job before the construction site was ready. If you can reproduce a case where timber is taken to the weapons workshop instead of a construction site (ignoring serfs which chose their task before the construction site was ready), please post a replay.

Re: Scripting demo release candidate

PostPosted: 29 Jun 2013, 10:22
by dicsoupcan
actually i think i did have a few situations where the construction site is ready and they brought it to the weapon workshops because they were next to the sawmills, if i get such a situation i will try to post a replay.

Re: Scripting demo release candidate

PostPosted: 29 Jun 2013, 10:28
by Lewin
actually i think i did have a few situations where the construction site is ready and they brought it to the weapon workshops because they were next to the sawmills, if i get such a situation i will try to post a replay.
The distance from the sawmill won't matter in this case because construction deliveries will always be taken before any other delivery. How long was it since the construction site was ready? Remember that serfs choose their jobs when they finish the last one, so a serf from the far side of the village could have decided to take the timber to the weapons workshop before the construction site was ready.

Maybe we should make serfs re-check for the best destination after picking up the ware, in case a better option has appeared. That would greatly reduce this "lag" in delivery decision making.

Re: Scripting demo release candidate

PostPosted: 29 Jun 2013, 10:33
by dicsoupcan
actually i think i did have a few situations where the construction site is ready and they brought it to the weapon workshops because they were next to the sawmills, if i get such a situation i will try to post a replay.
The distance from the sawmill won't matter in this case because construction deliveries will always be taken before any other delivery. How long was it since the construction site was ready? Remember that serfs choose their jobs when they finish the last one, so a serf from the far side of the village could have decided to take the timber to the weapons workshop before the construction site was ready.

Maybe we should make serfs re-check for the best destination after picking up the ware, in case a better option has appeared. That would greatly reduce this "lag" in delivery decision making.
Well yes in the end there was timber at the construction site but in the situations i had it it often took a while to have all timber there. But this serfs re-check for best destination might make them even more efficient, and not bring my gold to the storehouse while the school is empty (this case is pretty rare as far as i know though) :D

Re: Scripting demo release candidate

PostPosted: 29 Jun 2013, 13:01
by Lewin
I've implemented it so serfs check for a better delivery destination when arriving at the From house. This should make deliveries appear smarter because there will be less delay between choosing the delivery and the delivery finishing (meaning the decision is made with more recent information about the state of the village).

Re: Scripting demo release candidate

PostPosted: 29 Jun 2013, 17:18
by WollongongWolf
If you can reproduce a case where timber is taken to the weapons workshop instead of a construction site (ignoring serfs which chose their task before the construction site was ready), please post a replay.
Not sure I can reproduce, and I didn't check it to be honest, but this was really frustating (when I already was faaar behind): https://dl.dropboxusercontent.com/u/803 ... 0Landd.rar (note it was Rich Landd version 0.99)

(It was near the end of PT when I was building barracks, towers and some woodcutters)
edit: Just rewatching it, from 47th minute onwards (disaster strikes at 50 minutes (like the issue, not that I miscounted my woodcutters)

Re: Scripting demo release candidate

PostPosted: 30 Jun 2013, 04:32
by Lewin
Thanks for the replay! It helped me find a bug in the delivery system causing delivery importance to be ignored in cases where you have more available serfs than available deliveries. Importance means the special of deliveries which allows the most important ones to always be done before the least important ones (from highest to lowest: gold to school, food to soldiers, food to inn, materials to builders, everything else). The bug has now been fixed and so you won't have these problems in the next update.

Priorities were still obeyed (priority gives each possible delivery a score based on length of routes, prefer delivering to houses with fewer resources in stock, etc.), it was only the importance that was ignored. (importance and priority mean basically the same thing in English, but they have different meanings in our code as I just explained)

Re: Scripting demo release candidate

PostPosted: 30 Jun 2013, 09:36
by Bence791
Does this ("prefer delivering to houses with fewer resources in stock") mean that a barracks with 6 stones at its site will be a lower priority than a tower or woodcutter (without anything)?

Re: Scripting demo release candidate

PostPosted: 30 Jun 2013, 10:16
by Lewin
Does this ("prefer delivering to houses with fewer resources in stock") mean that a barracks with 6 stones at its site will be a lower priority than a tower or woodcutter (without anything)?
1. That rule doesn't apply to construction materials
2. It's not a fixed rule that houses with fewer resources are always delivered first, it just modifies the bid. For every resource in stock it adds 20. The initial bid is the length of the route. So if you had 2 swinefarms, one with 1 corn and the other with 0 corn, the corn would go to the one with 0 corn unless it was 20 tiles further away than the one with 1 corn.
3. There are many other factors which affect the bidding (look at the function CalculateBid in KM_DeliveryQueue.pas if you're interested).