IRC logs for #openttd on OFTC at 2015-02-18
⏴ go to previous day
00:39:39 <samu> if (IsTileType(tile, MP_WATER) && (!IsTileOwner(tile, OWNER_WATER) || wc == WATER_CLASS_SEA)) continue;.
00:50:51 <supermop> should i make the bellows joints between tram cars short little vehicles or just draw as part of the main cars? I've done one tram one way, and another the other
05:01:04 *** luaduck_zzz is now known as luaduck
05:28:48 *** Malachite has joined #openttd
05:56:17 *** Eddi|zuHause has joined #openttd
06:51:20 *** Maarten has joined #openttd
07:38:33 *** chillcore has joined #openttd
07:40:22 <chillcore> <Alberth> no idea what to do with the numbers though
07:40:48 <chillcore> albert think of it like shaking a sheet
07:41:01 <chillcore> you take a corner and give it a whip
07:41:25 <chillcore> th first value is the largest
07:41:48 <chillcore> then you take second sheet and whip it again
07:42:09 <chillcore> half the aplitude and the waves ar two times shorter in lenght
07:42:33 <chillcore> thake the third ... rince repeat
07:42:44 <chillcore> I don't think I can explain it easier
07:43:37 <chillcore> that means that you can esily surpress the first three values too ...
07:43:54 <chillcore> then the forth will have way more influence
07:44:06 <chillcore> you gotta be lucky yoo with seed ...
07:48:06 <chillcore> alberth: just like with sheets ... if you shake too hard and the thig shoots off ... somewhere
07:59:30 *** Celestar has joined #openttd
08:43:44 *** Smedles has joined #openttd
09:33:57 *** andythenorth has joined #openttd
09:58:03 *** Klanticus has joined #openttd
10:10:51 *** flipFLOPS has joined #openttd
10:17:59 *** JacobD88 has joined #openttd
10:20:30 *** shadowalkerAFK is now known as shadowalker
10:24:43 *** Quatroking has joined #openttd
10:59:28 *** shadowalker is now known as shadowalkerAFK
11:11:26 *** glevans2 has joined #openttd
11:16:43 *** HerzogDeXtEr has joined #openttd
11:50:41 *** sla_ro|master has joined #openttd
12:32:36 *** Supercheese is now known as Guest5826
12:32:41 *** Supercheese has joined #openttd
12:45:16 *** itsatacoshop247 has quit IRC
12:57:41 <samu> i'm going to do what albert told me
13:37:41 <samu> if (GetWaterClass(tile) != WATER_CLASS_CANAL) {
13:38:06 <samu> what is the difference between WATER_CLASS_CANAL and WATER_CLASS_RIVER
13:39:19 <samu> I've tested with both, and it appears to work either way
13:39:48 <samu> can a tile be both classes at the same time?
13:47:26 <samu> I tried WATER_CLASS_CANAL and WATER_CLASS_RIVER and it works either way when loading and saving
13:48:00 *** tokai|mdlx has joined #openttd
14:07:47 <samu> who can help me understand ?
14:08:56 <planetmaker> the difference is what type of water it is. Differently drawn. Different owners
14:09:25 <planetmaker> however there's no NewGRF which displays the water differently for canals or rivers - even though it's possible to do so
14:15:06 <samu> hmm, let me see if i understand. when the game checks that tile on load, it will only add +1 to water maintenance if the class of that tile is not ...
14:15:55 <samu> for my purpose the logical answer would be RIVER
14:16:14 <samu> but it works with canal as well... strange
14:17:55 <samu> if the lock is built on bare land, does it become canal?
14:18:58 <samu> let me look at the opposite way
14:21:28 <samu> when the game checks that tile, i want it to decide if it adds +1 to water maintenance or not, based upon where it was built
14:21:55 <samu> if built on a river, don't add +1
14:22:03 <samu> if built on bare land, add +1
14:22:29 <samu> this is what I believe to be the possible outcomes of that check
14:22:35 *** JacobD88 has joined #openttd
14:30:12 <samu> something is flawed here
14:30:26 <samu> either my undertanding or...
14:32:09 <samu> i'm leaving it as WATER_CLASS_RIVER
14:52:29 *** tokai|noir has joined #openttd
14:52:29 *** ChanServ sets mode: +v tokai|noir
15:46:03 *** andythenorth has joined #openttd
15:51:14 *** Celestar has joined #openttd
15:52:04 *** Myhorta has joined #openttd
15:58:08 *** quorzom has joined #openttd
16:10:04 *** Progman has joined #openttd
16:12:57 *** Alberth has joined #openttd
16:12:57 *** ChanServ sets mode: +o Alberth
16:22:37 *** FLHerne has joined #openttd
16:37:13 <samu> can you check out if they're clear enough to understand?
16:38:19 <Alberth> 73-75 can be merged together onto one line
16:40:18 <Alberth> In general, comment like x = 1; // Give x the value 1 is useless, people can read code
16:40:18 <Alberth> You should not repeat what the code says, but instead *why* you do what you do (ie why is the code there, what case does it handle?)
16:41:23 <Alberth> // extra count. <-- that does not clarify anything for me
16:42:08 <samu> it's a maintenance counting
16:42:45 <Alberth> Well, I can see you do counting, I want to know why it's there
16:43:06 <Alberth> line 93 is an example of comment explaining why some code isn't there
16:43:54 <Alberth> return cost; // final cost for this command <-- you can safely delete this comment :)
16:43:59 <samu> I don't know what to write at that part
16:44:10 <samu> at the last part, line 93 below
16:44:56 <Alberth> line 64 seems good comment, except you probably better merge it with the comment at line 63
16:45:23 <Alberth> Also, comment is English sentences, start with an upper case letter, and end with a dot
16:45:23 *** andythenorth has joined #openttd
16:46:15 <Alberth> 54 dependable variable I have no idea what that means
16:47:18 <samu> it's going to add a cost based on a check
16:48:15 <Alberth> it doesn't need comment imho
16:48:37 <Alberth> if code is clear already, no need to add comments
16:48:40 <samu> hmm in the original code that line didn't exist
16:48:52 <samu> or, well it existed at the bottom
16:49:27 <Alberth> afaik we have a 'cost' variable all over the code
16:49:58 <Alberth> line 32, shouldn't it be just above line 37 ?
16:50:37 <Alberth> empty line between 11 and 12 ?
16:51:20 <samu> hmm looks like i'm a terrible commenter
16:52:09 <samu> i added those comments in relation to a previous version
16:52:11 <Alberth> 84/85 can also be removed
16:52:40 <Alberth> no, you need to get used to commenting
16:53:07 <Alberth> most people that are not so experienced write comments just like you
16:54:00 <Alberth> the thing to keep in mind is that another coder should be able to understand what you wrote
16:54:35 <Alberth> preferably try to write code good enough such that you don't need comment
16:55:45 <Alberth> if some code is complicated, write down the piece of information that the coder should know about
16:56:21 <Alberth> the code tells already what exactly is done, so tell why you do it at that point instead
16:57:29 <Terkhen> reading this conversation gave me a strong feeling of deja vu :P
16:59:37 <Terkhen> andythenorth: hi, I mostly lurk nowadays
16:59:54 <andythenorth> it is mostly V453000 and andythenorth doing monologues these days
17:00:05 <andythenorth> nobody actually talks about anything
17:02:09 <andythenorth> when I first joined this channel, someone said same to me
17:02:15 <andythenorth> only with different names
17:02:18 <Terkhen> it does not sound that different from what I remember, yep
17:11:10 *** TheMask96 has joined #openttd
17:11:40 *** frosch123 has joined #openttd
17:12:21 * andythenorth has nearly placated pyflakes for Road Hog
17:12:32 <andythenorth> and hopefully a python 3 compile also
17:13:39 <andythenorth> Road Hog currently compiles quite fast
17:13:46 <andythenorth> 10s or so, with no fancy tricks
17:27:41 <planetmaker> andythenorth, devzone has both pythons, py2 and py3. You don't need to switch explicitly. But the binary name of py3 is python3 (as usual and recommended by python devs)
17:27:48 <planetmaker> and python2 is aliased to python
17:28:15 <planetmaker> andythenorth, and if you got an executable python script you need to adjust the shebang, of course
17:28:58 <andythenorth> let’s see if I can just call python3 from the makefile
17:30:06 <planetmaker> heffer, blathijs, Ammler there's a new nml version out which will need packaging for the soon-to-be-released OpenGFX. If you want any changes to OpenGFX, can you please tell me which in a timely manner (preferably with patch :D ), please?
17:30:06 *** oskari89 has joined #openttd
17:30:16 <heffer> planetmaker: will do. thanks
17:30:41 <heffer> i hope that I can spend some time on this tonight
17:31:28 <planetmaker> heffer, the new nml will need some work from you, for sure. It's based on py3 instead of py2 and has an - albeit optional - cython module
17:32:15 <samu> i don't know what to do about 'extra counts'
17:39:44 <samu> here it is another go at it
17:45:38 <DorpsGek> Commit by translators :: r27154 /trunk/src/lang (indonesian.txt korean.txt) (2015-02-18 17:45:30 UTC)
17:45:39 <DorpsGek> -Update from WebTranslator v3.0:
17:45:40 <DorpsGek> indonesian - 9 changes by UseYourIllusion
17:45:41 <DorpsGek> korean - 4 changes by telk5093
17:54:30 <samu> I had some questions about that load part
17:56:57 <samu> what is better correct? WATER_CLASS_RIVER or WATER_CLASS_CANAL when counting
17:57:16 <samu> either works, but I don't get why
17:58:50 <Alberth> you tried asking what it is?
18:24:18 <Pulec> what faster multiplayer games are mostly played?
18:24:40 <Pulec> some goals like reach $100 000 comapny value
18:25:32 <planetmaker> I would think the most popular MP games are citybuilders. Or maybe those with transport goals like BusyBee or SiliconValley
18:26:11 <andythenorth> I think a game script with short goals like company value would be welcome
18:26:14 <andythenorth> but none exists yet
18:26:37 <andythenorth> it’s probably a relatively simple script
18:27:44 <Alberth> not sure you can get it exactly right, you probably have to poll company values
18:30:41 <andythenorth> first one to exceed £x ?
18:33:17 <Alberth> most money above X at end of month seems doable
18:34:35 <Pulec> andythenorth, what kinds of scripts are you talking about? are there any examples?
18:35:16 <andythenorth> can’t remember which :P
18:36:08 <Alberth> have a look at the online content
18:46:29 <samu> that is for counting as canal
18:46:31 <Pulec> i mean its cool that new graph language looks pythonic
18:47:19 <samu> it counts +1 to water maintenance if the middle part of lock is built on bare land
18:48:53 *** gelignite has joined #openttd
18:49:53 <samu> if it finds that it was built on a river, don't add +1
18:50:19 <Alberth> Pulec: oh, right, yes, somewhat if you ignore the { and } :)
18:51:00 <samu> the question is, why does it also work if it checks against WATER_CLASS_CANAL
18:51:25 <Pulec> i can live with that, it could be much worse
18:51:49 <Pulec> I doubt I will be writing anything soon anyway
18:52:10 <Pulec> what community is making, new graphics, trains, cars?
18:53:57 <andythenorth> some are elsewhere
18:54:00 <andythenorth> the other places
18:54:34 <samu> could I get some help, I'd like to get past this
18:54:42 <samu> want to head into my next step
18:57:32 <samu> WATER_CLASS_RIVER - replacing that to WATER_CLASS_CANAL also works, but I don't understand why, it confuses me why it works
18:58:24 <samu> it feels like I'm doing something wrong
18:58:57 <Pulec> what does this code supposed to do?
18:59:19 <Alberth> there are usually lots of values that are not some other value
18:59:24 <samu> when loading a save game it will start counting all maintenance pieces of water
18:59:35 <glx> samu: because it has no class if it was not water
19:03:00 <samu> please explain me better
19:05:53 <samu> how could the game "guess" that canal was also river
19:09:50 *** Malachite has joined #openttd
19:18:35 <Alberth> samu: != means testing *not* equal
19:19:53 <Alberth> Pulec: that's not new the simcity people also had that idea, but the other way around, and with their own game :)
19:25:58 <samu> I still don't undestand. I'm sorry, I'm really sorry
19:26:55 <samu> I'm bothering you too much over this
19:27:24 <Alberth> say I have a number 5
19:27:39 <Alberth> how many numbers are equal to 5?
19:27:49 <Alberth> how many numbers are not equal to 5 ?
19:28:13 <Alberth> for simplicity, let's say between 1 and 9
19:28:48 <Alberth> yeah, something like that
19:28:51 *** oskari89 has joined #openttd
19:29:07 <Alberth> so now you have some mystery number X
19:29:46 <Alberth> how is it weird that X is not equal to 2 numbers WATER_CLASS_RIVER and WATER_CLASS_CANAL ?
19:30:38 <Alberth> there are lots of numbers not equal to some other number
19:30:45 <Alberth> and only one that is equal
19:46:53 <glx> lock middle tile class can be canal (if it was clear before building) or river (if it was river before building)
19:47:43 *** oskari89 has joined #openttd
19:47:54 <glx> well river or whatever as in the case of an already water tile it keeps de class when building the lock
19:52:12 <samu> when X is built on clear land, it is canal?
19:52:24 <samu> when X is built on river, it is river?
19:53:26 <samu> supposing X is built on clear land, it's canal testing against not canal
19:54:02 <samu> X is built on river, it's river testing against not canal
19:54:30 <samu> X is built on clear land, it's canal testing against not river
19:54:42 <samu> X is built on river, it's river testing against not river
19:56:10 <samu> 1 - false, so it adds +1
19:56:11 <glx> maybe it's the way you test it, if you have 2 locks with 1 on river and 1 on land, the total will be the same
19:57:48 <samu> ok makes sense now, damn, this was not obvious for me
19:59:12 <glx> with only 1 lock you'll see a difference if you change the line :)
20:02:56 <samu> change the line, what do you mean
20:04:04 <samu> ok let me testin in game
20:06:30 <glx> [19:57:37] <samu> WATER_CLASS_RIVER - replacing that to WATER_CLASS_CANAL also works, but I don't understand why, it confuses me why it works <-- and test loading with only 1 lock
20:12:57 <glx> so using WATER_CLASS_RIVER was correct, and should not be changed ;)
20:13:35 <samu> how the hell did i screw my testings
20:13:41 <glx> or if you wan't to change you need to also replace != with ==
20:15:15 <samu> but it was boggling my mind
20:15:39 <samu> so i changed to river to see if it would make a difference, and it didn't
20:15:57 <samu> that save game was not a good idea
20:16:31 <samu> now i started fresh new games, test 1 lock at a time
20:17:57 <samu> what was wrong was my testing procedure
20:19:30 <samu> it lead to all this confusion
20:19:46 *** shirish has joined #openttd
20:23:37 *** Myhorta has joined #openttd
20:27:14 *** luaduck is now known as luaduck_zzz
20:29:13 <samu> lines 94 and 100 might be wrong
20:31:56 <andythenorth> samu is teddy bear coding :)
20:32:38 <andythenorth> but to irc, not a bear
20:32:43 * andythenorth does same, with mixed results
20:33:01 <glx> yeah teddy bear never answers
20:33:25 <andythenorth> half the time I don’t need any answers
20:33:35 <andythenorth> usually I realise my own stupid mistake after asking the question
20:33:41 <andythenorth> and then rush to cover my tracks :P
20:35:30 <samu> must merge a company 1 lock at a time
20:36:12 <SpComb> it's rubber ducks, not teddy bears
20:37:06 *** l4urenz has joined #openttd
20:38:45 <samu> i must bankrupt with trains
20:40:17 <samu> bankrupting with buses is better
20:40:55 * andythenorth lost in the c2 wiki again :P
20:42:55 <andythenorth> it’s a proper maze of links
20:43:02 <andythenorth> I can get lost in their for hours
20:44:13 <SpComb> like tvtropes, but more IT?
20:45:06 <NGC3982> Wait, -that- is rubberducking?
20:46:13 <SpComb> the link is right there
20:55:20 <Wolf01> also called teddy bear programming if you have that instead of a rubber duck
20:56:27 <Wolf01> instead I have a nice amount of lego minifigs sit under my display :P
20:58:07 *** HerzogDeXtEr1 has joined #openttd
20:58:27 <b_jonas> different from _duck typing_
20:59:05 <samu> lines 94 and 100 are correct after all
21:06:47 <samu> is it supposed to display estimated costs during scenario editing?
21:23:08 <samu> tests complete, everything is correct
21:24:24 <samu> hopefully I tested this the right way
21:26:54 <samu> if placing canals on rivers costs money, then placing a lock on river must also cost money for the upper tile and lower tiles
21:27:17 <samu> exception is when upper tile and lower tile are already canals
21:29:54 <blathijs> planetmaker: Thanks for the headsup
21:32:32 *** andythenorth has left #openttd
21:35:09 <Eddi|zuHause> samu: you might be better off removing all this tile special casing, and treating all the tiles the same
21:38:13 <samu> can't treat them all equal
21:38:49 <samu> neutral or bankrupted canal tiles
21:39:51 <samu> or are you refering something different than this?
21:43:16 *** JacobD88 has joined #openttd
21:45:43 <samu> imagine building a canal on this setup: upper tile is canal and owner is none + middle tile is bare land + lower tile is canal and ower is self
21:46:33 <samu> for upper tile, add a 0 cost, add no maintenance cost
21:47:44 <samu> for middle tile, add the lock structure price which is 7500, and 6 maintenance costs + 1 because it's not built on a river tile, so 7
21:48:09 <samu> for lower tile, add a 0 cost again, add no maintenance cost
21:48:45 <samu> for middle tile also add that fake cost i created which is 5000
21:49:36 <samu> this example looks terrible
21:50:57 <samu> 2nd example, upper tile is canal and owner is none + middle tile is bare land + lower tile is bare land
21:50:59 <Wolf01> and if you consider the lock just the sloped tile and left the upper and the lower tiles untouched?
21:51:47 <samu> lower tile in this case is bare land, when building the lower tile, it costs 5000 + 1 maintenance
21:51:52 *** ChanServ sets mode: +v tokai
21:53:24 <samu> i have to touch because when building a canal on a river, it costs something, 5000
21:53:55 <samu> if upper tile is river, add the cost 5000, but 0 maintenance
21:54:47 <samu> building canal on a river is currently costing 1 maintenance, i intend to change that at a later point
21:55:06 <samu> should cost 5000, but 0 maintenance
21:55:17 <samu> but right now i'm editing the lock
21:57:37 <samu> ... and moving forward... removing a canal that was built on a river, reverts back to river
21:58:17 <samu> I can't do all this at once, I don't have the necessary skills to do all that at once
21:58:40 <Eddi|zuHause> samu: i mean you execute the same piece of code for all 3 tiles (check whether is already canal, add canal build cost, add canal maintenance cost, ...)
22:00:14 <Eddi|zuHause> samu: look at "tile loops"
22:01:42 <samu> i've seen a tile loop for when building canal pieces
22:01:48 <samu> and I couldn't figure it out
22:02:06 <Wolf01> when I was a noob and had to learn (not that I'm better now, OTTD is changed a lot and I might have to learn again), I looked for the code which worked like the feature I wanted to add, copied it, changed it and made the feature :D
22:02:40 <Eddi|zuHause> samu: tile loops are special for loops
22:05:32 <samu> ah, tile area loop, not the same thing
22:07:17 <samu> TileLoop_Water (TileIndex)
22:07:33 <samu> TileLoop_Water (TileIndex)
22:07:35 <heffer> means i need to touch the URL in my RPM spec file every time the revision or commit changes (i.e. every release)
22:08:12 <Eddi|zuHause> samu: that is a special tile loop that covers the whole map in a regular interval
22:08:16 <heffer> just noticed that i already added a variable to my spec file called "version_foo"
22:08:31 <Eddi|zuHause> samu: you don't need that. you need a tile loop that covers a small area
22:09:31 *** ChanServ sets mode: +v tokai
22:10:09 *** luaduck_zzz is now known as luaduck
22:10:24 <Eddi|zuHause> heffer: you probably complained about the exact same thing last time :p
22:10:31 <samu> TILE_AREA_LOOP(tile, ta)
22:10:39 <heffer> Eddi|zuHause: pretty sure about that actually :D
22:11:29 <planetmaker> but complain especially about building opengfx development branch. I haven't released that yet :)
22:11:44 <samu> there is a TILE_AREA_LOOP in this part: CommandCost CmdBuildCanal(TileIndex tile, DoCommandFlag flags, uint32 p1, uint32 p2, const char *text) {
22:12:00 <samu> can't understand the heck of it
22:12:19 <planetmaker> anyway, please keep it coming that feedback... it's not pointless :)
22:12:30 * planetmaker -> bed now, though. Good night. But I'll read back
22:12:30 <samu> for (TileIndex tile = 0; tile < MapSize(); tile++)
22:19:13 <heffer> also make or python3 setup.py build gives me -> from nml import version_info \n ImportError: cannot import name 'version_info'
22:20:11 *** luaduck is now known as luaduck_zzz
22:21:12 <glx> samu: that loops over the whole map
22:24:54 <samu> tile - delta < tile + delta
22:25:50 <samu> is there an example in water_cmd.cpp file?
22:27:41 <planetmaker> hm, that's bad, heffer :)
22:27:47 <Wolf01> samu: try to understand the basic concepts, a "loop" statement uses a for, a while, or even recursion, a conditional statement does not loop, nor does a switch
22:28:06 <planetmaker> it works perfectly when building from the repository
22:28:18 <planetmaker> but not from... what I put on bundles server it seems
22:28:43 <Eddi|zuHause> planetmaker: wrong handling of the case when hg is not present?
22:30:10 <heffer> almost all of the files in ./nml/ are missing
22:32:18 *** tobias_ has joined #openttd
22:33:04 <samu> for (TileIndex tile = (tile - delta); (tile + delta); tile++) {
22:33:20 <planetmaker> when did it get that broken? :S
22:33:33 <l4urenz> so this is more dev chat then any other subject
22:34:05 <samu> for (TileIndex tile = (tile - delta); (tile + delta); tile + delta) { ?
22:34:09 <heffer> l4urenz: sometimes yes, sometimes no
22:34:13 <planetmaker> l4urenz, this is general openttd channel
22:34:25 <l4urenz> planetmaker, I was told yesterday
22:34:31 <Eddi|zuHause> l4urenz: usually it's more other topics than anything else :p
22:34:33 <l4urenz> but been lurking since then... mostly dev :)
22:34:50 <Eddi|zuHause> l4urenz: but there are episodes of dev talk occasionally
22:35:03 *** tobias_ has joined #openttd
22:35:17 <Wolf01> samu: yes, those look like loops, too bad that without context is difficult to tell what they are useful for
22:35:32 <Eddi|zuHause> l4urenz: if by other subjects you mean playing the game. no, that barely ever happens :p
22:35:35 <planetmaker> l4urenz, it is not talk about specific servers usually - as they all have their own channels
22:35:57 <l4urenz> ahaa, i still play offline or with friends locally
22:35:59 <planetmaker> however anything openttd is on-topic here
22:36:14 <l4urenz> trying to read up on stuff how to act/play in a server
22:36:22 <l4urenz> since most of them follow certain rules
22:36:52 <l4urenz> then again, my own rule is not to play openttd during the week because i seem to forget time
22:36:56 *** smoke_fumus has joined #openttd
22:37:07 <l4urenz> which will result in only a few hours of sleep before work..
22:38:19 <heffer> planetmaker: can confirm that nml builds OK from hg
22:39:13 <samu> ah, so what you're telling me is to re-write this whole block static CommandCost DoBuildLock(TileIndex tile, DiagDirection dir, DoCommandFlag flags)
22:39:50 <samu> gee, I'm so gonna break the game
22:41:09 <Wolf01> usually breaking the game and learn how to fix it is a good start point
22:42:36 <samu> better not start doing it today
22:42:49 <samu> will take hours, and I don't have time
22:47:33 *** itsatacoshop247 has joined #openttd
22:52:05 *** Maarten1 has joined #openttd
23:11:51 *** KWKdesign has joined #openttd
23:26:50 *** l4urenz has joined #openttd
23:39:50 *** CosmicRay has joined #openttd
continue to next day ⏵