Latest Posts

Topic: Rework Atlantean Crystal Mine

hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-08, 15:38

GunChleoc wrote:

Teppo & I have dug into the code on IRC and have found that if a ware has no target quantity, it acts just as if target quantity = 0.

~~~~ bool Economy::needs_ware(DescriptionIndex const ware_type) const { Quantity const t = ware_target_quantity(ware_type).permanent;

// we have a target quantity set if (t > 0) { Quantity quantity = 0; for (const Warehouse* wh : warehouses_) { quantity += wh->get_wares().stock(ware_type); if (t <= quantity) return false; } return true;

  // we have target quantity set to 0, we need to check if there is an open request

} else { for (const Request temp_req : requests_) { const Request& req = temp_req;

      if (req.get_type() == wwWARE && req.get_index() == ware_type)
          return true;
  }
  return false;

} }

~~~~

Might be enough, but we still have to think about this some more.

ETA: We have decided to add "unless economy needs log" to the coal burners and playtest to see how it handles.

https://bugs.launchpad.net/widelands/+bug/1765963

I just tested this. Without any economy setting (this means defautl_target quantity is empty) no charcoal kiln ever produced as the target is not 0 like assumed in the code example above it is kInvalidWare.
with a defauklt_target_quantity of 0 it is producing if there isn't an unsatisfied demand. so in a shortage of wood one kiln produces and therefore has unsatisfied requests (visible in the inputqueue by light coloured open slots) no other kiln produces even if fully stocked.
That could be expected. but even with an amount of 0 set the economy setting reappears in the economy window.

So my conclusion is this wont work as described here.


Top Quote
the-x
Avatar
Joined: 2019-01-19, 13:23
Posts: 967
Ranking
One Elder of Players
Posted at: 2020-02-08, 16:57

The principle of the Crystal Mine is very effecient, i think --> like producing several minerals. Actually it would be great to change for other tribes also mines that can - randomly - produce ressources?


Top Quote
hessenfarmer
Avatar
Joined: 2014-12-11, 23:16
Posts: 2646
Ranking
One Elder of Players
Location: Bavaria
Posted at: 2020-02-08, 18:32

the-x wrote:

The principle of the Crystal Mine is very effecient, i think --> like producing several minerals. Actually it would be great to change for other tribes also mines that can - randomly - produce ressources?

I don't think they are producing randoml. However there has been great consensus then rather changing legacy tribes we can incorporate some new features in new tribes.

However the post was about a side discussion in this thread regarding the control of charcoal kilns.


Top Quote