Important Dates

Latest Posts

Topic: main roads becoming normal again

GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3159
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-04-27, 12:11

I think wares/time is a good idea face-smile.png

kaputtnik wrote:

I imagine: Those roads could maybe turn slowly into a normal road again by crumbling over time... face-grin.png

That would be really cool face-smile.png

einstein13 wrote:

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?

There isn't a list as such, but if you have a busy road with no donkey on it, it is 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)

I am talking about the suggestion where we would use busy road graphics as eye candy where roads aren't actually busy.


Busy indexing nil values

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1527
Ranking
One Elder of Players
Posted at: 2015-04-27, 12:59

If we want a maximum value, mith the system I'm suggesting I think 1000 would be good. Since it can at most decrease by 20 every cycle, it would take a bit more than 20 minutes for the fullest road to get demoted with no traffic. which should suit every possibility of roads getting used only once in a while. I mean, I can't think of a realistic scenario where a road will get heavy traffic once every twenty minutes and no traffic whatsoever the rest of the time.

II was assuming if one manually promoted a road he wanted it to stay promoted forever, but also the other option is ok. In that case putting it to 500 would be fine.

And yes, having a road crumbling would be pretty cool, so we could figure out a good excuse to use them. maybe roads that get demoted will get the "crumbling look" for ten minutes before getting the "normal road" look again. Or maybe something even more extravagant can be made, where if a road goes over 500 and then falls over 450 it will get "crumbling 1", if it falls further under 400 it will get crumbling 2, and if it falls below 350 it will get crumbling 3 while losing the donkey, and then it will get crumbling 4 and finally it will go back to normal. Depends on how mucch effort a graphic is willing to put into it.

It's a pity I don't have any programming or designing skills, or I would do some of that myself.


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

king_of_nowhere wrote:

If we want a maximum value, mith the system I'm suggesting I think 1000 would be good. Since it can at most decrease by 20 every cycle, it would take a bit more than 20 minutes for the fullest road to get demoted with no traffic. which should suit every possibility of roads getting used only once in a while. I mean, I can't think of a realistic scenario where a road will get heavy traffic once every twenty minutes and no traffic whatsoever the rest of the time.

Afer a good (short) sleep I guess that your idea of new system can be good to see with Widelands.

But to be specific coders need some more information:

  • how it works (you explained)
  • what values should be saved to have all the information
    • are we going to check the roads at once
    • OR are we going to check the roads at their times?
  • what about the savegames?
    • are we going to save anything about the roads?
    • or maybe we will generate information from currently saved state? (has to be checked)

From my state of knowing Widelands, we have to consider all the possibilities before we will propose something to implement.

II was assuming if one manually promoted a road he wanted it to stay promoted forever, but also the other option is ok. In that case putting it to 500 would be fine.

promoted forever is not the best thing I would use face-smile.png

It's a pity I don't have any programming or designing skills, or I would do some of that myself.

That is not a problem face-smile.png But designing is not so hard face-wink.png

  1. Think about the idea
  2. Then use pure math and logic to explain it
  3. Write everything and show it to us face-smile.png
  4. If everything is clear and easy from math & logic way, it will be implement soon face-wink.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: 1810
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-04-27, 18:40

einstein13 wrote:

It's a pity I don't have any programming or designing skills, or I would do some of that myself.

That is not a problem face-smile.png But designing is not so hard face-wink.png

Thats easier said than done face-smile.png

I just want to say, that i find it amazing that from a little post a great idea comes out face-smile.png


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3159
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2015-04-27, 18:59

kaputtnik wrote:

I just want to say, that i find it amazing that from a little post a great idea comes out face-smile.png

+1

We have had some really fruitful discussions on the forum this year and I really enjoy them face-smile.png


Busy indexing nil values

Top Quote
king_of_nowhere
Avatar
Joined: 2014-09-15, 18:35
Posts: 1527
Ranking
One Elder of Players
Posted at: 2015-04-27, 22:07

Ok, let's see to put everything into logic:

values needed for a road from flag A to flag B:

  • m-business (integer)
  • timer (time)
  • wares passed A to B (integer)
  • wares passed B to A (integer)
  • secondary timer AB (time)
  • secondary timer BA (time)
  • whether two wares were scheduled to pass in less than 3.6*(lenght) (yes/no)
  • wares waiting at flag (integer)

Start: the road is made.

  • m-business is 0
  • timer is started
  • wares AB is 0
  • wares BA is 0
  • secondary timers are not active
  • two consecutive wares is "no"
  • wares waiting at flag is 0

A ware is brought to flag A to be transported to flag B

  • IF two consecutive wares is "no", then start secondary timer AB.
  • Secondary timer AB will stop and reset to 0 after 3.6*(lenght)
    • IF another ware is brought to A to be transported to b while secondary timer is active, change two consecutive wares to "yes"
  • When the carrier picks up the ware, increase wares AB by 1.

More than one ware is deposited to flag A for flag B

  • There are N wares on flag A waiting to be carried to flag B, with N greater than 1?
  • IF N is greater than wares waiting at flag, then wares waiting at flag becomes N.

If a ware is brought to flag B towards flag A, do the same, except use wares BA and secondary timer BA. two consecutive wares and wares waiting at flag are instead common between the two.

Timer hits 43.2 seconds:

  • use greater between wares AB and wares BA
  • calculate wares(whatever was used)3.6(lenght)/43.2, or wares*(lenght)/12
  • IF the result is smaller or equal to 0.25, subtract 10 from m-business, ELSE
  • IF the result is smaller or equal to 0.5, don't change m-business, ELSE
  • IF the result is smaller or equal than 0.75, add 10 to m-business, ELSE
  • IF the result is smaller or equal than 0.95, add 30 to m-business, ELSE
  • IF the result is smaller or equal than 1.5, add 50 to m-business, ELSE
  • add 100 to m-business.

Furthermore,

  • IF two consecutive wares is "no", decrease m-business by 10
  • add (wares waiting at flag)*10
  • IF at any time the carrier was stuck because it was transporting a ware to a full flag, stop the timer and maybe reset it (whether it would be easier to reset it or to unstop it once the carrier becomes unstuck). If the traffic is stuck wares won't pass on the road, but you don't want to downgrade them for this.

Reset the timer and all the values except m-business.

IF m-business greater than 350, upgrade road. IF m-business lower than 350, demote road.

I believe it could be beneficial to have all roads on a separate timer, because otherwise when 43.2 seconds pass and it has to upgrade the m-business for every single road it may lag. On the other hand, having one single timer for all the roads would reduce the number of variables. Programmers decide.

Put like that, it seems more calculation that I had assumed. But then, all of programming requires more calculation than you'd assume, so it takes someone more expert than me to say if it is feasible without bothering too much the CPU.

designing is not so hard

Maybe not, but I suck at it. I am very good at logic-related skills, like sciences and strategy-based games. I am very bad at art-based skills, like drawing or designing. My drawing teacher joked on me that I could play chess but I can't even draw a square. When people ask me if I like their new car, I always answer sincerely "meh, they all look the same to me. four wheels, one engine, used to move from one place to the other". And I give the same answer, with little variation, if instead of the car it's furniture, or accessories, or clothing - only exception, female clothing; bbut then, I still have no idea if it lookss good, I just can tell if the girl looks good wearing it.

Trust me, you do NOT want me to have ANYTHING to do with designing or drawing face-smile.png

Edited: 2015-04-27, 23:17

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

king_of_nowhere wrote:

Ok, let's see to put everything into logic:

(...)

designing is not so hard

(...) Trust me, you do NOT want me to have ANYTHING to do with designing or drawing face-smile.png

You did great design!

I will think about it a bit later, but I can see that there is lack of idea what to save in savegame file. There are two ways of doing that:

A.

  • Calculate m-busyness for current state (any time, not exactly 43.2 seconds)
  • Save m-busyness to save file
  • When opening the savegame, randomly pick times between 0..43.2 and other needed values
  • After a while the lose of information will be unnoticable.

B.

  • Save everything as it is at the point of savegame
  • Read everything as it was

First is CPU-consuming, second is memory-consuming

Probably there is also C and D, but I can't think about it now (have to go sleep).


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: 1527
Ranking
One Elder of Players
Posted at: 2015-04-28, 02:25

ah, so by "designing" you meant what I did?

I assumed "designing" in the sense of drawing stuff with paint or a similar program.


Top Quote
kaputtnik
Avatar
Joined: 2013-02-18, 20:48
Posts: 1810
Ranking
One Elder of Players
Location: Germany
Posted at: 2015-04-28, 08:31

king_of_nowhere wrote:

ah, so by "designing" you meant what I did?

Yes, what your are doing is also a kind of design.

I assumed "designing" in the sense of drawing stuff with paint or a similar program.

Thats the meaning of design my statement of "easier said than done" belongs to face-smile.png

Related to your design:
Calculation is not the problem of your work. A computer is very good and fast in calculation. AFAIK the timers are more problematic.

The visuals of the roads are only a little piece to the whole "widelands feeling". If we look at the game while playing, the visual upgrading and demoting of roads is something that is not really an eye catcher, it get noticed but mostly the player has to think of other things than watch the graphics. If we want demoting of roads by crumbling over time, we should think about that: A time related demoting of a road get maybe noticed by the player, but mostly not i believe. So if we have one intermediate step for demoting a road from busy to normal, it should be ok. I also think that it is graphically a problem to have more than one itermediate step, because each image of one step must be distuinguishable.

If the decision of implemting is made, i would make an animation for the crumbling roads.

Edit: Changed IMHO to AFAIK, sorry

Edited: 2015-04-28, 18:28

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

kaputtnik wrote:

i would make an animation for the crumbling roads.

I don't like animations in games- too much CPU or GPU usage and no benefit to the gameplay, but you can create it (if you know how). face-smile.png

About clocks:

I have finally found the statement of SirVer about clocks:

SirVer wrote:

Each object in Widelands can register when it wants to "act" again, so trees can register to do something again in x milliseconds.

https://bugs.launchpad.net/widelands/+bug/1328635/comments/6

Whole context: https://bugs.launchpad.net/widelands/+bug/1328635


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

Top Quote