Latest Posts

Topic: main roads becoming normal again

einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-04-26, 12:25

kaputtnik wrote:

For me there is another thing which i am not satisfied of:

Currently the code to change the roadtype acts only on sections of roads. As a result we have roads where one section is busy and the other one is till normal. As mentioned above from a logical way it is absolute ok, but not from an optical view. While playing i saw often straight roads (without crossings) where one section is busy, the next section is normal and the following section is busy again. So i would suggest to make a road busy from crossing to crossing, if one of the section between the crossings gets busy. Turning back to a normal road should then also act between crossings: if no section between crossings needs to be a busy road, turn all sections to normal roads.

It is easy to spot: build huge empire and one bypass around it. The bypass will be very busy in a short time, but it takes ages to make it busy.

In Settlers II the busy mechanism was only one-way (only from normal to busy road). It was simple mechanism: ask how many people was walking through the road. Finally all the roads (used roads) came to be busy. Even from one farm or well. But the road become busy very fast (the limit was about 100-200). It is not the best mechanism, but it is far better than current for bypasses: if 200 wares came through the bypass (whole line), it becomes busy. So whole line is busy at once.

This mechanism is not the best for casual roads. You don't have to make busy a road between only one or two farms to the rest of empire.

But there is an alternative for that!

Let say that Shift or Alt (here I will use Shift) is "magic" key for roads. If you hold Shift and click on the road, the road becomes busy imidiatelly (the m_busyness can be set to some big number like 500 or something else). Then we will bring to Widelands more micromanagement and all the roads we want to be high priority will be busy face-smile.png

With this solution we don't have to change the implementation of busyness face-smile.png


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

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-04-26, 15:53

Let say that Shift or Alt (here I will use Shift) is "magic" key for roads. If you hold Shift and click on the road, the road becomes busy imidiatelly (the m_busyness can be set to some big number like 500 or something else). Then we will bring to Widelands more micromanagement and all the roads we want to be high priority will be busy face-smile.png

This would affect the logic of "which is the cheapest route for a ware to get from point A to point B". I don't know if a route get a higher priority just because it consist of busy roads. I assume that a busy road (those with an additional carrier) don't get a higher priority by the logic.

I also don't know if we want to bring more possibilities to the player. A (new) player have to learn a lot to play widelands. I think the transportation system should only be handled by the internal logic.


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

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

I don't think it would be a good idea to separate the visuals and the logic of the busy roads. While it may look good, it will make things confusing for players. At the moment, you can see how many roads are waiting for a carrier2. With this change, you wouldn't be able to tell anymore.

I think the idea of making roads busy/normal from crossing to crossing has merit - if we count buildings attached to the road as crossings as well. It makes both visual and semantic sense.


Busy indexing nil values

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-04-26, 19:35

I don't think it would be a good idea to separate the visuals and the logic of the busy roads. While it may look good, it will make things confusing for players. At the moment, you can see how many roads are waiting for a carrier2. With this change, you wouldn't be able to tell anymore.

Yes, thats half the truth. Half, because there is also a carrier on the road. If he stoud still, there is no visual need for a second carrier.

It's just related to the to, who wants that a busy road forever is a busy road (as i understoud). My suggestion would only release the second carrier, but the road looks still optical busy. I imagine: Those roads could maybe turn slowly into a normal road again by crumbling over time... face-grin.png

I think the idea of making roads busy/normal from crossing to crossing has merit - if we count buildings attached to the road as crossings as well. It makes both visual and semantic sense.

Yes, i meant each crossing. And the code who calculates the sections from crossing to crossing is allways there: While gameplay you could mark a flag, press CTRL (i believe) and click on the next flag where you want the road adjoin, the road is automatically calculated and splitted into sections. Removing a road with lots of sections is similiar: Mark a flag somewhere on the road, press CTRL and "remove road" will remove all the sections between two crossings. So this code could imho be reused for "making each section between two crossings visual into a busy road".


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-04-26, 19:49

kaputtnik wrote:

Let say that Shift or Alt (here I will use Shift) is "magic" key for roads. If you hold Shift and click on the road, the road becomes busy imidiatelly (the m_busyness can be set to some big number like 500 or something else). Then we will bring to Widelands more micromanagement and all the roads we want to be high priority will be busy face-smile.png

This would affect the logic of "which is the cheapest route for a ware to get from point A to point B". I don't know if a route get a higher priority just because it consist of busy roads. I assume that a busy road (those with an additional carrier) don't get a higher priority by the logic.

What logic you are talking about? I didn't told anything about finding route for wares. I only told about roads YOU and ONLY YOU think that are prior. What YOU think is something else than WIDELANDS think.

My idea contains only affection to the busy/ normal roads. Nothing else. The rest is for Widelands engine face-smile.png

Also it will not affect the spearation of logic and visuals of busy roads (@GunChleoc). Everything stays as before. It brings only more micro management.

I also don't know if we want to bring more possibilities to the player.

Why not? I can play lots of games where everything is simple and the player don't have to learn anything. I don't want to play that games. I want to play a game, where I can learn something about it all the time. Also it is important to have the basic play easy. This idea nothing changes with that. The basic play will stay as it is now.

A (new) player have to learn a lot to play widelands.

Yes and I think that it is great!

I think the transportation system should only be handled by the internal logic.

I think that we can use both: internal and player logic. Then you can affect it as you can affect the basic production with whole system: with stopping/ starting building producion and setting wares number inside. With the idea you can leave everything as it is now, but you can affect everything with roads as you want.

GunChleoc wrote:

At the moment, you can see how many roads are waiting for a carrier2.

How can I see how many roads are waiting for a donkey?

With this change, you wouldn't be able to tell anymore.

With which change? (I don't understand all things, sorry)


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

Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 2433
OS: Archlinux
Version: current master
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-04-26, 21:12

einstein13, maybe i misread your suggestion. What benefit would it bring? What do you mean with micro management?


Fight simulator for Widelands:
https://wide-fighter.netlify.app/

Top Quote
king_of_nowhere
Avatar
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-04-26, 23:08

I'm not sure I would like the idea of being able to manually upgrade a road because it would feel a bit llike cheating. I mean, even if you have a busy road you have to wait a while until it gets upgraded, being able to do it instantly will provide an advantage. But then, that's not necessarily a bad thing. Just that I would need to pshycologically adapt to the idea.

Regarding the idea that a road should be considered crossing to crossing, that has goood potential, but it can be problematic to implement. what happens if then you make more roads? What if there were more crossings but then you split them down? It needs to be considered carefully

A last thing: if you have a long road with a steady flow and only marginal traffic from the crossings (or traffic going in the opposite direction) it will take forever for it to upgrade: the wares will accumulate at the first flag, the carrier willl bring them one at a time, the road will get promoted, but in the meanwhile all the further segments of the road are only experienceing moderate traffic, and in particular all wares are removed as soon as they arrive at a flag - because the first bottleneck carrier will set the pace. then the first carrier will eventually get a donkey, and so all the wares will be shifted at the second flag, because now there are a carrier and a donkey bringing to it and only a carrier removing wares. so in time the second stretch will become busy. And then the third strethc has to start the process. and it takes quite a long time to arrive to the end of the road. in the meanwhile, the start of the road has probably been demoted, because all the wares are removed efficiently - the bottleneck further down smothers the economy in the region, and prevents the road from growing too busy. Although in practice it is a rare situation, I've seen it happen in my "archipelago sea" map, because the conformation of the map often prevents you from making alternative routes.

In settlers 2 that problem did not exist, because only the amount of wares passing on a road was counted, and that guaranteed that all the pueces of a highway would become upgraded at the same time.

So, while that system was far too simplicistic, maybe counting the wares actually moving on a road is a good way to go. A couple of ideas to do that:

  • set a count of wares passing on a road. every two minutes, a decision is taken accoding to the amount of wares that had passed through the road. make it two separated counts, one in each direction. the counter must also take into account the lenght of the road. so, for example, if you have a road 3 steps long, and a carrier needs 2 seconds to cover a step, it can at most transport one ware every 6 second in each direction. so if 20 wares were transited on the road in one direction in thaat time, it means the carrier is working full time, and the m-business value should get boosted. even if the road is already upgraded, and transport is efficient, the vaue should keep being boosted, because it means the road won't be efficient anymore if it lost the upgraded status. in fact, anything more that (0.5 * maximum value) wares on one direction should increase the m-business value, if by little, and a traffic smaller than 0.25 * maximum value should decrease it.

  • every time a carrier takes up a ware,brings it to the opposite flag, and goes back to the center of the road, raise the value if another ware has arrived to the flag in that time. If by that time another ware has come to the flag, it means the road is busy. even if the donkey has taken care of that second ware, it means the donkey is needed. decrease the value for the road if an event that would raise the value of the road does not happen in one mminute, or in half a minute.


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

kaputtnik wrote:

What do you mean with micro management?

Micro management is (in my understanding) that you are able to make only one piece of something while casual work is constant (and you are making lots of things). For example in Widelands casual soldier upgrading contains 12 soldiers inside trainings camp with lots of stuff to upgrade. Micro management here is to set only one or zero soldier and fully upgrade that ONE soldier to the highest level with all the resources.

If you go to the game Port Royale (very good game, by the way), you aren't able to set anything about your building like that. You will have constant production for the whole time.

If you go to the game Dwarf Fortress, the micro managmenet there is very wide. But you can create your fortress going (and lasting for a long time) without micro management. You can create there any weapon (for example Hammer) from exact material (for example Steel). Your dwarfs will not create that hammer from copper or silver.

That is how I understand micro managment. You have empire working well without management, but you can improve it by some small changes, very deep inside.

Is it clear now? face-smile.png

What benefit would it bring?

You don't have to wait untill long bypass will change to busy road. You can set any road you think is important to busy and take advantage of that.

We don't have to implement anything strange to make it working. Only key management (or another button to road window in the game), that will set the m_busyness value to constant value at the time.

Also this idea will solve the problem "main roads becoming normal again": you can simply make them busy even if they are already busy. Strange? Imgaine that the m_busyness is 390 (is 350 the bottom limit of busy road?). You can set the m_busyness value to 500 manually and prevent of becoming normal again. Simple?

king_of_nowhere wrote:

I mean, even if you have a busy road you have to wait a while until it gets upgraded, being able to do it instantly will provide an advantage.

That is why we use micro managmenet: to have an advantage above the oponents.

(...) crossing to crossing, (...), but it can be problematic to implement.

As it was mentioned before- it can be solved by using current methods.

what happens if then you make more roads?

The same as it is now. If you have road like 4 units long (or more) and split it, when the road is busy, you will get busy roads again.

A last thing: (...) and it takes quite a long time to arrive to the end of the road. in the meanwhile, the start of the road has probably been demoted, because all the wares are removed efficiently - the bottleneck further down smothers the economy in the region, and prevents the road from growing too busy. Although in practice it is a rare situation,

I like big maps. On that maps you have to make good roads and bypasses. Those bypasses are usually long, straight ways without any crossing. To make it busy it takes up to few hours of gameplay. Even if the road is busy from the beggining of setting up. The bottleneck is moving- yes- but it doesn't change the beggining. You have long queue of wares with few flags, carriers and donkeys. Flag <-> donkey <-> flag <-> donkey ... flag <-> carrier. All of them are full of resources. That situation is VERY COMMON with big maps.

So, while that system was far too simplicistic, maybe counting the wares actually moving on a road is a good way to go.

As I mentioned before, that mechanism has major bad thing. Imagine that you are playing for few hours. Finally all the roads inside your empire become busy. Even from one well or one farm.

and a carrier needs 2 seconds to cover a step

The correct time is 1.8 seconds face-wink.png But it is only small difference face-smile.png

  • set a count of wares passing on a road. every two minutes,

We should consider something very easy. Two triggers: 25% and 50% can work fine, but I think that we should consider something simmilar, but even easier to implement. Maybe using current method? (change it only a bit, not creating brand new?)

If you want to rewrite it completely. If not- leave it face-smile.png

Edited: 2015-04-27, 00:40

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
Topic Opener
Joined: 2014-09-15, 18:35
Posts: 1668
Ranking
One Elder of Players
Posted at: 2015-04-27, 01:39

The more I think about it, the more I like the idea of going by wares by time. So, if a carrier needs 1.8 seconds to take a step, a road can carry 1 ware every 1.8(lenght)2 (because the carrier must go back and forth) seconds. We can chooose as the standard road update time 43.2 seconds, because it's 3.6*12 and so it ensures that the amount of wares that can pass on that road is a round number for road lenghts of 2, 3, and 4 steps (namely 6, 4 and 3 wares exactly). So we can count the number of wares passing through the road in each direction (keep separate count for the two direction, use the greater of the two) and confronting it with the theoretical maximum:

  • If it is lower than 25%, then decrease the road value by 10. A single carrrier can handle that and be idel most of the time. (for a 2-steps road, 0 or 1 wares)
  • If it is between 25% and 50%, leave the value unchanged. A single ccarrier can handle that, but there may be peaks in traffic to justify a dokey. (2 or 3 wares)
  • If it is between 50% and 75%, raise value by 10. A single carrier can handle that, but peaks in traffic willl jam the road from time to time. (4 wares)
  • If it is between 75% and 95%, raise value by 30. A single carrier can barely handle it, and a slight increase in traffic can jam the road. (5 wares)
  • If it is over 95%, raise value by 50. A single carrier definitely cannot handle that. (6 wares or more)
  • if it is over 150%, raise value by 100. this road is strained even with a donkey, and even if this is just a temporary event, it is better to keep the road upgraded in case the event happens again. (9 or more wares)

Furthermore

  • if wares accumulated at the flag, add 10(maximum number of wares waiting at the flag). they are limited to 8, so the road would get 50 + 8*10 =130 points in those 43 seconds.
  • if in the 43.2 seconds it never happened that two wares arrived at the flag within 3.6*(lenght), lower value by 10.

With those settings

  • a new road that has the carrier going up and down all the time, and also have accumulation of wares at the flag, will get a donkey in three iteractions, little more than two minutes.
  • in a long road where ware accumulation is limited at the first flag, all carriers are still busy all the time and so they will reach the 350 value after 7 iterations, in 5 minutes (302.4 seconds to be exact). If along the way there are 3-steps segments, those will get a donkey in 5 minutes and the shorter segments wil take a few minutes more. but either case, in less than 10 minutes any lenght of road will be upgraded if the traffic in it is consistent.
  • a road where a single carrier can handle the traffic never gets upgraded. notice that if the carrier is busy 75% of the time, but the wares arrive separated so that each of them is always carried immediately, the value will remain unchanged.
  • a road with no traffic will decay of 20 every cycle. A road with a donkey and full of wares waiting at the flag will gain 180 at every cycle. That will ensure that even a road out of a port where a ship lands rarely rarely will remain upgraded.
  • road degradation is consistently linked to lack of traffic on it.

If you also want to implement the option of manually upgrading a road as part of micromanaging

  • the manually upgraded road will have its value constantly calculated, but will be upgraded regardless of it. It will also have a slightly different drawings. When the human removes the manual upgrade, the program will look at the value again.
  • or, there could be a different animation for a road that is upgraded by a human, but does not have a high m-value. like, an old decrepit road with stones cracked and roots growing on, to make it look like it was a great road in the past but now it fell into disuse and disrepair. Either way, the purpose it to let a human see if a road is remaining upgraded only because of his decision.

It seems like it covers all the possibilities that have been suggested and doesn't use the CPU too much, requiring only to keep two counts and doing some basic divisions and additions every 43 seconds.

P.S.

I like big maps. On that maps you have to make good roads and bypasses. Those bypasses are usually long, straight ways without any crossing.

My bypasses still have plenty of crossings to connect them to the rest of the economy, and often they are two parallel roads connected to each other at every flag so that wares can easily be shifted from one road to the other if one is jammed. so, the program would still not recgnize them as a single road.

EDIT: I try to write the multipliction symbol, and it accepts it when it has a number afterwards, but if I write a letter after it it just italicize part of the text. Oh, well, I suppose it's still readable.

Edited: 2015-04-27, 01:52

Top Quote
einstein13
Avatar
Joined: 2013-07-29, 00:01
Posts: 1118
Ranking
One Elder of Players
Location: Poland
Posted at: 2015-04-27, 03:28

Your idea is quite good face-smile.png But should there be a top and bottom limit of counts? (bottom like 0 and top like 1000? or more?)

king_of_nowhere wrote:

If you also want to implement the option of manually upgrading a road as part of micromanaging

  • the manually upgraded road will have its value constantly calculated, but will be upgraded regardless of it.(...)
  • or, there could be a different animation for a road that is upgraded by a human, but does not have a high m-value. (...)

Hmm... I never considered that the manually changed road can be in other logic than casual road. My idea was only to add to m-value a constant that will provide the road busy state. After some time the road will have the correct m-value as it should be without human ingerence. So:

  • player build a road (m-value = 0, normal road)
  • the road is working (m-value = 50, normal road)
  • player thinks that the road should be busy and change it (m-value = 650, busy road)
  • but the decision was bad and the road was deserted, so after some time it become normal (m-value = 350, normal road)
  • finally the player made huge empire and the road become busy (m-value = 1000, busy road)

In this situation the road was busy twice: first because of player micro management decision, and second because of normal behaviour (logic) of normal/busy roads.

My bypasses still have plenty of crossings to connect them to the rest of the economy,

My bypasses are bypassing some parts of economies. For example I bypass complicated road system of wood producion. The road is a bit longer, but straight. It can be about 30 segments long. Another example is not exactly used road: around the empire. Which is used by ores. Two ways: one through the empire, second around the empire. Second one is loooonger, but when I produce about 200 coal and iron at once, nobody cares about the distance. face-smile.png

and often they are two parallel roads connected to each other at every flag so that wares can easily be shifted from one road to the other if one is jammed.

I know that you are smar person. Consider not connecting all the flags. I use two ways parallel too, but I found about a year ago, that connecting all the flags are useless. Connecting flags nearby junctions- ok. But in other places it is definatelly useless. If all the roads are busy, there is NO traffic jams, because there is no fluctuations on the roads. If you have some 3-units segments, ok- you will definatelly have some traffic jams face-wink.png and then you need connections.

so, the program would still not recgnize them as a single road.

Yes, it is almost impossible to recognize a single road created from 2 parallel roads. I can't imagine any good mechanism/ algorithm for that.


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

Top Quote