IRC logs for #openttd on OFTC at 2016-10-06
⏴ go to previous day
00:00:54 <_dp_> Every year on April 1 devs randomly select one patch, apply it and release new version
00:04:16 <FLHerne> And every year on April 2nd, I ritually grumble about the ever-growing list of trivial, well-tested, beneficial patches that weren't applied
00:10:57 <Samu> is that true? only 1 patch? :(
00:18:11 <Samu> what about bug patches :( i posted some of those, but it's been months and nothing happened t.t
00:18:14 <_dp_> well, on leap years it's two...
00:24:57 <Samu> well i got some stuff dealt with, :o
00:26:01 <Samu> someone fixed a canal crash very recently
00:26:10 <Samu> but there's more stuff out there :(
00:31:47 <Samu> remko bijker fixed most of my reports
00:32:18 <supermop> Milek7_: it seems the labels for inner city and intercity transit are reversed
00:33:44 <Samu> Alberth (Alberth) - fs#3816
00:33:58 <Samu> Alberth (Alberth) - fs#3798
00:34:16 <Samu> Remko Bijker (Rubidium) - fs#3798
00:34:46 <Samu> Remko Bijker (Rubidium) - fs#3819
00:36:09 <Samu> Remko Bijker (Rubidium) - fs#4109 not fixed
00:36:44 <Samu> Remko Bijker (Rubidium) - fs#4222
00:37:16 <Samu> Remko Bijker (Rubidium) - fs#4223
00:38:17 <Samu> frosch (frosch) - fs#4224 I'm surprised this one got implemented
00:42:35 <Samu> Jean-Francois Claeys (Belugas) - fs#4231 the first time I tried to help at fixing something, i think i remember this episode
00:43:59 <Samu> Remko Bijker (Rubidium) - fs#4247 duplicate, but fixed
00:45:11 <Samu> Loïc GUILLOUX (glx) - fs#4251
00:45:45 *** THERetroGamerNY has quit IRC
00:46:21 <Samu> frosch (frosch) - fs#5523
00:47:14 <Samu> Remko Bijker (Rubidium) - fs#5524
00:50:15 <Samu> Remko Bijker (Rubidium) - fs#5531 not fixed
00:52:10 <Samu> Remko Bijker (Rubidium) - fs#5539 heh turns out it was adobe flash, not openttd, nor external library
00:53:58 <Samu> frosch (frosch) - fs#5541
00:55:21 <Samu> frosch (frosch) - fs#5566 duplicate, but fixed
00:58:56 *** Extrems` has joined #openttd
00:59:36 <Samu> Remko Bijker (Rubidium) - fs#5568 I remember this one, crashing without generating the crash files, nice job getting it fixed.
01:00:35 *** Extrems` is now known as Extrems
01:13:50 <Samu> Remko Bijker (Rubidium) - fs#5571 fixed, then reverted, then re-fixed again :)
01:14:54 <Samu> frosch (frosch) - fs#5594 not a bug, t.t
01:18:20 <Samu> Remko Bijker (Rubidium) - fs#6000 duplicate, but fixed
01:19:53 <Samu> Remko Bijker (Rubidium) - fs#6001
01:21:18 <Samu> frosch (frosch) - fs#6002 unreproduceable, but fixed
01:22:53 <Samu> Remko Bijker (Rubidium) - fs#6003
01:23:58 <Samu> Remko Bijker (Rubidium) - fs#6013
01:24:46 <Samu> Remko Bijker (Rubidium) - fs#6015
01:27:26 <Samu> frosch (frosch) - fs#6209 bug in AMD GE, i no longer use it. At least AMD recognized it and no longer ships it with their drivers.
01:29:52 <Samu> frosch (frosch) - fs#6215 false report, heh... sorry about that
01:33:20 <Samu> frosch (frosch) - fs#6254
01:35:42 <Samu> frosch (frosch) - fs#6264
01:36:31 <Samu> Alberth (Alberth) - fs#6268
01:38:22 <Samu> Alberth (Alberth) - fs#6271 - not fixed
01:38:59 <Samu> frosch (frosch) - fs#6461
01:39:34 <Samu> frosch (frosch) - fs#6511
01:50:20 <Samu> fixed-not_fixed ratio: Alberth 2-1 / Rubidium 13-3 / frosch 8-4 / Belugas 1-0 / glx 1-0
01:50:40 <Samu> Rubidium wins as the most fixer of my reports :p lol
02:44:34 *** ChanServ sets mode: +v tokai
03:23:57 *** LadyHawk- has joined #openttd
03:29:10 *** LadyHawk- is now known as LadyHawk
05:09:53 *** txtsd_ is now known as txtsd
05:57:58 *** Supercheese has joined #openttd
07:34:47 *** andythenorth has joined #openttd
07:35:55 *** andythenorth has left #openttd
09:41:16 *** FLHerne has joined #openttd
11:57:58 <argoneus> good morning train friends
13:01:20 *** zeknurn` has joined #openttd
13:05:22 *** zeknurn` is now known as zeknurn
13:16:07 *** Snail_ is now known as Snail
14:12:58 *** zeknurn has joined #openttd
15:10:30 *** Extrems has joined #openttd
15:19:08 <Samu> who's a date expert? I need to create a "IsLastDayOfTheMonth" bool
15:24:58 <Milek7_> Samu: look at IncreaseDate
15:26:37 <Samu> bool new_month = ymd.month != _cur_month;
15:27:50 <Samu> that's like the last tick of the month
15:28:17 <Samu> it should suffice, I guess, must try it
15:29:29 <Milek7_> no that's first day of next month
15:30:58 <Milek7_> _month_date_from_year_day[_date + 1] != _cur_month
15:32:24 <Milek7_> _month_date_from_year_day[_date + 1] >> 5 != _cur_month
15:33:53 <Samu> actually, forget about it, I'm gonna try a different approach
15:34:15 <Samu> /* Check for bankruptcy each month */
15:34:30 <Samu> i want to do this check BEFORE computing the new statistics for the company
15:35:19 <Samu> static void CompaniesGenStatistics() line 655
15:35:37 <Samu> bankrupt check is done after the computations, i'm trying to switch
15:36:26 <Samu> my goal here is to avoid AI companies from bankrupting because they work too close to the money limit
15:37:05 <Samu> if the computations are done after the bankrupt check, I am saving many false bankrupts
15:37:11 <Milek7_> how this will change that?
15:38:03 <Samu> on the last day of the previous month, the company is healthy
15:38:25 <Samu> but then those subtracts from maintenance costs and so
15:38:50 <Samu> makes the new first day of the company enter into negative at times, especially for those AIs that are always working next to their money limit
15:39:09 <Samu> it triggers a bankrupt warning
15:39:24 <Samu> by accumulation, they can bankrupt, even if they have giant profits
15:39:49 <Samu> it's the case of EpicTrans
15:41:18 <Samu> There are other AIs too with this issue, forgot who they are
15:41:40 <Milek7_> but it anyway bankrupts at 6-9 consecutive months with negative profits
15:42:17 <Milek7_> but if you want you can just move
15:42:28 <Milek7_> FOR_ALL_COMPANIES(c) { CompanyCheckBankrupt(c); }
15:42:42 <Milek7_> before: if (!_settings_game.economy.infrastructure_maintenance) {
15:46:24 <Samu> there was some road vehicle ai that bankrupted with over 2600 vehicles and profits of £1000k
15:46:38 <Samu> forgot who it was, but it wasn't epictrans
15:50:08 <Samu> i still dont understand how this works
15:50:22 <Samu> Backup<CompanyByte> cur_company(_current_company, FILE_LINE);
15:52:22 <Samu> there's that envolving the infrastructure maintenance
15:52:38 <Samu> but bankrupt checking isn't being included
15:52:51 <Samu> i'm not sure how to move the coude before it
15:53:56 <Milek7_> doesn't matter if you move bankrupt check before or after backup
15:54:31 <Milek7_> but if you want before, you'll also need to move Company *c; definition before it
15:54:49 *** ialokin has joined #openttd
15:56:38 <Samu> gonna find some bankrupt saves
16:03:56 <Samu> debug is so darn slow :(
16:10:52 <Samu> arf, i dont have a good savegame to test this
16:18:54 <Samu> running openttd debug with an AI running is utterly slow
16:19:22 <Milek7_> why not compile release?
16:19:48 <Samu> i am using breakpoints, see if it's doing everything correctly
16:26:53 *** Alberth has joined #openttd
16:26:53 *** ChanServ sets mode: +o Alberth
16:33:36 <Samu> think i'm posting the patch
16:53:23 <Samu> i need your feedback on that patch, since u own competitive servers
16:54:35 <Alberth> what does the code at line 24 do?
16:54:42 <ST2> we don't run AI's on our servers anyway
16:55:19 <Samu> yeah, well but the change is company based, doesnt' care if it's ai or not
16:55:56 <Samu> line 24? that's a svn patch line
16:56:45 <Samu> perhaps my comment is misleading
16:56:54 <Samu> shouldn't have mentioned AI in it
16:57:09 <Alberth> I know it's the svn patch line, but what does the code there do?
16:57:30 <Alberth> it looks like infra structure calculations, maybe payments?
16:58:14 <Samu> yes, it's infrastructure maintenance costs being subtracted
16:58:46 <Alberth> why do you remove the bankrupt check after subtracting those payments
16:59:38 <Samu> checks for bankruptcy first before subtracting infrastructure costs
17:00:21 <Alberth> since payments could drive you into bankruptcy
17:00:39 <Alberth> and with your patch you don't check that any more
17:01:57 <Samu> i don't get what you say :(
17:02:06 <Alberth> suppose at line 21 you have 1 dollar left
17:02:22 <Alberth> so your moved check says "all is well"
17:02:43 <Alberth> then we do infra structure checks, they cost say 100 dollar
17:03:04 <Alberth> so at line 27, balance of the company is -99, right?
17:03:32 <Alberth> in the old situation, line 30 declares bankruptcy then
17:03:47 <Alberth> in your patched situation, that check isn't there
17:04:56 <Samu> it will check bankruptcy at the start of the next month
17:05:15 <Milek7_> he wants to prevent bankruptcy of ai who spend always all available money
17:05:19 <Samu> if it's still negative, it adds a month of bankruptcy
17:06:35 <Samu> but the problem might be that humans will take advantage of it as well, hmm i see
17:06:47 <Milek7_> imo this is ai fault that it don't reserve money for maintenance
17:07:41 <Alberth> you have 3 months or so to sort out your balance, afaik
17:08:44 <Alberth> so one month postponing after it already had 3 months?
17:09:34 <Milek7_> if ai always drain available money for building eg. railway it will bankrupt even if it makes much profit
17:10:12 <Samu> it's unfair for ais to bankrupt because they're a few miliseconds into negative
17:10:22 <Alberth> it will always bankrupt even if you give it 5 years
17:10:23 <Samu> and then for the rest of the month they're positive
17:12:35 <Samu> how would u deal with this :(
17:12:59 <Alberth> that would seem like the proper action indeed
17:13:26 <Alberth> it is known how openttd computes finances, it can handle accordingly
17:15:07 <Samu> He has a £1,100k profit and 2600 road vehicles when this happens.
17:19:28 <Alberth> I always drive below the speed limit, except this once
17:20:22 <Alberth> if it's making that much money, it's being stupid of getting near the limit that close
17:20:50 <Alberth> it should just do nothing for a month, and use 1,000k pound as limit
17:20:52 *** theholyduck has joined #openttd
17:21:08 <Samu> it's not the only ai doing it
17:21:36 <Samu> there's some others, i forgot now who they are
17:22:00 <Samu> epictrans was at 4900 road vehicles, then bankrupted
17:22:13 <Samu> i look at it and it makes no sense
17:23:47 *** frosch123 has joined #openttd
17:24:00 <Alberth> welcome to the world of computers where sense has no meaning
17:25:38 *** innocenat has joined #openttd
17:31:50 <Samu> hmm so that means my patch sucks
17:32:49 <Alberth> there is a boundary somewhere
17:33:22 <Alberth> you can move the boundary, but that means additional space for the AIs, so some authors will take advantage of it
17:33:31 <Alberth> and you're back to square one
17:33:59 <frosch123> maybe meaning has a sense then
17:37:01 <Samu> the situation gets worse the higher the infrastructure amount of a company :(
17:37:10 <Samu> oh well, so it's the ai's author to deal with it?
17:38:15 <Milek7_> you can also fix it ;p
17:39:12 <Samu> I did this swap, but apparently it's a bad idea
17:41:16 <Alberth> it's just not the right solution. I doubt the solution should be in OpenTTD, for the above reason.
17:41:47 <Alberth> we've had the same rule for a decade or so, it should be known by now :)
17:43:56 <Alberth> note that a few years back, the bankruptcy got fixed from "your balance is negative" to "you balance is negative after taking out the max loan", that's a big leap in making it less likely to bankrupt
17:44:29 <Alberth> but if you insist on living on the edge, occasionally you fall :)
17:46:39 <Alberth> own code, or did you some a library for handling money?
17:46:55 <LordAro> Samu: what's up with my ai?
17:47:06 <LordAro> last i checked it was dumb, but stable
17:47:15 <Samu> it bankrupts because money
17:47:57 <LordAro> doesn't look like it's bankrupting to me
17:48:10 <LordAro> it'll pay off the loan at some point
17:48:20 <LordAro> i don't recall what the threshold is
17:48:38 <Alberth> apparently it's dipping below 0 just when the bankruptcy calculation is
17:49:45 <Alberth> it lives a bit too close to the edge :p
17:50:57 <Samu> just without the screenshot
17:52:57 <LordAro> i'm not sure i've touched the code in 5 years
17:53:02 <Alberth> expanding yourself into bankruptcy :p
17:53:04 <LordAro> gawd, has it been that long?
17:55:13 <Alberth> freerct started in 2011
18:12:41 * LordAro mumbles something about a function that takes no parameters and returns nothing
18:19:05 <Milek7_> egrep "void .+\(\)" -r . | wc -l
18:19:48 <LordAro> ottd was made to work with c++, not use it well :>
18:19:53 <Eddi|zuHause> what's wrong with that? plenty of ways to have side effects
18:20:42 <LordAro> it's considered a "code smell" as it's decidedly inclear from the function call what the function does and what it modifies
18:21:09 <Samu> SynTrans also suffers from working too close to max loan
18:21:25 <Eddi|zuHause> i don't agree with that logic. it may apply to some specific cases, but not in general
18:23:02 <Milek7_> and requires stuff like Backup<CompanyByte>
18:25:04 <Eddi|zuHause> well, that's a workaround resulting from using global variables (instead of other context-wrapping systems like object-orientation)
18:26:48 <LordAro> most consider such systems to be better than global variables :)
18:29:56 <Samu> back, so it's just 3 AIs with this problem with inflation turned off
18:30:19 <Samu> AroAI, SynTrans and EpicTrans
18:30:31 <Samu> i have yet to test inflation turned on
18:30:49 <Samu> i thought there was more :(
18:31:22 <Samu> with inflation turned on, i know that EpicTrans doesn't have this problem
18:33:17 <Milek7_> Samu: do you maintain some ai benchmark list? :D
18:34:34 <Eddi|zuHause> LordAro: sure, but it's difficult to transition from one system to another
18:35:09 *** sla_ro|master has joined #openttd
18:35:42 <Milek7_> rather that once it works nobody have incentive to touch it
18:36:49 <LordAro> doesn't mean it shouldn't be done though ;)
18:38:38 <Milek7_> it is possible to overload no argument version to call normal version with _current_company, so old code still works and transition can be done incrementally
18:39:06 *** KenjiE20 has joined #openttd
18:40:17 <Samu> i'm currently testing 6 ais
18:40:28 <Samu> actually 2 ais, but different tests with them
18:41:38 <Samu> I suspect AIAI inclusion of mail trucks is done wrong
18:41:52 <Samu> will know for sure when it reaches 2051
18:44:06 <Samu> WmDOT requires luck to avoid a bankrupt
18:44:37 <Samu> he still masses ships that cross the world one side to another
18:47:40 <Samu> i don't like AIAI station spreading at all :(
18:51:31 *** smoke_fumus has joined #openttd
19:08:26 *** TheMask96 has joined #openttd
19:10:41 *** HerzogDeXtEr has joined #openttd
19:19:03 <Eddi|zuHause> yes, that should be possible
19:19:35 <Eddi|zuHause> but i don't think it's worth it
19:20:10 <Eddi|zuHause> because you need to pass the company recursively to all commands
19:22:46 <Eddi|zuHause> that means whatever new system you're trying to introduce, it won't work until you completely converted everything
19:24:17 <Eddi|zuHause> and that means it's better to just rip the old system out and replace it with the new system in one go, because you're not limited by the "compatibility" with the old system
19:45:45 <DorpsGek> Commit by translators :: r27658 trunk/src/lang/danish.txt (2016-10-06 19:45:36 +0200 )
19:45:47 <DorpsGek> danish: 1 change by Knogle
20:06:44 *** Supercheese has joined #openttd
20:08:48 *** Progman has joined #openttd
20:20:31 *** gelignite has joined #openttd
20:21:45 *** andythenorth has joined #openttd
20:45:14 <Milek7_> newgrf can alter vehicles added by other newgrfs?
20:46:08 <frosch123> let's say, they can reimplement them
21:50:44 <Samu> think i'm gonna reduce the counting of months of bankruptcy from 10 to 9
21:51:04 <Samu> shift all monthly cases by -1
21:51:55 <Samu> probably going to need a savegame conversion t.t
21:53:07 *** andythenorth has left #openttd
21:55:29 <Samu> strange, this doesn't match my expectation
21:56:19 <Samu> if the company is bankrupting in december, then something's wrong
22:28:11 *** Eddi|zuHause has joined #openttd
22:29:07 <Samu> damn network queueing of commands
22:32:08 *** sim-al2 has joined #openttd
22:58:28 <Samu> nevermind, i understand now
23:02:31 <Samu> I'm more convinced that bankrupt checking has to be done before any accounting takes place. Accounting for loan interest and "other" costs already take place after the bankruptcy check, so why not do the same for the infrastructure costs?
23:06:26 <Samu> even inflaction is accounted after bankrupt checking
23:07:01 <Samu> look at line 1948 economy.cpp
23:09:09 <Samu> on the other hand, infrastructure costs evades the inflation adjustments
23:09:17 <Samu> since it happens before inflation
23:12:27 <Samu> who's an economist expert?
23:13:42 *** FLHerne has joined #openttd
23:15:14 <Samu> openttd companies practice fiscal evasion :p j/k
23:16:07 <Samu> what is the correct order for accounting costs and inflation?
23:16:17 <Wolf01> Nah, all OTTD companies are registered in Ireland
23:26:38 <sim-al2> Infrastructure costs with inflation would get brutal quickly...
23:29:17 <Samu> there's always infrastructure costs
23:29:44 <Samu> ah, i don't mean the infrastructure maintenance game setting
23:30:09 <sim-al2> There is a constant monthly costs of like 500 pounds or so
23:30:11 <Samu> but they're still accounted like the others
23:30:32 <sim-al2> Even if there's no company property at all
23:32:29 <Samu> those costs are the "other" category, they're done after inflation
23:32:56 <Samu> line 662 is for the infrastructure costs
23:33:14 <Samu> the "other" category is ... somewhere else, let me find
23:34:58 <Samu> Pay Interest includes the "other"
23:36:02 <Samu> 1948 CompaniesGenStatistics(); - infrastructure costs are here
23:36:47 <Samu> 1949-1952 - inflation stuff
23:37:06 <Samu> 1953 CompaniesPayInterest(); - loan interest and "other"
23:37:44 <Samu> shouldn't inflation be the first thing to compute?
23:38:16 <Samu> who's an economy expert :(
23:52:10 <Samu> either the first or the last, not in-between
23:52:30 <Samu> unless it makes sense from an economist expert
continue to next day ⏵