Latest Posts

Topic: Weapon reuse?

Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-17, 11:32

Tinker wrote:

With regard to not building recycling until after training sites would a prohibited_till that is the same or greater than the training site be enough to delay the buildings? Or would it be better to make the recycling a helper for training sites?

Yes, prohibited_till can be used, but I would first try to leave it to genetic algorithm, but first make your branch working and my current changes in AI incorporated, I can test it and see if AI builds or not these sites and in what timing. Afterwards we can consider further steps.

As for "helper" sites, this is not the right approach, first there is geographical aspect that is not needed here, and then there is no guaranty that helper site will not be built before site to be supported...


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-18, 13:22

wow, I found interesting issue. AI check when building a productionsite if suppliers exists. So for metalworks it looks for smelting works. So far so god, but as recycling centre also produces iron, but is in no way reliable and full-fledged iron producer, so AI have to ignore recycling centers as producers. I will change the code accordingly....

ALSO: if talking about ware: scrap_metal_iron (barbarians tribe) there is only one producer and it is the recycle centre itself. This itself leads to eternal recursion, and if we disallow the site as its own supplier (in AI code when looking for suppliers), AI will conclude that the recycle center does not have all suppliers for own inputs and will be less wiling to build it... messy...

It would help if all inputs of recycle centers were "normal" productionsites...

EDIT 2:

in other words, when AI would consider building the recycle center, it would be less willing because it does not have recycle center as an (single) producer for one of inputs of considered recycle center...

Edited: 2017-12-18, 13:51

Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 10:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-12-18, 16:32

The main producers of scrap metal are training sites, with Barbarians 90% is produced by the training camp, in one case - chain mail armour - I reduced the efficiency of the recycling by outputting the metal part as scrap iron, the recycling inputs 2 scrap iron and coal to create 1 iron bar. The idea of not outputting the scrap but converting to iron bars in one go is possible but, in my mind, to efficient, perhaps making the work cycle longer would help. I can change this but the main problem seems to be that the AI does not consider training sites as producers, although recycling in a similar way already works for Frisians.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-18, 21:26

Well, I can just repeat, there are two issues:

  • AI is not able to distinguish "normal" productionsites like smelting works from recycling centre that has very unreliable output
  • You introduced circular supply chain that has never been here before, like A ->(=delivers to) B -> A -> B -> A .... or even A -> A -> A ->... AI uses recursion here to find out if all suppliers (and suppliers of suppliers and so on) exist, but get into endless recursion

Maybe we can create new category of productionsites - recycling centres that will be excluded from that suppliers chaining thing...


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 10:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-12-19, 10:54

I was unsure of the wisdon of a circular chain in any case. What I can do is keep training sites sending old weapons as scrap to be recycled, armour goes to another site where the armour is dismantled into cloth and scrap metal (if it was made with metal added) the scrap metal then goes to be recycled. This would mean adding another small building to Empire and Atlantians to disassemble armour, a small increase in costs and complexity but no circular supply chain.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-19, 12:29

Well I dont see a way how to avoid circular supply chain, because you still preserve chain like: iron -> something -> scrap iron -> iron...

So this must be tackled from other angle.. what about creating new category of productionsites "recyclingsites", where AI will build only one, and one of triggers to build them will be amount of scrap material on stock (scrap iron or whatever). Or we can just let AI to evolve small bonus for recycling sites and let genetic algorithm cope with it... this seems the easiest way...


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 10:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-12-19, 14:10

The new armour recycler does remove a site being a consumer and a supplier for the same ware. I have created two new buildings and am currently testing them before udating the branch.

I am happy with any simple solution to improving AI, if a general algorithm can do it then that might be best.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-19, 20:53

Tinker wrote:

The new armour recycler does remove a site being a consumer and a supplier for the same ware. I have created two new buildings and am currently testing them before udating the branch.

Well, the size of "circle" does not matter - one building or multiple - at the end it is still a circular chain. So this is not the road...

I am happy with any simple solution to improving AI, if a general algorithm can do it then that might be best.

I suggest:

  • (outputs of) trainingsites will be ignored when calculating supply chain
  • recycling centers will not consider their supplier chain at all, but will get additional bonus to compensate this

The question is whether each tribe will have one and just one recycling center, or they will be optional and their number not limited. I would prefer first option (the same as we have one lumberjack, well, barracks and few other buildings)


Top Quote
Ex-Member
Avatar
Joined: 2014-09-12, 10:53
Posts: 184
Ranking
Widelands-Forum-Junkie
Posted at: 2017-12-20, 11:44

Almost all wares have circular paths. A farmer needs a scythe to collect grain to make bread to feed miners, who mine iron to go through a smelter to a toolsmith who makes the scythe.

I am happy with your suggestion. I am not sure what you mean by the last paragraph, you seem to imply that AI only builds one woodcutter, or do you mean in the basic economy? Does this mean you are suggesting one recycling centre in a basic economy or one total? I do not think recycling should be optional once training sites are made, one recycling centre can just about keep up with 3 optimally supplied training sites producing scrap with an optimised road system. So one recycling centre might be enough in many cases.


Top Quote
Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2017-12-20, 12:22

Tinker wrote:

Almost all wares have circular paths. A farmer needs a scythe to collect grain to make bread to feed miners, who mine iron to go through a smelter to a toolsmith who makes the scythe.

I understand what you mean, but in this case here you are not right, scythe is not input of a farm. E.g. barbarian farms have no inputs.

I am happy with your suggestion. I am not sure what you mean by the last paragraph, you seem to imply that AI only builds one woodcutter, or do you mean in the basic economy? Does this mean you are suggesting one recycling centre in a basic economy or one total? I do not think recycling should be optional once training sites are made, one recycling centre can just about keep up with 3 optimally supplied training sites producing scrap with an optimised road system. So one recycling centre might be enough in many cases.

Look at wood cutters, each tribe has just one:

  • barbarians_lumberjacks_hut
  • empire_lumberjacks_house
  • atlanteans_woodcutters_house

And you cannot (without changes to the code) create second woodcutter for a tribe, and neither create a new tribe without just one woodcutter**. So this is kind of architectural decision ... and I would prefer this way...

** Or perhaps you could, but it would confuse AI... AI would not know that that second woodcuter needs trees, because it would not understand that it is a woodcutter...


Top Quote