Latest Posts

Topic: main roads becoming normal again

GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-05-25, 18:42

Glad to hear that you can compile yourself now face-smile.png

I agree that having your branch for Build 20 is viable once we have fixed the linker error. I have run out of time though, so I won't be able to work on this before August. My virtual machine that I'll take with me is too slow for debug builds.

We also still have a bunch of commented out code in it that should be deleted if you don't need it anymore to work on the algorithm.


Busy indexing nil values

Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-26, 00:11

@GunChleoc

Feel free to delete the commented-out lines. They are not part of the algorithm and they probably don't even serve as placeholders.

The linker error will disappear if you split again the constants, like Tibor had them.


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-05-26, 08:41

I can squeeze this in today, so I'm on it.

It's really weird, because it does fine the kAnimalPrice a few lines above. I have included road.h in test_routing.cc to see if that makes any difference. I'm not familiar with how boost test cases work, so fingers crossed.

Another question: how much of the log output do we still need?

Edited: 2018-05-26, 08:41

Busy indexing nil values

Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-26, 09:46

GunChleoc wrote:

Another question: how much of the log output do we still need?

We need none of it. The wallet value provided in the debug window (i.e. log_general_info) should be enough. We could consider adding more info there, but it's optional.


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

I found the bug - the branch is ready for final review face-smile.png

Edited: 2018-05-26, 13:22

Busy indexing nil values

Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-26, 14:43

As far as I'm concerned, all is well except of file tribes/carrier.cc :

  • Comment on line 407 should be deleted too, as the code it referred to got deleted.

  • I insist that lines 447-449 don't work (can get deleted). Demotion of fully idle roads never happens, while demotion of temporarily idle roads takes place at the charge on road-payment. Moreover, the class Carrier should have nothing to do with demotion, but that will get fixed when someone makes a serious rewrite of the involved classes (Flag, Road, Carrier, WareInstance), to properly separate their concerns.


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

Done.


Busy indexing nil values

Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-26, 18:24

Well done! Seems that we can communicate after all...


Top Quote
GunChleoc
Avatar
Joined: 2013-10-07, 15:56
Posts: 3324
Ranking
One Elder of Players
Location: RenderedRect
Posted at: 2018-05-26, 18:30

Yes, much better now face-grin.png


Busy indexing nil values

Top Quote
ypopezios
Avatar
Joined: 2018-04-20, 00:22
Posts: 220
Ranking
Widelands-Forum-Junkie
Posted at: 2018-05-29, 22:06

@GunChleoc

Concerning demotion of fully idle roads, a quick fix would be to replace line 108 of file tribes/carrier.cc with this:

// subtract maintenance cost and check for road demotion
road.charge_wallet(game);
// if road still promoted then schedule demotion, otherwise go fully idle waiting until signal
return road.get_roadtype() == RoadType::kBusy ? schedule_act(game, (road.wallet() + 2) * 500) : skip_act();

Top Quote