Latest Posts

Topic: Rework Atlantean Crystal Mine

teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2018-04-18, 20:17

WorldSavior wrote:

I'm also for reintroducing economy settings of trunks and similar wares...

Anybody strongly against? If nobody reacts to the target amount of trunk, then not having that target makes sense.

Economy settings of trunks are different to economy settings which we currently have

This is only a proposal, but yes.

Coalburners are usually inefficient...

It is quite difficult to imagine huge piles of coal accumulating, even if the burners would start working as I suggested.


Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-04-20, 11:54

WorldSavior wrote:

GunChleoc wrote:

That sounds like it might work. I'd like to hear opinions from others on this before we go ahead though.

Economy settings of trunks are different to economy settings which we currently have (Currently: If stock bigger than settings, stop producing. Trunks: If stock bigger than settings, consume trunks everywhere). We had a discussion about that before somewhere (minimal and maximal economy settings)...

There are 2 entirely different configurations at play here:

  1. Ware default target quantity. If this is not set, ware will be produced endlessly and not show up in the economy settings. We have this for all wares that don't need another ware as an input: Logs, wheat, ...
  2. The conditions under which a production site will try to run a production program. if economy needs/doesn't need/ has/doesn't have etc.

For solving this case, I think we should try to edit 2. rather than 1.. Changing 1. for logs only will introduce an inconsistency in the design, which is fragile - somebody fiddling with this stuff a few years down the road will not know that we've had this conversation.

Edited: 2018-04-20, 11:56

Busy indexing nil values

Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2018-04-20, 18:44

GunChleoc wrote:

There are 2 entirely different configurations at play here:

  1. Ware default target quantity. If this is not set, ware will be produced endlessly and not show up in the economy settings. We have this for all wares that don't need another ware as an input: Logs, wheat, ...
  2. The conditions under which a production site will try to run a production program. if economy needs/doesn't need/ has/doesn't have etc.

For solving this case, I think we should try to edit 2. rather than 1.. Changing 1. for logs only will introduce an inconsistency in the design, which is fragile - somebody fiddling with this stuff a few years down the road will not know that we've had this conversation.

Could you provide an example of the fragility? The lumberjack/woodcutter would still produce logs endlessly, if his program tells so. Nobody forces us to change the production program just because a parameter is reuntroduced. The economy setting would be around to prevent the coal burner from messing up construction.


Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-04-21, 09:05

Somebody in the future might notice that lumberjacks periodically stop working and decide that it's a problem, because logs are such an important resource that you will want to keep producing 100% of the time - you can never have too many logs, right?

That person might then notice that none of the other base wares have target quantity and remove the target quantity. Then we'll be back where we started.


Busy indexing nil values

Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2018-04-21, 10:23

GunChleoc wrote:

Somebody in the future might notice that lumberjacks periodically stop working and decide that it's a problem, because logs are such an important resource that you will want to keep producing 100% of the time - you can never have too many logs, right?

Why would the lumberjacks stop working? Nobody is suggesting that (EDIT: ,even if it would make sense in wood gnome). The coal burners could react to the target quantity of logs, woodcutters / lumberjacks can continue ignoring the setting.

That person might then notice that none of the other base wares have target quantity and remove the target quantity. Then we'll be back where we started.

Commenting code is not strictly forbidden. Anyway, if coal burners depend on that quantity, removing the target quantity would cause an error which should be easy-enough to notice.

Sorry, I did not understand the fragility.

Edited: 2018-04-21, 10:37

Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-04-21, 14:30

teppo wrote:

GunChleoc wrote:

Somebody in the future might notice that lumberjacks periodically stop working and decide that it's a problem, because logs are such an important resource that you will want to keep producing 100% of the time - you can never have too many logs, right?

Why would the lumberjacks stop working? Nobody is suggesting that (EDIT: ,even if it would make sense in wood gnome). The coal burners could react to the target quantity of logs, woodcutters / lumberjacks can continue ignoring the setting.

Well, if all input queues are full, all construction sites have their logs and the inventory matches the economy target, the lumberjack will stop working. The program will need to have an "unless the economy needs" statement, because the economy target quantity will become useless otherwise.

So, I'd prefer a solution via the production programs. If this can't be done or becomes too complicated, we can of course go the target quantity route and comment it.


Busy indexing nil values

Top Quote
teppo

Joined: 2012-01-30, 09:42
Posts: 423
Ranking
Tribe Member
Posted at: 2018-04-21, 15:03

GunChleoc wrote:

Why would the lumberjacks stop working?

Well, if all input queues are full, all construction sites have their logs and the inventory matches the economy target, the lumberjack will stop working. The program will need to have an "unless the economy needs" statement, because the economy target quantity will become useless otherwise.

I still do not understand. The target quantity is not useless, if the burners' program refers to it, even if the lumberjacks' program doesnt.

So, I'd prefer a solution via the production programs. If this can't be done or becomes too complicated, we can of course go the target quantity route and comment it.

Of course, the target is to change the production program. However, one cannot write "skip if economy needs trunk" into coal burner's program, if there is no target amount of trunk in the economy.


Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-04-21, 15:40

I meant that we'll need "skip if economy needs trunk" in the lumberjacks, because they will ignore the target amount otherwise. It's confusing to players if they set a target amount and the lumberjacks ignore that. So no, it won't be useless, but it will be confusing if the lumberjacks won't obey it.

teppo wrote:

So, I'd prefer a solution via the production programs. If this can't be done or becomes too complicated, we can of course go the target quantity route and comment it.

Of course, the target is to change the production program. However, one cannot write "skip if economy needs trunk" into coal burner's program, if there is no target amount of trunk in the economy.

Agreed. This is definitely a problem that's not easy to solve.


Busy indexing nil values

Top Quote
GunChleoc
Avatar
Topic Opener
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-04-21, 16:28

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

Edited: 2018-04-21, 16:41

Busy indexing nil values

Top Quote
WorldSavior
Avatar
Joined: 2016-10-15, 04:10
Posts: 2091
OS: Linux
Version: Recent tournament version
Ranking
One Elder of Players
Location: Germany
Posted at: 2018-04-24, 15:17

teppo wrote:

WorldSavior wrote:

I'm also for reintroducing economy settings of trunks and similar wares...

Anybody strongly against? If nobody reacts to the target amount of trunk, then not having that target makes sense.

I'm just unsure if it would be good if this economy setting would be at the same place as other economy settings, because it works different.

GunChleoc wrote:

WorldSavior wrote:

GunChleoc wrote:

That sounds like it might work. I'd like to hear opinions from others on this before we go ahead though.

Economy settings of trunks are different to economy settings which we currently have (Currently: If stock bigger than settings, stop producing. Trunks: If stock bigger than settings, consume trunks everywhere). We had a discussion about that before somewhere (minimal and maximal economy settings)...

There are 2 entirely different configurations at play here:

  1. Ware default target quantity. If this is not set, ware will be produced endlessly and not show up in the economy settings. We have this for all wares that don't need another ware as an input: Logs, wheat, ...
  2. The conditions under which a production site will try to run a production program. if economy needs/doesn't need/ has/doesn't have etc.

For solving this case, I think we should try to edit 2. rather than 1.. Changing 1. for logs only will introduce an inconsistency in the design, which is fragile - somebody fiddling with this stuff a few years down the road will not know that we've had this conversation.

Yes, the inconsistency would be weird

GunChleoc wrote:

Somebody in the future might notice that lumberjacks periodically stop working and decide that it's a problem, because logs are such an important resource that you will want to keep producing 100% of the time - you can never have too many logs, right?

In most situations you can not have too many logs, but I remember that I once had a very big traffic jam problem which was probably caused by logs. In that situation I wished to have normal economy settings for them.

But this doesn't mean that it makes sense to introduce economy settings of basic wares as long you cannot set them to infinity.


Wanted to save the world, then I got widetracked

Top Quote