Back to Home / #openttd / 2017 / 05 / Prev Day | Next Day
#openttd IRC Logs for 2017-05-28

---Logopened Sun May 28 00:00:09 2017
00:22-!-sim-al2 [~sim-al2@108-221-157-231.lightspeed.mmphtn.sbcglobal.net] has quit [Ping timeout: 480 seconds]
00:26-!-techmagus [~Laibeus_L@00022bb9.user.oftc.net] has quit [Remote host closed the connection]
00:27-!-techmagus [~Laibeus_L@00022bb9.user.oftc.net] has joined #openttd
00:27-!-techmagus is "Yahanan Xie" on #tor-project #tor #openttd #/r/openttd
01:28-!-Alberth [~alberth@00015f9e.user.oftc.net] has joined #openttd
01:28-!-Alberth is "purple" on #openttd
01:28-!-mode/#openttd [+o Alberth] by ChanServ
01:28<@Alberth>hi hi
01:46-!-cosmobird [~cosmobird@103.63.14.96] has joined #openttd
01:46-!-cosmobird is "realname" on #coopetition #osm-asia #open-maps-more-than-maps #osm #openttdcoop.wiki #openttdcoop #openttd #OpenRailwayMap #josm #hot #communitydata
01:52-!-sla_ro|master [~sla.ro@95.76.45.217] has joined #openttd
01:52-!-sla_ro|master is "slamaster" on @#sla #openttd #love
02:03-!-Progman [~progman@p5DC5F15E.dip0.t-ipconnect.de] has joined #openttd
02:03-!-Progman is "Peter Henschel" on #openttdcoop.dev #openttdcoop #openttd
02:13-!-cHawk [chawk@96-18-31-251.cpe.cableone.net] has joined #openttd
02:13-!-cHawk is "realname" on #openttd
02:20-!-cosmobird_ [~cosmobird@117.204.28.218] has joined #openttd
02:20-!-cosmobird_ is "realname" on #communitydata #hot #josm #OpenRailwayMap #openttd #openttdcoop #openttdcoop.wiki #osm #open-maps-more-than-maps #osm-asia #coopetition
02:21-!-cHawk [chawk@96-18-31-251.cpe.cableone.net] has quit [Quit: Leaving]
02:27-!-cosmobird [~cosmobird@103.63.14.96] has quit [Ping timeout: 480 seconds]
03:24-!-cHawk [chawk@96-18-31-251.cpe.cableone.net] has joined #openttd
03:24-!-cHawk is "realname" on #openttd
03:45-!-cHawk [chawk@96-18-31-251.cpe.cableone.net] has quit [Quit: Leaving]
03:49-!-tokai|noir [~tokai@00012860.user.oftc.net] has joined #openttd
03:49-!-tokai|noir is "Christian Rosentreter" on #openttd
03:49-!-mode/#openttd [+v tokai|noir] by ChanServ
03:56-!-tokai [~tokai@00012860.user.oftc.net] has quit [Ping timeout: 480 seconds]
04:46-!-gelignite [~gelignite@x5ce4c0af.dyn.telefonica.de] has joined #openttd
04:46-!-gelignite is "gelignite" on #openttd #openttdcoop.devzone
04:47-!-Wolf01 [~wolf01@host142-216-dynamic.15-87-r.retail.telecomitalia.it] has joined #openttd
04:47-!-Wolf01 is "Wolf01" on #openttd
04:48<Wolf01>o/
04:51-!-Hiddenfunstuff [~Geth@e137.ip11.netikka.fi] has joined #openttd
04:51-!-Hiddenfunstuff is "Geth" on #openttd #/r/openttd #openttdcoop
05:04<@Alberth>o/
05:13-!-cosmobird__ [~cosmobird@103.63.14.83] has joined #openttd
05:13-!-cosmobird__ is "realname" on #communitydata #hot #josm #OpenRailwayMap #openttd #openttdcoop #openttdcoop.wiki #osm #open-maps-more-than-maps #osm-asia #coopetition
05:20-!-cosmobird_ [~cosmobird@117.204.28.218] has quit [Ping timeout: 480 seconds]
05:34-!-FR^2 [~frquadrat@2001:41d0:1:f924::1] has left #openttd [Leaving]
05:38<Wolf01>https://img-9gag-fun.9cache.com/photo/aQ9W84e_460sv.mp4 newships... (still not sure how it could prevent sea sickness, as I'm having it just for looking at the gif)
05:46<@Alberth>less movement you didn't create I guess, but yeah "prevent" seems a bit strong
05:48<Wolf01>It only weakens the impacts, the problem with motion sickness is the motion :P
05:49<@Alberth>I know :)
05:50<@Alberth>but going just straight, instead of up+down+straight does help, in my experience
05:52<Wolf01>My problem is the lateral bobbing
05:53<@Alberth>yep, the correct term is "avoid" or "reduce" sickness, rather than "prevent"
05:55<@Alberth>looking at it from outside may give a wrong impression though, everything seems to move, perhaps not in the last place since the camera may not be steady either
05:56<@Alberth>but if things perfectly counter-acts each other, the result if you sit inside is much better than it looks
05:57<Wolf01>Yeah, still not enough to let me ride it XD
05:58<@Alberth>pick a nice quiet day :)
05:59<@Alberth>these guys picked a "bad" day, otherwise it's hard to sell :p
06:12-!-Wormnest [~Wormnest@s5596abd2.adsl.online.nl] has joined #openttd
06:12-!-Wormnest is "Wormnest" on #openttd
06:19<Eddi|zuHause>"as I'm having it just for looking at the gif" <-- you can't compare that... sea sickness comes from when your brain detects mismatching movement by your eyes and your ears (balance)
06:19<Eddi|zuHause>however, your ears don't detect any movement while you're watching on screen
06:24<Wolf01>Ehm, ears don't, but eyes do, so there's a sensorial mismatch
06:27<Eddi|zuHause>exactly, but that won't be the same mismatch as when you're actually on that boat
06:59-!-HerzogDeXtEr [~farci@i59F6BFBD.versanet.de] has joined #openttd
06:59-!-HerzogDeXtEr is "purple" on #openttd
07:48-!-sim-al2 [~sim-al2@108-221-157-231.lightspeed.mmphtn.sbcglobal.net] has joined #openttd
07:48-!-sim-al2 is "sim-al2" on #openttd @#/r/openttd
08:54-!-sla_ro|master [~sla.ro@95.76.45.217] has quit []
09:10-!-Snail [~jacopocol@cpe-98-14-137-148.nyc.res.rr.com] has joined #openttd
09:10-!-Snail is "Jacopo Coletto" on #openttd
09:32-!-Eddi|zuHause [~johekr@p5B0DA62D.dip0.t-ipconnect.de] has quit [Remote host closed the connection]
09:34-!-Eddi|zuHause [~johekr@p5B0DA62D.dip0.t-ipconnect.de] has joined #openttd
09:34-!-Eddi|zuHause is "Johannes E. Krause" on #openttd
09:56-!-sim-al2 [~sim-al2@108-221-157-231.lightspeed.mmphtn.sbcglobal.net] has quit [Ping timeout: 480 seconds]
10:03-!-Snail [~jacopocol@cpe-98-14-137-148.nyc.res.rr.com] has quit [Quit: Snail]
10:04-!-FLHerne [~flh@cpc4-papw5-2-0-cust175.5-3.cable.virginm.net] has joined #openttd
10:04-!-FLHerne is "Francis Herne" on #openttd
10:04-!-sla_ro|master [~sla.ro@95.76.45.217] has joined #openttd
10:04-!-sla_ro|master is "slamaster" on @#sla #openttd #love
10:06-!-chomwitt3 [~chomwitt@2a02:587:dc07:7a00:1a3:56e5:5d7a:bfd5] has quit [Ping timeout: 480 seconds]
10:20<supermop_home>Alberth: I switched my switch to return (117*switch_cost/100)
10:21<supermop_home>but now I get the error 'binary operator requires both operands to be integers or floats'
10:21<supermop_home>so I guess there is no way to do math of the result of a different switch?
10:28<@Alberth>I am pretty much useless as oracle for NML :)
10:28<supermop_home>haha sorry, just asked you because we were talking about it yesterday
10:29<@Alberth>I wonder if you could use a temporary variable for storing the switch value
10:29<@Alberth>but no idea if that works
10:29<supermop_home>that's what I am looking at now,
10:30<@Alberth>another magic option is to store the 117 into a variable, and use that in the code of "switch_cost"
10:30<supermop_home>but I wonder if it thinks the value of switch_x is not and int (even though the returned value is), would it think the same thing about the stored value
10:30<supermop_home>hmm
10:30<@Alberth>and of course, duplicating the switch, once for 100*cost/100 and once for 117*cost/100 is also an option
10:31<@Alberth>the name "switch_cost" is not a number
10:31<supermop_home>well in this switch I need to return the plain switch_cost in case A, and the increased switch_cost in case b
10:31<@Alberth>apparently, it wants numbers or constant expressions there
10:32<supermop_home>if the name of the switch is not a number, wouldn't the name of the stored value also not be a number
10:32<@Alberth>sounds likely
10:33<@Alberth>as I said, I am pretty much useless as guide in NML
10:33<@Alberth>:p
10:34<supermop_home>I wonder if there is some other type of block elsewhere I can do the math
10:42-!-Montana_ [~chatzilla@148.222.94.90.dynamic.jazztel.es] has joined #openttd
10:42-!-Montana_ is "New Now Know How" on #openttd
10:42-!-Montana_ is now known as Montana
10:48<@Alberth>how many switch_cost return values do you have?
10:49<@Alberth>hmm, never mind, has the same problem of first querying the cost value
11:43<supermop_home>Alberth: in those cases, it returns switch_cost_x for each known type of electric road, else it tries to do switch_cost_x*some coefficient
11:48<@Alberth>I don't know how to compute a multiplication of 2 switch results, or one switch result as part of computing another switch
11:49<@Alberth>what will work is to expand the switches to all possible cases, and hard-code the factor, in a way
11:50<@Alberth>hmm, wasn't the coefficient some parameter?
11:50<@Alberth>that lives outside the value computations
11:51<@Alberth>you can select entire switches with that
11:51<@Alberth>(afaik)
11:54-!-glx [~glx@000128ec.user.oftc.net] has joined #openttd
11:54-!-glx is "Loïc GUILLOUX" on #openttd
11:54-!-mode/#openttd [+v glx] by ChanServ
11:56<supermop_home>the parameters set the running cost style, easy medium or hard
11:56-!-andythenorth [~andytheno@217.33.116.188] has joined #openttd
11:56-!-andythenorth is "andythenorth" on #openttd
11:56<supermop_home>then there are swithes for each engine type - diesel, electric, dual mode, for each generation (5 for diesel, 4 for electric, 2 for dual)
11:57<@Alberth>too much freaking detail :p
11:57<supermop_home>each of those switches returns one of three hard coded running cost factors, per parameter setting
11:57<@Alberth>let me try to find parameter usages that can be helpful
11:58<supermop_home>then in the case of dual mode, there needs to be another switch that changes running cost based on whether it is on an electric road or not
11:58<supermop_home>I feel like it must be simpler some how
11:59<supermop_home>the easy/medium/hard settings are .5/1.0/1.5
11:59<supermop_home>i wish I could just globally multiply all running costs by those coefficients without using so many switches
12:00<supermop_home>like running_cost: (running_cost_x * param y )
12:00<andythenorth>o/
12:00<supermop_home>yo andy
12:00<@Alberth>did you try using a parameter in a computation?
12:01<@Alberth>o/
12:01<supermop_home>no
12:01<supermop_home>I wonder if I can do match right in the callback like that tho
12:01<@Alberth>parameters count much like a constant
12:02<@Alberth>I wouldn't be surprised if that just works
12:02<supermop_home>or store value (xxx*param 1)
12:02<supermop_home>then retrieve that value
12:03-!-DDR [~David@S0106f0f249839863.vc.shawcable.net] has quit [Ping timeout: 480 seconds]
12:04<@Alberth>I'd just put the expression with param in the computation (1 + difficulty_param) * value / 2
12:05<@Alberth>if parameters are treated as constant, you have only "value" there, which you can expand in the switch to constants
12:06<@Alberth>ie each return case a different number for 'value'
12:07-!-andythenorth [~andytheno@217.33.116.188] has quit [Quit: andythenorth]
12:07<@Alberth>by eandy
12:07-!-andythenorth [~andytheno@217.33.116.188] has joined #openttd
12:07-!-andythenorth is "andythenorth" on #openttd
12:07<@Alberth>wb andy :)
12:08<andythenorth>looks like 4/8 wagons to me http://www.ebay.co.uk/itm/LIFE-LIKE-TRAINS-IRON-HORSE-HO-SCALE-LARGE-SET-BRAND-NEW-USA-/162532035166?hash=item25d7aa0a5e:g:-IAAAOSwiONYKf0C
12:08<andythenorth>but the engine + tender looks like 6/8 :P
12:17<Wolf01>o/
12:22<andythenorth>6 industries left to draw for FIRS v3
12:22<supermop_home>does that include the 'old' papermill for 18th C games per user request?
12:26<supermop_home>Alberth:
12:26<supermop_home>ELRD: return ((param_runcost*205)/2);
12:26<supermop_home>default: return (117*((param_runcost*205)/2)/100);
12:26<supermop_home>going to try that
12:32<@Alberth>if param_runcost is 0, it's all quite cheap :)
12:33<@Alberth>parentheses aren't needed, * and / run from left to right
12:33<@Alberth>hmm, maybe the 117* (... ) is needed
12:34<@Alberth>@calc 117*205
12:34<@DorpsGek>Alberth: 23985
12:35<@Alberth>quite a lot of the 16 bits :)
12:36<@Alberth>hmm, it's only 15 bit, wasn't it?
12:39<@Alberth>102 + param_runcost * 103 ?
12:40<@Alberth>assumes param_runcost to be 0 or 1
12:41<@Alberth>obviously, you can factor your 117/100 into those constants too
12:41<@Alberth>@calc 205 * 117 /100
12:41<@DorpsGek>Alberth: 239.85
12:42<andythenorth>supermop: no ‘old’ papermill
12:42<andythenorth>FIRS tends to ‘modern’ industries
12:42<@Alberth>(param_runcost * 240) / 2 should quite work
12:43-!-Gja [~Martin@93-167-84-102-static.dk.customer.tdc.net] has joined #openttd
12:43-!-Gja is "Martin" on #bcache #openttd
12:48<supermop_home>andythenorth was a joke
12:49<supermop_home>hmm is (117/100)*X better than 117*x/100?
12:49<supermop_home>at least grf compiles now
12:53-!-andythenorth [~andytheno@217.33.116.188] has quit [Quit: andythenorth]
12:58-!-andythenorth [~andytheno@217.33.116.188] has joined #openttd
12:58-!-andythenorth is "andythenorth" on #openttd
12:58<andythenorth>supermop: such jokes :)
12:58<andythenorth>also such peatlands
12:58<andythenorth>who wants to draw that? o_O
13:03<andythenorth>http://fafard.qc.ca/wp-content/uploads/2013/05/tourbiere-saint-bonaventure-quebec-bog-peatland.jpg
13:06-!-frosch123 [~frosch@00013ce7.user.oftc.net] has joined #openttd
13:06-!-frosch123 is "frosch" on #openttdcoop.devzone #openttd.dev #openttd
13:07-!-andythenorth [~andytheno@217.33.116.188] has quit [Quit: andythenorth]
13:11<frosch123>hoin
13:14<supermop_home>Alberth: things seem to be working well now
13:15<supermop_home>now I need to do the same thing for capacities
13:23<supermop_home>whats the difference between cargo_capacity and purchase_cargo_capacity?
13:23<supermop_home>purchase is what the menu shows?
13:27<frosch123>it's for the purchase list
13:27<frosch123>it's different, because articulated parts are quite tricky there
13:28<frosch123>since they do not really exist, so, stuff like deciding capacity based on the other parts does not work
13:30<supermop_home>does a non-articulated truck need it?
13:30<frosch123>in that case link both to the same switch
13:34<frosch123>Wolf01: should we attempt a hostile take over of the f party? (to turn it into a ottd party)
13:36<Wolf01>The idea is tempting
13:44<supermop_home>i wonder
13:44<supermop_home>is a semi truck twice as heavy as a typical rigid truck?
13:44<supermop_home>1.5 times?
13:47-!-andythenorth [~andytheno@217.33.116.188] has joined #openttd
13:47-!-andythenorth is "andythenorth" on #openttd
13:47<supermop_home>seems like something andy would know
13:53<andythenorth>supermop: tare weight should be about 1/3 of gross weight, for the entire combination in both cases
13:57<supermop_home>going to do rigid: x, short trailer x*1.3, long trailer x*1.5
13:58<supermop_home>hmm
13:58-!-FLHerne [~flh@cpc4-papw5-2-0-cust175.5-3.cable.virginm.net] has quit [Quit: There's a real world out here!]
13:58<+glx>next step road train ?
13:58-!-FLHerne [~flh@cpc4-papw5-2-0-cust175.5-3.cable.virginm.net] has joined #openttd
13:58-!-FLHerne is "Francis Herne" on #openttd
13:59<Wolf01>Isn't already there?
13:59<supermop_home>modifying the short semi to just attach more short trailers is easy enough
14:02<supermop_home>though I will probably do something like, gen 1: short, gen 2: short or long, gen 3: long or 2*short, gen 4, long or 3*short
14:03<supermop_home>andy so 1/2 capacity for weight is good rule of thumb?
14:04<andythenorth>yes
14:04<andythenorth>30t payload, 15t vehicle weight
14:08-!-tux [~mindlesst@45.63.21.168] has joined #openttd
14:08-!-tux is "ZNC - http://znc.in" on #virtualization #virt #qemu #osm #openttd #openconnect #observium #linode #ipv6 #OpenRailwayMap
14:09-!-tux is now known as Guest1105
14:14-!-mindlesstux [~mindlesst@2001:19f0:5:238:5400:ff:fe30:7f01] has quit [Ping timeout: 480 seconds]
14:14-!-Guest1105 is now known as mindlesstux
14:18-!-cosmobird_ [~cosmobird@117.204.29.152] has joined #openttd
14:18-!-cosmobird_ is "realname" on #communitydata #hot #josm #OpenRailwayMap #openttd #openttdcoop #openttdcoop.wiki #osm #open-maps-more-than-maps #osm-asia #coopetition
14:19-!-mindless- [~mindlesst@2001:19f0:5:238:5400:ff:fe30:7f01] has joined #openttd
14:19-!-mindless- is "ZNC - http://znc.in" on #virtualization #virt #qemu #osm #openttd #openconnect #OpenRailwayMap #ipv6 #observium #linode
14:24-!-cosmobird__ [~cosmobird@103.63.14.83] has quit [Ping timeout: 480 seconds]
14:25-!-mindless- [~mindlesst@2001:19f0:5:238:5400:ff:fe30:7f01] has quit [Quit: ZNC - http://znc.in]
14:25-!-Montana [~chatzilla@148.222.94.90.dynamic.jazztel.es] has quit [Remote host closed the connection]
14:26-!-mindlesstux [~mindlesst@45.63.21.168] has quit [Ping timeout: 480 seconds]
14:49-!-sla_ro|master [~sla.ro@95.76.45.217] has quit []
14:57-!-mindlesstux [~mindlesst@2001:19f0:5:238:5400:ff:fe30:7f01] has joined #openttd
14:57-!-mindlesstux is "ZNC - http://znc.in" on #virtualization #virt #qemu #osm #openttd #openconnect #OpenRailwayMap #ipv6 #observium #linode
15:22-!-mindlesstux [~mindlesst@2001:19f0:5:238:5400:ff:fe30:7f01] has quit [Quit: ZNC - http://znc.in]
15:37-!-mindlesstux [~mindlesst@45.63.21.168] has joined #openttd
15:37-!-mindlesstux is "ZNC - http://znc.in" on #tuz-oftc #tuz #virtualization #virt #qemu #osm #openttd #openconnect #OpenRailwayMap #ipv6 #observium #linode
15:38<argoneus_>good evening train friends
15:38-!-argoneus_ is now known as argoneus
15:39<Wolf01>o/
15:41<argoneus>Alberth: is it alright if I ask a soft. eng. question?
15:41<argoneus>I remember you've helped me a lot before when we last spoke
15:42<argoneus>though others will probably know it as well, it's just something I only learned recently
15:42<argoneus>the point of interfaces is to declare ahead of time what kind of functionality I demand from some module another one uses without caring about the specifics, right?
15:43<Wolf01>Somewhat, yes
15:43<argoneus>so like, if I have a command handler that receives a command, processes it and then sends a response
15:44<argoneus>instead of hardcoding anything, this command handler will have a member object such as "ResponseInterface" with functions such as sendOK, sendMessage, etc.?
15:44<argoneus>and at that point I don't care if the response is printed to a file or sent over a network
15:44<argoneus>the command handler just does not care
15:44<argoneus>is that the idea?
15:44<argoneus>or am I overthinking/overengineering things
15:45<frosch123>add "interpreted by a unittest framework" to that list
15:45<argoneus>so I can just do network_protocol->send_message(Message(Client, Text))
15:45<Wolf01>The interface is like a puzzle piece, where you don't have the content but only the shape
15:45<argoneus>and I don't care
15:45<argoneus>?
15:46<Wolf01>And you don't use the interface, but you must implement a class of that interface
15:46<argoneus>frosch123: you mean... that the command handler can now have a dummy object that implements the interface?
15:46<argoneus>and it's easy to unit test, because said object can just do nothing for all the functions, since the unit test doesn't care about it?
15:47<argoneus>but yeah, my point, or question is
15:47<argoneus>is this a *correct* usage of an interface or am I overengineering things?
15:47<frosch123>the unittest provides the output interfaces and then feeds data into the input interfaces, and can check the output
15:47<frosch123>argoneus: your interface sounds fine
15:47<argoneus>I just see it as something like
15:47<Wolf01>You can have a class with a sendOk function which returns an hardcoded output just to check if that function is called
15:47<argoneus>when a class is finished with work in its own scope, and wants to send the results to an unknown recipient
15:48<argoneus>which can be different protocols etc.
15:48<frosch123>it's anything that divides the code, and where you can check whether some misbehaviour is before or after it
15:48<frosch123>like, if you have some big software and you input something and the result is wrong
15:48*andythenorth mind blown
15:48<frosch123>you can check the intermediate results at all interfaces to isolate the bug
15:48<argoneus>ah
15:49<argoneus>so then it's good practice to have an interface for every... well, interface between .. what to call it
15:49<argoneus>"logical units"?
15:49*andythenorth just thought interfaces were stable methods with defined parameters and results
15:49<argoneus>of the software
15:49<Wolf01>Look about mockups
15:49<frosch123>the idea of unitstests is to separate things which can be tested on their own
15:49<andythenorth>and the upside being no private shenanigans changing state inside the object
15:49<frosch123>and then fill the space inbetween with boilerplate
15:49<@Alberth>interfaces partition your solution in smaller pieces with known functionality
15:50<argoneus>hmm, I see
15:50<argoneus>because
15:50<argoneus>I was doing some google tutorials for android programming
15:50<andythenorth>Alberth: why bother with an interface? o_O Surely “foo._important_data = some new value” is fine? o_O
15:50<argoneus>and I downloaded the example code, and it was interface upon interface upon interface, nested interfaces inside a "Contract" interface...
15:50<frosch123>another usecase of interfaces is: if you have two branches of a company work on the same software, you use the interface specificaion to figure out which branch to blame if something does not work
15:50<argoneus>and I was like "oh god this is terrible", but after I wrote all the boilerplate, it was actually really nice to work with
15:51<andythenorth>argoneus: if you have found Contracts, then you are in political code
15:51<argoneus>political code...?
15:51-!-sim-al2 [~sim-al2@108-221-157-231.lightspeed.mmphtn.sbcglobal.net] has joined #openttd
15:51-!-sim-al2 is "sim-al2" on #openttd @#/r/openttd
15:51<andythenorth>it might be fine, but it’s more politics than engineering currently
15:51<@Alberth>andythenorth: it's a matter of scale, direct access works up to some scale / up to some number of programmers
15:51<andythenorth>Alberth: 0.9?
15:52<@Alberth>beyond that you need more structure
15:52<argoneus>hmm
15:52<argoneus>actually, now that I think about it
15:52<argoneus>there's no such thing as using interfaces too much, right? it's not like making classes upon classes, I have to actually implement a concrete interface anyway, so it doesn't bloat it
15:52<@Alberth>oh, there is
15:52<argoneus>concretely implement an interface*
15:52<argoneus>oh
15:52<@Alberth>like anything too much of it is not good :p
15:53<argoneus>hm
15:53<argoneus>it just suddenly made sense in my case
15:53<argoneus>like
15:53<@Alberth>but the problem is, when is "too much" ?
15:53<argoneus>when I have some part that's pluggable in/out
15:53<argoneus>like network things
15:53<argoneus>it seemed to make sense
15:53-!-FLHerne [~flh@cpc4-papw5-2-0-cust175.5-3.cable.virginm.net] has quit [Remote host closed the connection]
15:53<frosch123>argoneus: if you add interfaces you always also define what the software shall do
15:53<argoneus>if I want to support 50 different protocols, it's surely a good thing to have a common interface, no?
15:54<frosch123>if you add too many interfaces you may have more flexibility than is actually needed
15:54<frosch123>so your software ends up more complicated than needed
15:54<frosch123>or you get lost in corner cases, which actually noone needs
15:54<argoneus>hmhm, that makes sense
15:55<@Alberth>also, changing an interface is tricky, since it gets used at many places
15:55<frosch123>i..e. the more interfaces you have, the smaller each one is, which makes them more generic
15:55-!-FLHerne [~flh@cpc4-papw5-2-0-cust175.5-3.cable.virginm.net] has joined #openttd
15:55-!-FLHerne is "Francis Herne" on #openttd
15:55<argoneus>I guess like with all software engineering things
15:55<argoneus>it's cool, but don't try to use it everywhere
15:55<argoneus>see: design patterns
15:55<@Alberth>giving total fragmentation of functionality :p
15:55<argoneus>right
15:56<@Alberth>design patterns primary use, as I see it, is that common patterns have a name
15:56<@Alberth>so you can talk about it, without having to draw a large class diagram
15:56<argoneus>I'm just still struggling with an implementation of an IRC bot that supports plugins that add commands and have their own functionality like timers or database support and such
15:56<argoneus>I'm on my 3rd iteration
15:56<andythenorth>http://thecodelesscode.com/case/117?topic=interfaces
15:56<@Alberth>:D andy
15:56<argoneus>and again it's an abomination that works perfectly, but... there's no clear separation
15:57<argoneus>like
15:57<argoneus>the network functions call the non-network code
15:57<argoneus>and the non-network code has direct access to sockets
15:57<argoneus>stuff like that I don't know how to get rid of
15:57<@Alberth>something needs to connect it
15:57<@Alberth>or you have 2 spearate programs :p
15:58<argoneus>I'll give a quick example, if that's fine
15:58<argoneus>say there's an IRC bot with a... spamming plugin, for explanation purposes
15:58<Wolf01>The best work about actually using interfaces in actual code has been done by the PHP standards recomendation guys http://www.php-fig.org/psr/
15:58<Wolf01>s/actually/
15:59<argoneus>the plugin defines a command !spam <text>. once someone uses this command, it will send said message as a private message to everyone in the room (my bot actually doesn't have this)
15:59<argoneus>but how my bot would do it: network class receives message, sends it to parser, parser parses it, and the parser grabs a list of every user's socket and sends them the message
15:59<argoneus>that last step works perfectly, but I feel like it's really really bad
15:59<argoneus>but I have no clue how to eliminate it
16:00<andythenorth>what bothers you about it?
16:00<andythenorth>you don’t like the parser performing send?
16:00<argoneus>it seems like it's a bad idea to use raw sockets inside a class that shouldn't even ideally know there's a network socket
16:00<andythenorth>not the parser’s job?
16:00<argoneus>yeah
16:00<argoneus>I feel like the network class should be the only one working with sockets
16:00<andythenorth>controller class?
16:01<Wolf01>Then it's domain driven development what you are looking for
16:01<andythenorth>don’t you delegate to the parser, and then handle what it returns?
16:01<frosch123>argoneus: try to not make your code like a pipeline, where one class passes data to the next one
16:01<argoneus>oh, is that bad?
16:01<argoneus>I've always done it that way
16:01<frosch123>instead always make the classes return the result to the caller
16:01<argoneus>so... instead of the parser class sending messages
16:02<frosch123>if needed put a class at the bottom, which calls everyone
16:02<argoneus>it would return a list of Message(RecipientObject, text), and the network class would resolve RecipientObject into a socket?
16:02<argoneus>or that won't work
16:02<argoneus>"put a class at the bottom, which calls everyone"...?
16:03<@Alberth>plugin has a "main" of its own
16:03<andythenorth>in python, you’d have __main__ or so
16:03<argoneus>....wait
16:03<andythenorth>in a web app you might have a request controller or so
16:03<argoneus>so I send the message to every plugin?
16:04<argoneus>and they either return nothing or they return message(s)?
16:04<argoneus>and then I just send these
16:04<andythenorth>you’d have flow control inside your main class, passing state along
16:04<@Alberth>or all until the fuirst answrs or so
16:04<frosch123>have one mani class which calls "package = receiver.receive(); parsed_package = parser.parse(package); result = command_handler.execute(parsed_package); receiver.reply(package, result)"
16:04<argoneus>oh, huh
16:04<Wolf01>Functionalities as services, each service is a separate class, the base class calls the services passing the data
16:04<argoneus>oh, right!
16:04<argoneus>there was one other problem I had with this
16:04<argoneus>what exactly is "result"
16:04<andythenorth>so the state in frosch’s example is ‘package’ and ‘result'
16:04<argoneus>like if the command should
16:05<frosch123>that main loop would also ultimatively catch all the exceptions
16:05<argoneus>send a message to everyone who's an admin, and at the same time kick someone whose name starts with xyz
16:05<andythenorth>and the main delegates to classes to mute state
16:05<frosch123>and pass an error status to somewhere
16:05<argoneus>what exactly is "result"?
16:05<andythenorth>let’s not talk about Haskell here :)
16:06<Wolf01>Result could be anything you want, which should make sense to the next step in the base class
16:06<@Alberth>I don't think you want to do 2 different things together
16:06<argoneus>do I need some sort of abstraction like a Response, from this a MessageResponse, KickResponse, etc...
16:06<argoneus>and result is list<Response>
16:06<argoneus>and the network class evaluates these?
16:06<argoneus>would that work
16:06<argoneus>well, that's the thing
16:06<argoneus>some of the commands can be tricky
16:07<Wolf01>Usually you have one response for each request
16:07<argoneus>it can even be things like "send a message to person X, then wait 5 minutes, and then send message to person Y"
16:07<@Alberth>make the derived Response smart
16:07<argoneus>I want the plugins to be very flexible
16:07<argoneus>smart?
16:07<supermop_home>hmm semi trucks are showing double the real capacity in purchase menue
16:07<@Alberth>so it knows what the message is doing or how to send it etc
16:08<andythenorth>supermop: paste your nml
16:08<@Alberth>but in general, you cannot be flexible in every direction.
16:08<argoneus>hmm
16:08<argoneus>this is kinda one of the reasons I just had raw sockets
16:08<argoneus>because some commands did 4 different things at once
16:08<argoneus>and I couldn't figure out how to standardize it into a response
16:08<@Alberth>it means you cannot have any structure, since such structure would block extensions that use a different structure
16:09<@Alberth>so you have to make a limit somewhere
16:09<@Alberth>there is a large trap in trying to over-generailize things
16:10<@Alberth>it seems so nice, and it nicely fits in our western belief that everything must have a box of its own
16:10<argoneus>hmm
16:10<argoneus>well, in the case of IRC
16:10<@Alberth>but in real applications, there is always these cases that won't fit
16:11<argoneus>is there a problem with a command having more than one response? if I call it Action instead of response, it suddenly makes sense, no?
16:11<argoneus>every command can have X actions associated with it
16:11<Wolf01>Yes, but still one response
16:11<argoneus>and these actions can be logged at the parser level easily
16:11<@Alberth>it sounds complicated at least
16:11<argoneus>oh
16:11<argoneus>then a Response could just be a list of Actions
16:11*argoneus shrugs
16:11<@Alberth>it's almost a program by itself
16:12<argoneus>well
16:12<argoneus>the set of possible actions is limited
16:12<Wolf01>You can do 100 actions and have a response which tells you if all was fine
16:12<@Alberth>software is so nice, there is no upper limit in adding more and more layers :)
16:12<argoneus>the bot can really only do like 6 different things, but one command can do 3 of those at the same time
16:12<@Alberth>I'd make one command do one thing, and have more commands
16:13<argoneus>well
16:13<argoneus>I shouldn't have said IRC, probably
16:13<Wolf01>For example you have a KickBanWhy() command, it does 3 actions: kick, ban and explain why
16:13<argoneus>it's more of a game that runs over pretty-much-IRC
16:13<argoneus>so a command could like reduce someone's health and move them soemwhere else
16:14<argoneus>and it makes no sense for them to be separate commands
16:14<@Alberth>can I play chess with it?
16:14<argoneus>oh, wait
16:14<Wolf01>But the response is only one: has the user been kicked, banned and notified?
16:14<argoneus>then I just declare this action at the network elvel
16:14<argoneus>!
16:14<argoneus>in the interface
16:14<argoneus>oh, or what Wolf01said
16:14<argoneus>that also seems nice
16:14<@Alberth>there is a finite number of useful actions in a game
16:14<argoneus>Alberth: probably yeah
16:15<argoneus>yeah, definitely
16:15<argoneus>there's a finite set of actions
16:15<@Alberth>don't generalize beyond that, there is no point
16:15<argoneus>but commands can mix them together
16:15<argoneus>reasonably
16:17<argoneus>anyway thanks a lot everyone
16:18<Wolf01>I did this for 5 years every day... CURL APIs
16:18<argoneus>the question now is whether I want to create these compound actions at the network interface level, or just have each command do multiple actions
16:18<argoneus>I guess I'll just have to write down what exactly I even need
16:18<@Alberth>keep it simple :)
16:19<@Alberth>I tend to build what I need today, and not much else
16:19<argoneus>I don't know how to refactor efficiently :(
16:19<argoneus>I end up just deleting everything and re-writing
16:19<argoneus>this is my 4th iteration of the same bot!
16:19<@Alberth>tomorrow is unpredictable anyway, no point in trying to prepare for it
16:19<argoneus>the 3 previous ones work perfectly but I hate their design
16:19<Wolf01>Learn about design atterns
16:19<Wolf01>*patterns
16:19<supermop_home>andythenorth: https://paste.openttdcoop.org/pdgm3zyhn
16:20<@Alberth>the problem with rewriting is that you don't advance in functionality
16:20*andythenorth rewrites a *lot*
16:20<Wolf01>But you might be able to rewrite to advance later
16:21<argoneus>I'm just a bit of a perfectionist in this aspect
16:21<argoneus>even if the program works perfectly, and at decent speed, as long as there's something with it I deem as bad, I'm not happy
16:21<@Alberth>and efficient refactoring is very very hard, I can't do it either, I typically have 3 or 4 attempts before it works out
16:21<andythenorth>supermop_home: why does purchase_cargo_capacity result differ from cargo_capacity?
16:21<@Alberth>what about the other parts of the program?
16:22<@Alberth>ie, you can consider the bot as "good enough for now"
16:22<@Alberth>that's basically the state of most of my code, and often it dies that way :)
16:23<supermop_home>the switch for cargo capacity sets the capacity for a consist with a medium semi trailer
16:23<Wolf01>Also, the best thing to do (with a lot of spare time) is to do test driven development, you write the interfaces, then the unit tests, you mockup the concrete classes, when you are happy about the functionality you can effectively implement the real concrete classes and you have already the tests
16:23<argoneus>it's definitely good enough
16:23<andythenorth>good interfaces let you hide horrors behind them ;)
16:23<argoneus>but if I wanted to add a new feature, I can imagine it to be easier than iti s
16:23<andythenorth>somewhat a peatlands http://dev.openttdcoop.org/attachments/download/8446/peatlands.png
16:23<argoneus>right now, adding a new command involves copypasting boilerplate code
16:23<argoneus>which I think is terrible
16:23<supermop_home>part 0 returns zero, part 1 returns (param_capacity*36)/2
16:24<Wolf01>Nice andy
16:24<andythenorth>supermop_home: ok I’ll read again
16:25<andythenorth>supermop_home: you just want capacity that varies by parameter?
16:25<supermop_home>yep
16:25<Wolf01>argoneus, a bit of copy-pasting is always required
16:25<supermop_home>its working as I want, except for the semis displaying wrong in buy menu
16:26<andythenorth>supermop_home: somewhere in here :P https://paste.openttdcoop.org/pub5u3rna
16:26<andythenorth>I guess I should find the lines for you :)
16:27<argoneus>well, I'll see what I can do
16:27<argoneus>anyway, thanks a lot, train friends!
16:27<andythenorth>supermop_home: it’s a semi-truck, how much capacity do you move to tractor unit? o_O
16:29<supermop_home>0
16:30<Wolf01>I made a svn web interface to do some simple actions: update, export, and checkout new repositories, these were the 3 actions allowed by the interface, but each command did a lot in background, also filesystem changes, permissions, backups
16:30<andythenorth>ach, I have NFI how this road hog code works
16:30<andythenorth>but it has the right results
16:30<supermop_home>it looks like you just use same switch for both capacity and purchase capacity
16:31<andythenorth>yes
16:31<andythenorth>for capacity, it doesn’t have to be moved to lead unit (unlike weight iirc)
16:31<supermop_home>for some reason, my math in purchase capacity is ending up double
16:31<andythenorth>what cargo is default?
16:32<supermop_home>I can easily fix it by changing /2 to /4
16:32<supermop_home>andythenorth: none, so copper as I am playing now
16:32<andythenorth>hmm
16:32<andythenorth>why is it /2?
16:32<frosch123>what does switch_capacity_m4_box do?
16:32<supermop_home>param value is 2
16:32<supermop_home>2 3 or 4
16:33<supermop_home>/2 to get 1x, 1,5x or 2x capacity
16:33<frosch123>anyway, your vehicle consists of two articulated parts
16:34<frosch123>both parts are defined by the same "item"
16:34<frosch123>so each part has a capacity of "purchase_cargo_capacity: ((param_capacity*36)/2);"
16:34<andythenorth>so your capacity will get summed
16:34<supermop_home>frosch123: that switch sets capacity of part 0 to 0
16:34<andythenorth>nah, use multiple parts
16:34<andythenorth>pissing around changing properties leads to pitfalls
16:35<frosch123>with two parts you then end up with a capacity of "param_capacity*36"
16:35-!-Alberth [~alberth@00015f9e.user.oftc.net] has left #openttd []
16:35<supermop_home>hm
16:42-!-frosch123 [~frosch@00013ce7.user.oftc.net] has quit [Quit: be yourself, except: if you have the opportunity to be a unicorn, then be a unicorn]
16:45<supermop_home>can I store a value at the top of the nml and then just read that value in the properties?
16:46<supermop_home>or does the value in properties have to be a plain number
16:46-!-Hiddenfunstuff [~Geth@e137.ip11.netikka.fi] has quit [Ping timeout: 480 seconds]
16:47<andythenorth>can’t remember if nml supports internal arbitrary constants
16:47<andythenorth>I think it might
16:48<andythenorth>FIRS has “market_tree_snow = 1793;"
16:48<andythenorth>near the top of nml file, and market_tree_snow is then used elsewhere
16:49<supermop_home>I have like 20 trucks that have the same values for certain properties
16:49<supermop_home>would be easier to change without missing one
16:50<andythenorth>and this is why templating :)
16:50-!-Stimrol [~Stimrol@89-160-189-52.du.xdsl.is] has joined #openttd
16:50-!-Stimrol is "Stimrol" on #openttd
16:55<andythenorth>supermop_home: you just hit the point where ‘programming’ starts ;)
16:55-!-chomwitt [~chomwitt@2a02:587:dc18:1b00:3440:5261:408:cf5a] has joined #openttd
16:55-!-chomwitt is "chomwitt" on #debian-mentors #oolite #openttd #qemu #debian #debian-games
17:05-!-gelignite [~gelignite@x5ce4c0af.dyn.telefonica.de] has quit [Quit: http://bit.ly/1kso8Ta]
17:09<andythenorth>also bedtime
17:09-!-andythenorth [~andytheno@217.33.116.188] has left #openttd []
17:16-!-tux [~mindlesst@2001:19f0:5:238:5400:ff:fe30:7f01] has joined #openttd
17:16-!-tux is "ZNC - http://znc.in" on #virtualization #virt #tuz-oftc #tuz #qemu #osm #openttd #openconnect #observium #linode #ipv6 #OpenRailwayMap
17:17-!-tux is now known as Guest1115
17:21-!-Gja [~Martin@93-167-84-102-static.dk.customer.tdc.net] has quit [Quit: Going offline, see ya! (www.adiirc.com)]
17:23-!-mindlesstux [~mindlesst@45.63.21.168] has quit [Ping timeout: 480 seconds]
17:27-!-Stimrol [~Stimrol@89-160-189-52.du.xdsl.is] has quit [Quit: ZNC - http://znc.in]
17:44-!-Guest1115 is now known as mindlesstux
18:10-!-HerzogDeXtEr [~farci@i59F6BFBD.versanet.de] has quit [Read error: Connection reset by peer]
18:19-!-Wormnest [~Wormnest@s5596abd2.adsl.online.nl] has quit [Quit: Leaving]
18:22-!-urdh [~urdh@00013d7a.user.oftc.net] has quit [Ping timeout: 480 seconds]
18:27-!-keoz [~keikoz@2a01:e35:2fd5:51e0:1037:e61d:fbf:2ba8] has quit [Ping timeout: 480 seconds]
18:30-!-Snail [~jacopocol@cpe-98-14-137-148.nyc.res.rr.com] has joined #openttd
18:30-!-Snail is "Jacopo Coletto" on #openttd
18:35-!-Montana_ [~chatzilla@148.222.94.90.dynamic.jazztel.es] has joined #openttd
18:35-!-Montana_ is "New Now Know How" on #openttd
18:41-!-Progman [~progman@p5DC5F15E.dip0.t-ipconnect.de] has quit [Remote host closed the connection]
18:45<Eddi|zuHause> <andythenorth> FIRS has “market_tree_snow = 1793;" <-- that is technically not a constant, but a "parameter"
18:46<Eddi|zuHause>it uses up one of the (limited) parameter slots
18:46<Eddi|zuHause>and is then action6-ed into the properties
18:47<Eddi|zuHause>(some limitations may apply where action6 cannot be used, but i don't know them)
18:47<Eddi|zuHause>anyway, this shortcoming of nml is one of the reasons why people use preprocessing
19:10<supermop_home>i don't know how to pre-process yet
19:16-!-cosmobird_ [~cosmobird@117.204.29.152] has quit [Ping timeout: 480 seconds]
19:24<supermop_home>if i can figure out how to composite sprites for cargos I should be able to save a lot of lines
19:24<supermop_home>then I could recolor steel rolls to copper, wood crates to white crates, etc
19:42-!-Montana_ [~chatzilla@148.222.94.90.dynamic.jazztel.es] has quit [Ping timeout: 480 seconds]
20:02-!-Montana_ [~chatzilla@148.222.94.90.dynamic.jazztel.es] has joined #openttd
20:02-!-Montana_ is "New Now Know How" on #openttd
20:04<supermop_home>cant find it in the docs tho
20:08<Wolf01>'night
20:08-!-Wolf01 [~wolf01@0001288e.user.oftc.net] has quit [Quit: Once again the world is quick to bury me.]
20:13-!-glx [~glx@000128ec.user.oftc.net] has quit [Quit: Bye]
20:23-!-Arveen2 [~Arveen@pD9FD3E27.dip0.t-ipconnect.de] has joined #openttd
20:23-!-Arveen2 is "realname" on #openttdcoop #openttd
20:27-!-sim-al2 is now known as Guest1122
20:27-!-sim-al2 [~sim-al2@108-221-157-231.lightspeed.mmphtn.sbcglobal.net] has joined #openttd
20:27-!-sim-al2 is "sim-al2" on #openttd @#/r/openttd
20:29-!-Arveen [~Arveen@p5DE767DA.dip0.t-ipconnect.de] has quit [Ping timeout: 480 seconds]
20:30-!-Guest1122 [~sim-al2@108-221-157-231.lightspeed.mmphtn.sbcglobal.net] has quit [Ping timeout: 480 seconds]
20:39-!-chomwitt [~chomwitt@2a02:587:dc18:1b00:3440:5261:408:cf5a] has quit [Ping timeout: 480 seconds]
21:16-!-FLHerne [~flh@cpc4-papw5-2-0-cust175.5-3.cable.virginm.net] has quit [Remote host closed the connection]
22:10-!-DDR [~David@S0106f0f249839863.vc.shawcable.net] has joined #openttd
22:10-!-DDR is "David" on #openttd
22:30-!-cosmobird_ [~cosmobird@117.204.29.152] has joined #openttd
22:30-!-cosmobird_ is "realname" on #communitydata #hot #josm #OpenRailwayMap #openttd #openttdcoop #openttdcoop.wiki #osm #open-maps-more-than-maps #osm-asia #coopetition
23:06<Vadtec>does anyone know which newgrf changes the behavior of industries closing from "poof they are gone" to "it actually takes some time before they poof"
23:06<Vadtec>?
23:56-!-Montana_ [~chatzilla@148.222.94.90.dynamic.jazztel.es] has quit [Quit: ChatZilla 0.9.93 [Firefox 53.0.3/20170518000419]]
23:59-!-Snail [~jacopocol@cpe-98-14-137-148.nyc.res.rr.com] has quit [Quit: Snail]
---Logclosed Mon May 29 00:00:11 2017