Latest Posts

Topic: Ware priority buttons in construction sites

Tibor

Joined: 2009-03-23, 23:24
Posts: 1377
Ranking
One Elder of Players
Location: Slovakia
Posted at: 2015-05-11, 22:59

There is the discussion with Einstein in other thread - maybe he could provide vmware image with compiled branch - it is up to you to consider if this is viable or easier way.

The branch affects everything. All requests for wares regardless of where they comes from.


Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-05-12, 00:39

fuchur wrote:

@king_of_nowhere: You're right, usually it's better to not build too much buildings at the same time. But sometimes it's easier to create the construction sites and go doing other stuff. And other players may have a different opinion. While watching a tournament replay I saw one player build a lot of new buildings right at the beginning.

I saw several players building many buildings at the beginning. with barbarians you can do it, because they start with some 80 trunks, but with others, not so much. In fact, I noticed that none of the stronger players did that. that's because a few finished buildings will already produce something, while many unfinished builldings produce nothing. Of course, we are not counting starting a building and setting no wares to go to it. that's not a building in production from the point of view of resource use, just a building that you will want to make there one day so you already occupy the space to remember it, to avoid a tree growing on the place, and to start using the stones and other resources that are abundant.

And in my opinion life would have been easier if the military buildings would be finished first to get new free space. But it took a very long time until all buildings were finished.

I disagree with that. If I am still finishing my civilian buildings it means that I have still unused space in my land; in which case, I'd rather put that space to goood use before expanding more. Only exception is if I want to occupy some strategic position.

Even more important, if I lack building materials, I may want to build some more woodcutters or quarries. So I would want to give priority to them, not to military buildings. If we gave higher priority to millitary buildings, a casual player who doesn't know that will keep expanding and never finish the civilian buildings. Ok, that would be a valuable lesson for the future, but I think as it is now is more noob-friendly. If one does not know the gamme much, then it is better the game does not prioritize the military buildings, and if one knows the game, he can set the priorities himself.

Like king_of_nowhere says I wouldn't suggest an absolute priority, but increasing it should make a clearly noticeable difference. Maybe construction sites with high priority will have a 70 % chance of getting the ware before all construction sites with medium priority will get it. I didn't think a lot on the number, that was just a quick guess.

That can misfire. So, suppose that you do that, 70% of the times the ware is given to buildings with high priority, 20% of the times it is given to buildings with medium priorities, and 10% of the times it is given to buildings with low priority: if you out one single building to high priority that one will receive the stuff fairly quickly, good enough. But if you set many buildings to high priority, and only a few to medium, it is actually possible that buildings with medium priority will have a better chance of getting the wares: for example, 10 buildings with high priority will split the 70% chance among them, and each hs a 7% chance of getting the ware, while a single building with low priority has a 10% chance, better than any of the priority buildings. So I would not want to split the wares in fixed amounts between priorities.

At the moment, the algorithm is complex. so I can't really say how to improve it.I don't know it, but I've seen that closer buildings are prioritized. Which is good, because it reduces distant transport.

Also I've seen that buildings with many wares required tend to be prioritized (for example, a labyrinth needing 5 planks is more likely to get it than a woodcutter who only needs one), so I assume each ware request is handled individually in a way that, if a plank can go to the labyrinth or the woodcutter, it has 5 chances in 6 of going to the labyrinth and only one of going to the woodcutter. But that may be speculative on my part. If it is, it is bad, because it iis better to have few finished buildings than many unfinished, and this mechanism promotes the reverse. One more reason for making few buildings or sticking to micromanagement.

Edited: 2015-05-12, 00:41

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-05-12, 02:02

Tibor wrote:

There is the discussion with Einstein in other thread - maybe he could provide vmware image with compiled branch - it is up to you to consider if this is viable or easier way.

The branch affects everything. All requests for wares regardless of where they comes from.

Yes, I can provide some VMware images face-smile.png But for sure I need help with that too face-wink.png So I am counting on you, Tibor face-grin.png (Help with compiling/ maybe some kind of universal script for compiling?; forward the discussion to that thread: https://wl.widelands.org/forum/topic/1728/?page=1#post-13629)


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-05-12, 10:49

In order to work as one would expect, the high / medium / low chances should be independent of the number of buildings.

king_of_nowhere wrote:

Also I've seen that buildings with many wares required tend to be prioritized (for example, a labyrinth needing 5 planks is more likely to get it than a woodcutter who only needs one), so I assume each ware request is handled individually in a way that, if a plank can go to the labyrinth or the woodcutter, it has 5 chances in 6 of going to the labyrinth and only one of going to the woodcutter. But that may be speculative on my part. If it is, it is bad, because it iis better to have few finished buildings than many unfinished, and this mechanism promotes the reverse. One more reason for making few buildings or sticking to micromanagement.

I agree - the soon to be finished building should get the ware first.


Busy indexing nil values

Top Quote
fuchur

Topic Opener
Joined: 2009-10-07, 14:01
Posts: 186
Ranking
Widelands-Forum-Junkie
Location: Germany
Posted at: 2015-05-12, 18:53

king_of_nowhere wrote:

fuchur wrote:

And in my opinion life would have been easier if the military buildings would be finished first to get new free space. But it took a very long time until all buildings were finished.

I disagree with that. If I am still finishing my civilian buildings it means that I have still unused space in my land; in which case, I'd rather put that space to goood use before expanding more. Only exception is if I want to occupy some strategic position.

I think that strongly depends on the situation and the taste of the individual player which buildings should be finished first. Also I'm not playing very often against opponents, so my strategic knowlege is limited.

king_of_nowhere wrote:

Even more important, if I lack building materials, I may want to build some more woodcutters or quarries. So I would want to give priority to them, not to military buildings. If we gave higher priority to millitary buildings, a casual player who doesn't know that will keep expanding and never finish the civilian buildings. Ok, that would be a valuable lesson for the future, but I think as it is now is more noob-friendly. If one does not know the gamme much, then it is better the game does not prioritize the military buildings, and if one knows the game, he can set the priorities himself.

That was a misunderstanding, I never meant the game engine to prioritize any kind of buildings (military or other kind). You're absolutely right, that would confuse new players. Most of the times the medium setting is fine. Only for special situations micromanagement of construction site priorities is necessary. But then it should have a noticeable effect.

Tibor wrote:

The branch affects everything. All requests for wares regardless of where they comes from.

I'm not sure if that's a good idea. For production sites a 100% priority can lead to the situation that other buildings don't get needed wares anymore. Let's assume that the player sets the bread priority of some inns temporarily to high. Then maybe a trainings camp doesn't get bread any more if he lacks bread or wheat. Then he realizes that he has made a mistake. As it's not indicated the player need to search all inns to find the ones with the changed priority.

What I want to say is that absolute priorities for production sites can lead to problems which are difficult to discover for the player. I don't know how complicated it is but therefore I think construction sites and production sites should be handled different.

king_of_nowhere wrote:

Also I've seen that buildings with many wares required tend to be prioritized (for example, a labyrinth needing 5 planks is more likely to get it than a woodcutter who only needs one), so I assume each ware request is handled individually in a way that, if a plank can go to the labyrinth or the woodcutter, it has 5 chances in 6 of going to the labyrinth and only one of going to the woodcutter. But that may be speculative on my part. If it is, it is bad, because it iis better to have few finished buildings than many unfinished, and this mechanism promotes the reverse. One more reason for making few buildings or sticking to micromanagement.

I agree with you: I'd prefer some finished buildings instead of a lot of unfinished ones, too. So maybe the number of needed wares shouldn't have a great influence on the algorithm.


Top Quote
Tibor

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

fuchur wrote:

Tibor wrote:

The branch affects everything. All requests for wares regardless of where they comes from.

I'm not sure if that's a good idea. For production sites a 100% priority can lead to the situation that other buildings don't get needed wares anymore. Let's assume that the player sets the bread priority of some inns temporarily to high. Then maybe a trainings camp doesn't get bread any more if he lacks bread or wheat. Then he realizes that he has made a mistake. As it's not indicated the player need to search all inns to find the ones with the changed priority.

What I want to say is that absolute priorities for production sites can lead to problems which are difficult to discover for the player. I don't know how complicated it is but therefore I think construction sites and production sites should be handled different.

Personally, I have no well-defined opinion on this issue. At least it is a proof of concept - if somebody is interested.


Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-05-12, 21:10

fuchur wrote:

Let's assume that the player sets the bread priority of some inns temporarily to high. Then maybe a trainings camp doesn't get bread any more if he lacks bread or wheat. Then he realizes that he has made a mistake. As it's not indicated the player need to search all inns to find the ones with the changed priority.

I have a good idea for that. Micro management in macro scale. What does it mean? We have a window for all the types of buildings. If you click on the chosen type of building, you can set default values for the building type. So every building should be changed to default values.

What it look like in example?

Let's say that we have 10 Inns and we don't want to put there any fish. So click on the building type: Inn, then set the default value for fish to 0 and all Inns has 0 fish inside. But after that we have seen that the inns aren't producing at all (lack of meat). So we want to set the global amount of fish to 1 and low priority for all of the Inns. Do the same with proper window. It should be possible to do.

What about current micromanagmenet?

You can do the same as now and it should work like now: micromanagement means micromanagement. But expected behaviour is that if you change anything particullary, you can't change that globally any more.

So in our case we still had some global fish problems, but needs for snacks is more valuable, so we've decided to set high priority and full of fish in one particullar Inn. Then we've seen that it is enough for whole economy and want to close fish for the rest of inns: do that with global default values (in buildings menu window).

How can we go back with values in particular building to "default" or "global" (the same meaning here)?

It should be a "reset" button in each of building. So if you decide to go back to default values, it should be possible to do too.

In out case, during the play we have decided that finally we have enough meat to put it to Inns and we don't need micro management in that one Inn any more. So instead of looking to the Inns and compare all the values (default and set by person), we can just push the reset button in the Inn where were some changes in the past.

And going forward with the idea...

Also there should be possible to reset all the states of buildings at once. With reset button in new specific building menu.

It means that we don't need to check all the Inns any more to make global changes in all of them.

Implementation problems

I know that this idea is a bit complicated in programmistic way. Finally it will be a copy for current state and adding a flag (boolean value) to every class of building. It shouldn't be very complicated to put everything working, but not impossible. face-smile.png

Flag (value) boolean is_default = default: True

Will indicate if the buildings will ignore (default: False) global changes for all the buildings.

If you change anything in the building properties, the is_default should be set to False.

If you reset the building state (one), copy default values to the building AND set is_default = True.

If you reset ALL the building states, do as above to all of the buildings. OR if we want to minimize the CPU usage: check the building for the is_default value and decide if it is necessary.

If you change any global/default values for the buildings, chceck the flags is_default and then copy new values into the buildings.

If the building just finished building up, copy default values and run as always face-smile.png

End

This idea save tons of clicking during the gameplay. Especially for those who use micromanagement very often. For example I always have to change the standard values for marble mines, deep marble mines, sawmills, trainingscamps, colloseums, arenas (all to 0), inns (especially on big maps!), taverns... All of them are changed to the same state. And in last collectors mode I had to change all the weaponsmithies and armories too. It is very annoying to do that every time.


einstein13
calculations & maps packages: http://wuatek.no-ip.org/~rak/widelands/
backup website files: http://kartezjusz.ddns.net/upload/widelands/

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-05-12, 22:38

I like einstein's idea. I think a good place to implement it would be the buidling statistics: you already have the chance from there to see any type of building, so adding another option "change priority globally" or something like that should be intuitive in gameplay and manageable in programming


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-05-12, 22:49

This would certainly be the logical place to put it - maybe list the inputs as little buttons with ware icons on them to the left or right of each the building icon? (We have a redesign of the building stats, so it won't be a table any more).


Busy indexing nil values

Top Quote