Topic: main roads becoming normal again
Tibor |
Posted at: 2018-05-15, 07:26
Do we talk about the same thing? Unused roads should be downgraded so that carrier2 can be sent elsewhere... this is what I mean and agree with Top Quote |
ypopezios |
Posted at: 2018-05-15, 18:51
Your changes seem safe. The LAST_DIRECTION stuff sounds like a poor choice, but I'm not sure. What I know is what I want to do, and that is to simply iterate over the 6 roads of the flag (i.e. "for each road in roads").
kMaxWallet (which in turn is based on kAnimalPrice) should be the same constant across the whole codebase, so as if we later decide to change the finetuning of the algorithm, to not have to look for it in more than one place.
The old algorithm demotes a road only after at least 150 wares pass comfortably through it. That can mean many hours of idle animal and the demotion may finally happen right when the road is about to get busy again, which is very bad timing. The new algorithm demotes a road on the first ware that passes after a long enough time (a newly promoted road needs 2.5 minutes of full idleness to risk demotion, while a fully busy road needs 12.5 minutes of full idleness). To properly handle that issue, one should wake up non-empty wallets after some time to charge them and check for demotion. This should be very easy to be done by someone familiar with the scheduling system. Top Quote |
ypopezios |
Posted at: 2018-05-15, 20:30
Concerning manual influence of the promotion, here is a half-serious idea: Instead of giving the ability to immediately promote a road (which people have strongly opposing opinions about, a fair compromise would be to) rather provide control over the sensitivity of an empire's promotion/demotion system (whether through an increase/decrease pair of buttons or a simpler two-value on/off switch). When the player sets the empire to high sensitivity, it will charge and reward all wallets in bigger amounts of coins, resulting both in faster promotions for high-traffic roads and faster demotions for low-traffic roads. That way, advanced players will have the option to accelerate the promotion of a new high-traffic road, while risking their economy having animals going back and forth their roads like in a badly tuned system (and if we go the increase/decrease option, we could gather experience to find the average optimal value for AI and novice players). This is simple to implement and could get easily enabled/disabled per scenario. Top Quote |
WorldSavior |
Posted at: 2018-05-15, 23:57
Okay...
Would you have fun at improving the Artificial Intelligence? I could imagine that algorithms could play a very important role there. This task just requires good knowledge about Widelands, or someone with good knowledge who can help. Wanted to save the world, then I got widetracked Top Quote |
einstein13 |
Posted at: 2018-05-16, 00:32
I am strongly against this solution. Because it doesn't solve the problem of immediate promotions. It makes people ability to change the mechanics, which is even more complicated. If you don't understand the basic mechanic, changing it can cause terrible problems. Please explain me, why people have doubts about micromanagement of roads? I understand that in 95% of cases it would be useless and I understand that most of the players will never use the feature (no idea how it works or no needs), but except that I don't know why. einstein13 |
GunChleoc |
Posted at: 2018-05-16, 07:04
That's what I meant too. At the moment, the algorithm to change the state is only triggered when ware is carried.
Maybe we can add some code to the carriers' "idle" task to fix this? ETA: found it
OK, I have put that in the Road struct and will push a new version once it has finished compiling. ETA: Pushed Edited: 2018-05-16, 08:51
Busy indexing nil values Top Quote |
ypopezios |
Posted at: 2018-05-16, 11:09
If there is an "idle" task, your code could work. But I have the impression that idle carriers become fully "taskless" on line 111:
I would like to replace it with something like this:
where Top Quote |
ypopezios |
Posted at: 2018-05-16, 12:13
Having read arguments for and against micromanagement in many threads of this forum, I'm afraid that there is no safe way to answer that without triggering another round of fruitless quarrel. The other time I had opened the window of choosing a new building for a position. But when I made my choice, it didn't work. I found out that meanwhile a forester had just planted a sapling right on that position. At that moment I wished for all kinds of fun buttons (undo forester's last action, unroot sapling, burn sapling, dismantle sapling, call woodcutter, promote sapling to tree, etc.) Then I reminded myself that this is a strategy game and moved on to deal with some strategic issues instead, where the real fun is. Don't spend your time telling me how much that example differs from road promotion. Just try to stick to the similarities and you may get my point.
That's a well-advised suggestion (although I would expect Tibor to make it first). Still teaching the AI to deal with the shortcomings of Widelands is less productive than freeing Widelands from those shortcomings. Therefore, the logical first step would be to improve Widelands' models, creating a more AI-friendly environment in the process.
Many of those problems are caused by the problematic economy model and need to be solved from the ground up.
and
This is indeed a huge part of a huge work for huge improvements. We have to break it into smaller parts. Introducing the wallet model was one of them. Another one is the introduction of communication between neighboring nodes (primarily flags). There are many kinds of messages that could go back and forth flags, so we need to focus on just a few of them at a time. An easy case should be swapping routes between identical wares about to cross the same road from opposite directions. I think that I'll pick this one for my next contribution (of course in a separate thread). ETA: What would be the right subforum to start such a thread in? Edited: 2018-05-16, 14:30
Top Quote |
Tibor |
Posted at: 2018-05-16, 12:51
Yes, this is also an option, f.e. roading, as ypopezios already has some experiences in this area... Top Quote |
einstein13 |
Posted at: 2018-05-16, 15:27
ypopezios, I got your point of strategy game/ micromanagement. I agree that we can say that "this is a feature, not a bug" in both directions (you about your idea of Widelands roads and me about my idea). I will not argue any more here. Maybe I will do a contribution one day for that and it will be solved from my perspective . About the other topic (routing wares & CPU usage): I will be glad to talk a bit and making some blueprints. But maybe not another forum. Rather another topic. Or several topics with one main topic. Probably wiki page can be added too. If we want to make a simple patch - simple one topic. But if you are going to rebuild whole system (like me), we will need proper way of communication. einstein13 |