Kromster80 / kam_remake

"KaM Remake" is an RTS game remake written in Delphi from scratch.

Home Page:http://www.kamremake.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Major] Serfs don't optimaly deliver resources to houses (To be updated)

TehPlayer14 opened this issue · comments

Video reference https://youtu.be/DB6mqq291CA

So first of all serfs in TPR prioritize on doing optimized delivering to houses which don't have any reserve of said resource regardless of house distance to reduce impact on waiting worker for said resource (In this example coal)

2 Smelting has higher priority than any other deliver order regardless of distance

3 Gold has higher priority than most of the wares when delivering to storehouse

4 Serfs seem to use delivery more smarter in TPR than in Remake (for example they usually deliver required resource and return with a ware)

This should heavily affect AI since it used to run out of gold despite having gold ore and coal in storehouse but never ended up being delivered in first place

I've been aware of this bug for 2+ years but now I m sure that it exists because I play around with AI alot

PS: Ignore higher amount of gold on KAM REMAKE side because I didn't put right units onto the map in the TPR copy and I had to recruit them....

commented

Hello @michal1324

Currently I started some work with delivery, so its a good time to fix possible delivery issues.

As for the 1st, If I understand correctly, your point is that 1 worker can wait for resourse more, if he is far away, from another house. I tried to figure that out by your video, but did not get it there.

We have that part of code, to be sure distance is not the main thing there. Here it is

May be (aOfferCnt < 3) condition has to be adjusted. It means we have 1 or 2 offer res (coal at the coal mine, f.e.) also we must have not more then 1 res at our house.
I can try to adjust those parameters, lets say to aOfferCnt < 4) and Demand[ware] < 3.

  1. We do not have this in KaM. Probably its good to add it

  2. Gold has higher priority, the highest, actually.

  3. We have 'return with ware' feature, you can see it on your video.

I have to explore code more, to find out where could be a problem.

Probably 'return with ware' feature happens only when other serf did not take this offer (he is on the way). If that is true, we can reassign that delivery to serf who is already inside the house. Do you confirm that ?