Back to Home / #openttd / 2015 / 02 / Prev Day | Next Day
#openttd IRC Logs for 2015-02-16

---Logopened Mon Feb 16 00:00:15 2015
00:19-!-itsatacoshop247_ [] has joined #openttd
00:21-!-itsatacoshop247 [] has quit [Ping timeout: 480 seconds]
00:41-!-FLHerne [] has quit [Ping timeout: 480 seconds]
00:53-!-luaduck_zzz is now known as luaduck
00:56-!-Eddi|zuHause [] has quit []
00:56-!-Eddi|zuHause [] has joined #openttd
01:40-!-Flygon_ [] has joined #openttd
01:43-!-Flygon [] has joined #openttd
01:47-!-Flygon__ [] has quit [Ping timeout: 480 seconds]
01:49-!-Flygon__ [] has joined #openttd
01:49-!-Flygon_ [] has quit [Ping timeout: 480 seconds]
01:51-!-Flygon [] has quit [Ping timeout: 480 seconds]
02:03-!-smoke_fumus|2 [~smoke_fum@] has quit [Read error: Connection reset by peer]
02:06-!-stormchaser3000 [~quassel@] has joined #openttd
02:06<stormchaser3000>i seem to have an issue.
02:06<stormchaser3000>i can't get music to play
02:25-!-jinks_ [~jinks@] has quit [Ping timeout: 480 seconds]
02:26-!-jinks_ [~jinks@] has joined #openttd
02:30-!-andythenorth [] has joined #openttd
02:35<andythenorth>so python object hashes aren’t a reliable reference where a multiprocessing pool is in use
02:35<andythenorth>which I guess makes sense
02:35<andythenorth>multiple pool threads could change state on an object, and return it or references to it, leaving your program...borked
02:36*andythenorth back to work
02:56<V453000>what sort of evil magic are you doing again andythenorth
02:56<andythenorth>fixing the old magic
02:56<andythenorth>the problem with magic is when it breaks
03:00-!-stormchaser3000 [~quassel@] has left #openttd [ - Chat comfortably. Anywhere.]
03:38-!-Alberth [~alberth@2001:981:c6c5:1:be5f:f4ff:feac:e11] has joined #openttd
03:38-!-mode/#openttd [+o Alberth] by ChanServ
03:54<andythenorth>moin Alberth
04:11-!-kais58|AFK is now known as kais58
05:22-!-andythenorth [] has quit [Quit: andythenorth]
05:34-!-Suicyder [~Suicyder@] has joined #openttd
05:34-!-Suicyder [~Suicyder@] has quit []
05:48-!-Yotson [~Yotson@2001:980:6ac8:1:689f:8cd4:410f:9c71] has joined #openttd
06:09-!-andythenorth [] has joined #openttd
06:20-!-Sylf [] has quit [Remote host closed the connection]
06:20-!-Sylf [] has joined #openttd
06:23-!-Alberth [~alberth@2001:981:c6c5:1:be5f:f4ff:feac:e11] has left #openttd []
06:39-!-andythenorth [] has left #openttd []
06:43-!-zwamkat [] has joined #openttd
06:45-!-zwamkat [] has quit [Remote host closed the connection]
06:53-!-zwamkat [] has joined #openttd
06:58-!-itsatacoshop247_ [] has quit [Ping timeout: 480 seconds]
06:59<supermop>whats up?
07:02<V453000>trying to import some meshes with the hyper intelligent VrayProxy, but I am getting more issues than anything else so far XD
07:03<V453000>also moar progress on bridgez has been done :>
07:04<supermop>i just struggled with renderer today, then rendered a bunch, then realized it was wrong and needs to be re-rendered
07:04<supermop>and not sure how to do CC
07:04<V453000>standard :P
07:05<V453000>color correction?
07:05<V453000>ah company colours
07:05<V453000>yeah ... I use some approach where I wreck the tones to 8 colours, from separate masked render
07:05<V453000>you can read it in the NUTS technical wiki
07:06<supermop>the other option is the pikka way of separate sprites, but i feel that would be weird
07:07-!-zwamkat [] has quit [Remote host closed the connection]
07:07-!-zwamkat [] has joined #openttd
07:08<supermop>ok off to bed soon
07:09<V453000>yeah well, separate sprites will look nicer.
07:09<V453000>the 8bpp is just shit
07:09<V453000>I havent managed to get that to look nice
07:09<V453000>but separate sprites = filesize x16 which is just fucked up
07:10<supermop>i wonder if you limit it to just a small area or stripe...
07:10<V453000>that is what I will try as well
07:10<V453000>not making full-CC vehicles, just making smaller parts
07:10<V453000>Also, very detailed/heavily textured etc. stuff looks a bit nicer
07:10<V453000>but anything "normal" just gets wrecked because 8 colour shades are just not enough for this resolution :)
07:12<V453000>... the only problem with smaller parts I had so far was that my mask had some bad edge offset but I believe I can get rid of that eventually
07:12<V453000>I recommend setting up some automated rendering so that you dont get insane
07:12<V453000>rendering every model 3 times just because normal / CC1 / CC2 is tedious to be done manually :)
07:16<supermop>rhino is supposedly very scriptable
07:16<supermop>thing is... i want eventually to do these guys:
07:17<supermop>but with the green triables as CC, so one can choose blue and get blue triangles as various shades
07:17<supermop>only doable with sprites i guess
07:18<supermop>like these blue triangles:
07:19<supermop>ok bed time
07:19<supermop>do you use google drive?
07:19<juzza1>why cant that be done with recolor map?
07:20<juzza1>it's just one color
07:20<V453000>nah I use dropbox for files :)
07:20<V453000>and as juzza1 says
07:20<V453000>recolour map ftw
07:20<V453000>but yeah, the 8bpp map is just ... idk, havent managed to get good results with it
07:21<supermop>the greens are different hues though?
07:22<supermop>ok im going to bed
07:22<V453000>eh hues, just slight
07:22<V453000>different brightness will handle that
07:22<V453000>well enough anyway
07:23<juzza1>i actually meant the 8bpp map that does the recoloring automatically
07:26<juzza1>supermop: the color intensities are taken from the base image, the 8bpp mask only sets the "function" for that are (cc in this case, could also be blinking lights etc.) it's difficult to explain without testing it yourself
07:28-!-andythenorth [] has joined #openttd
07:28*andythenorth wonders if list.extend(other_list) changes order of other_list
07:30-!-supermop [] has quit [Ping timeout: 480 seconds]
07:31-!-andythenorth [] has quit []
07:32-!-Supercheese is now known as Guest5615
07:32-!-Supercheese [] has joined #openttd
07:37-!-Guest5615 [] has quit [Ping timeout: 480 seconds]
07:49-!-andythenorth [] has joined #openttd
07:50-!-glevans2 [] has quit [Ping timeout: 480 seconds]
07:51-!-glevans2 [] has joined #openttd
08:14-!-Alberth [~alberth@2001:981:c6c5:1:be5f:f4ff:feac:e11] has joined #openttd
08:14-!-mode/#openttd [+o Alberth] by ChanServ
08:18-!-sla_ro|master [slamaster@] has joined #openttd
08:27-!-tokai|mdlx [] has joined #openttd
08:31-!-samu [] has joined #openttd
08:33-!-tokai|noir [] has quit [Ping timeout: 480 seconds]
08:42*andythenorth victory
08:43<samu>where was I
08:44<samu>WaterClass wc_middle = IsWaterTile(tile) ? GetWaterClass(tile) : WATER_CLASS_CANAL;
08:44-!-shadowalker [] has joined #openttd
08:44<samu>what does this line do?
08:45-!-FLHerne [] has joined #openttd
08:46<Eddi|zuHause>it keeps the water class if it is already water, and sets it to canal if not
08:47<andythenorth>Iron Horse is more sane, and compiles marginally faster
08:48<samu>strange, it work for the upper tile and lower tile, and not for the middle tile
08:48<samu>and the code is similar
08:49<Eddi|zuHause>it really is missing the important bit :p
08:50<Eddi|zuHause>which is the next line after that.
08:52<samu>this? > if (!IsWaterTile(tile) {
08:54<samu>if (!IsWaterTile(tile)) {
08:54<samu>let me write in that pastebin
08:55-!-shadowalker is now known as shadowalkerLeShAFK
08:58<samu>mission successful?
09:00-!-shadowalkerLeShAFK is now known as shadowalker
09:02<samu>how do i test this now?
09:04<Eddi|zuHause>you compile it
09:04<Eddi|zuHause>there's a "compile and run" button in visual studio
09:04<samu>i could only build the .exe once
09:04<samu>it failed on the next tries
09:04<Eddi|zuHause>then fix that
09:04<samu>gonna try
09:17<samu>is the work folder C:\OpenTTD or just OpenTTD?
09:18<Eddi|zuHause>the "work folder" structure is explained in the readme
09:25<samu>what readme
09:27<samu>i write (WorkFolder)\OpenTTD essentials\win32\library;
09:28<samu>or C:\OpenTTD\OpenTTD essentials\win32\library;
09:30<samu>doesn't work
09:30<samu>Error 40 error LNK2026: module unsafe for SAFESEH image. C:\OpenTTD\trunk\projects\liblzma.lib(liblzma_la-sparc.o) openttd
09:30<samu>many of these errors
09:33<samu>Warning 1 warning C4005: 'FACILITY_DIRECTMUSIC' : macro redefinition (..\src\music\dmusic.cpp) c:\openttd\openttd essentials\shared\include\dmerror.h 12 1 openttd
09:33<ST2>I've stumbled with them too, see this:
09:33<ST2>maybe not the correct solution but worked for me ;)
09:34<@planetmaker>ST2, it'll probably be helpful to amend our wiki with the compile instructions
09:34<@planetmaker>that's where people look (and find much quicker) rather than in a "random" forum thread
09:34<samu>safeseh? what does it mean
09:35-!-andythenorth [] has quit [Quit: andythenorth]
09:35<ST2>that's a good idea indeed, will look what can do when I get home :)
09:36<ST2>anyway, I wasn't sure was a correct solution, was only one that worked for me xD
09:36<samu>it is already in the wiki
09:36<samu>i just didn't read all of it lol
09:37<samu>your visual studio is much less graphical
09:37<@planetmaker>ST2, the wiki lives from contributions like yours. It works... so it can't be entirely wrong. And a wiki has history and can be amended and corrected also easier than a forum thread
09:38<ST2>and I agree with you :)
09:38<samu>mine is all windows 8 styling, though I'm on windows 7
09:39<@planetmaker>(and no, I cannot contribute to the 'how does it work on windows' discussion more than this... last time I compiled on windows is ages ago)
09:39<@planetmaker>and I used mingw :P
09:41<samu>the wiki terminology differs a bit than my version
09:42<samu>project properties is solution properties
09:42<samu>compile is build
09:43<@planetmaker>that's probably different MSVC versions... thus your version might want a separate thing. But dunno... I won't use MSVC soonish
09:48<samu>compiling is fast, i thought it would take hours
09:50<@Alberth>incremental builds are fast
09:50<@Alberth>it only rebuilds things that are modified
09:50<samu>build succeeded... well, what now?
09:50<samu>just that?
09:50<@Alberth>run and test?
09:51<samu>so it builds, but where is it?
09:51-!-roidal [] has joined #openttd
09:52<samu>so confused...
09:53<samu>4> openttd_vs100.vcxproj -> C:\OpenTTD\trunk\projects\..\objs\Win32\Release\openttd.exe
09:53<samu>there is no Release folder
09:54<Eddi|zuHause>just click the "run" button
09:55<samu>nevermind, i'm an idiot, yes just clicked that
09:55<samu>OpenTTD r27153M
09:55<samu>it launched
09:56-!-andythenorth [] has joined #openttd
09:58<samu>lol im such an idiot, I didn't edit the water_cmd file
10:00*andythenorth used set.difference() correctly today
10:00<andythenorth>first time for everything
10:01<@Alberth>oh, I promised pixa fixing, that's still needed?
10:02<andythenorth>very much :)
10:02<@Alberth>hmm, my copy claims no incoming changes :p
10:02<andythenorth>none yet
10:03<andythenorth>there’s no test program in pixa, so it’s frustrating to test the module directly
10:03<andythenorth>I have been testing with Iron Horse
10:06<Eddi|zuHause>maybe try with cets? scripts/ is somewhat standalone, if you have the right input file (that comes out of scripts/
10:07<samu>yay it works!
10:08<samu>glad that part only affects the cost and not how it builds
10:08<samu>lock pricing looks *nearly* correct now
10:09<samu>it must add the cost of a canal tile, even though it doesn't build one
10:09<samu>if it is placed on bare land
10:10<samu>is it possible?
10:10-!-quorzom [] has joined #openttd
10:10-!-FLHerne [] has quit [Ping timeout: 480 seconds]
10:11<andythenorth>Eddi|zuHause: that looks useful thanks
10:13<samu>cost.AddCost(_price[PR_BUILD_CANAL]); - i put this a line after cost.AddCost(ret);
10:13<samu>gonna try lol
10:14-!-Belugas [] has quit [Quit: On snow, everyone can follow your traces]
10:18-!-Quatroking [] has joined #openttd
10:19-!-shadowalker is now known as shadowalkerAFK
10:20<samu>yup, this was it
10:20<samu>problem solve!
10:20<samu>however, there is a little issue
10:21<samu>the default lock will now cost 5000 more
10:21<samu>but it's pricing structure is more sensible
10:23<samu>can you look at this:
10:23<samu>that's what I wrote in the file
10:24-!-liq3 [] has quit [Ping timeout: 480 seconds]
10:25<samu>canal tile costs 5000, lock structure costs 7500
10:26<samu>if building on 3 bare land tiles it will now cost 5000+(7500+5000)+5000
10:26<Eddi|zuHause>you could reduce the lock cost to 2500 to keep the old price
10:27<samu>that's on some other file, right?
10:27<samu>must find it
10:27<Eddi|zuHause>yes. there is a base price list somewhere
10:28-!-Myhorta [] has joined #openttd
10:33-!-shadowalkerAFK is now known as shadowalker
10:37-!-LadyHawk [] has quit [Ping timeout: 480 seconds]
10:38<samu>scary bug:
10:38<samu>follow up:
10:40-!-Myhorta [] has quit [Quit: Leaving]
10:40-!-Myhorta [] has joined #openttd
10:42<samu>it reminds me of communism countries that place their leader behind in every local
10:42<samu>leader photos
10:42<samu>my english :(
10:48<@Alberth>andythenorth: ?
10:48-!-Celestar1 [] has left #openttd []
10:48<andythenorth>looks viable
10:48<@Alberth>import * magic was suggested by 2to3
10:49*andythenorth unbreaks iron horse
10:50<@Alberth>it refused to change pixa/, so I made some small improvements
10:50<andythenorth>I can never curl patches from pastebin anymore
10:50<andythenorth>dunno if it’s the line endings
10:51<@Alberth>I always save the raw text
10:51<andythenorth>they come off pastebin with cr instead of lf
10:52<andythenorth>or my browser does that
10:52-!-liq3 [] has joined #openttd
10:53<samu>there is another issue, about the maintenance cost
10:53<andythenorth>so I need a test program :P
10:53<samu>the lock costs 6 pieces of maintenance
10:53<samu>the water tiles cost 1 each
10:53<samu>it's not consistent
10:54<samu>wondering if it makes sense
10:54<samu>it currently costs 8 pieces of maintenance
10:55<samu>but I think it should cost 9
10:55<samu>or 6
10:55<@planetmaker> curl | patch -p1
10:55<@planetmaker> ^^ @ andythenorth
10:55<@planetmaker>mind the "/raw" in the URL
10:56<andythenorth>that fails on cr
10:56<andythenorth>it must be my browser
10:56<@planetmaker>and yes, it comes with (Stripping trailing CRs from patch.)
10:56<@planetmaker> warnings here, too. But patch doesn't mind
10:56*andythenorth would have thought curl was set to lf
10:56-!-Myhorta [] has quit [Ping timeout: 480 seconds]
10:56<@planetmaker>at least my patch doesn't
10:57<@planetmaker>patch unexpectedly ends in middle of line
10:57<@planetmaker> <-- hm, though :P
10:59<Eddi|zuHause>samu: the number of pieces is completely arbitrary, and has nothing to do with how many tiles it occupies
11:00<samu>LOCK_DEPOT_TILE_FACTOR - multiplier for how many regular tiles a lock counts
11:00-!-shadowalker is now known as shadowalkerAFK
11:01<Eddi|zuHause>samu: yes, but you lay a logic beneath it that it does not have.
11:02<samu>i see
11:03-!-liq4 [] has joined #openttd
11:03-!-liq3 is now known as Guest5632
11:03-!-liq4 is now known as liq3
11:03<samu>3*2=6 + 1 per canal
11:04<samu>3*3=9 +1 per canal -> can't be 11
11:04<andythenorth>Alberth: pixa appears to work so far, under python 2 :) I have unrelated problems testing it under python 3 :)
11:04<samu>what can I do now?
11:04<juzza1>Any google spreadsheet wizards here? Can I do something like this:
11:04<juzza1>editing is enabled
11:04<@Alberth>k andy, nice
11:05<Eddi|zuHause>juzza1: i'd guess "indirect()" or something
11:06<@planetmaker>juzza1, I'm not sure what you're asking there
11:06<samu>how do i make it account for this non-existant logic
11:06<samu>have the middle tile behave like it's a canal
11:06<samu>if it wasn't build on river
11:07<@Alberth>add logic?
11:07<samu>just for the maintenance cost
11:09-!-Guest5632 [] has quit [Ping timeout: 480 seconds]
11:10<samu>if (!IsWaterTile(tile)) c->infrastructure.water++;
11:10*andythenorth has an adventure into python3 unicode
11:10<samu>there's a tile - delta and a tile + delta, it is missing the tile
11:10<samu>I think it's that
11:11<@planetmaker>juzza1, maybe what I added below your example lines
11:13<juzza1>planetmaker: thanks, exactly what i was looking for
11:14<samu>gonna try this .
11:15-!-Progman [] has joined #openttd
11:20<samu>ugh, problem
11:20<samu>when demolishing, it doesn't remove
11:20<samu>the added count
11:20<samu>must edit somewhere else too
11:41<andythenorth>debugging multiprocessing is an unabridged joy
11:42<andythenorth>all errors are eaten by some other pickling error when the pool worker tries to write the actual error out
11:43<andythenorth>code works with multprocessing suppressed
11:44<andythenorth>despite that the pool is doing nothing to mutate shared state :|
11:44-!-TheMask96 [] has quit [Ping timeout: 480 seconds]
11:48<andythenorth>other than no ‘go 16x faster’ option, Iron Horse appears to work with python 3
11:49-!-TheMask96 [] has joined #openttd
11:49<andythenorth>Alberth: dunno if you have the python 3 deps, but I’ve pushed it
11:49<andythenorth>make pw=8
11:49<andythenorth>would get invoke multiprocessing
11:50<andythenorth>or 4 or 16 or whatever
11:50<andythenorth>pw=0 will disable it
11:50<andythenorth>interested if you get the same error as me
11:51<andythenorth>I’m worried I’m mutating state somewhere unintentionally
11:51<samu>yay, it works!
11:53-!-liq3 [] has quit []
11:54<andythenorth>or multiprocessing changed
11:55<@Alberth>hmm, it runs hg
11:55<@Alberth>is that in different working copies?
11:56<@Alberth>CF also had problems with that iirc
11:56<andythenorth>not sure :)
11:56<andythenorth>iirc, it generates the revision from it
11:56<andythenorth>pm knows
11:57<@Alberth>Linking nfo
11:57<@Alberth>66.55s pw=8 full build
11:57-!-oskari89 [] has joined #openttd
11:57<andythenorth>no errors?
11:58<@Alberth>make: *** No rule to make target 'docs/license.txt', needed by 'doc'. Stop.
11:58<@Alberth>make: *** Waiting for unfinished jobs.... oh it did have errors
11:58<andythenorth>oh that’s exciting
11:59<samu>how do I make the difference visible?
11:59<@Alberth>dependencies are broken, I use -j4 for make
11:59<samu>want to compare it with the original
11:59<samu>i added line 115
12:01<@Alberth>run a diff against the checked out working copy
12:01<samu>how do i do that
12:02*andythenorth wonders if a try: except: would aid these errors
12:02<@Alberth>andythenorth: haha, nice message :)
12:02<@Alberth>Slow nml rendering? Try the COMPILE_FASTER=True make flag if you're only changing vehicle properties
12:02<andythenorth>sounds like not tip
12:02<andythenorth>also this is the error I’m hoping you’ll see
12:02<andythenorth>1084 is tip
12:03<@Alberth>I have that too
12:03<samu>i have to copy the original into a pastebin?
12:03<@Alberth>pixa is my patched version, did you commit that?
12:03<samu>then revise it
12:03<samu>then diff
12:04<andythenorth>I committed the pixa changes to Iron Horse yes
12:04<@Alberth>samu: you used a version control system to get the sources (hg or svn or so)?
12:04<andythenorth>I haven’t updated the pixa module repo yet
12:04<samu>i was told to download tortoise
12:04<andythenorth>pixa ships inside my project repos, for…reasons
12:04<@Alberth>oh, right, it doesn't use the pixa projects
12:04<samu>tortoisesvn for windows
12:05<@Alberth>samu: that version control system can tell you what you changed exactly
12:05<samu>hmm, how exactly do i do it
12:05<samu>there's too many options
12:05<@Alberth>ie it generates a diff from the last commit to what you have now
12:06<@Alberth>I don't use windows or tortoise stuff
12:06<@Alberth>the command line is just a simple 'svn diff' in the root of the source
12:07<samu>create patch?
12:07<samu>tortoisemerge? I see 2 windows side by side
12:07<samu>working base to the left
12:07<samu>working copy to the right?
12:07<@planetmaker><andythenorth> pixa ships inside my project repos, for…reasons <-- hm, why?
12:08<samu>is this it?
12:08<andythenorth>planetmaker: I don’t know how to put it on pypi, and didn’t go read the docs to find out
12:08<andythenorth>nor do I know how to package it for pip or something
12:08<andythenorth>it is somewhat packaged for setuptools, but I suspect that even is not right
12:09<@planetmaker>hm, so what I do on DevZone is pointless?
12:09<@planetmaker>maybe it is
12:09<andythenorth>what does it do?
12:09<andythenorth>build the package?
12:09<andythenorth>or install in the environment?
12:10<@planetmaker>it has the repo there. And builds maybe *something*.
12:10<andythenorth>do any of us understand setuptools?
12:11-!-luaduck is now known as luaduck_zzz
12:11<@planetmaker>Not that much. But I guess it works for NML. So it can be fiddled to make it work, possibly
12:11<@planetmaker>but indeed I see the last real pixa package is ancient
12:11<@planetmaker>kinda prehistoric :P
12:12<andythenorth>it does very little :)
12:12<@Alberth>only 3 years old :p
12:12<samu>i dont know how to do this
12:12<@planetmaker>well, I guess forgot that I asked :P I'll make a mental note and add that to the tail of my todo list :P
12:12<@Alberth>samu: it's not merge
12:13<andythenorth>I only ship it in the repo to ease building Iron Horse etc for other people
12:13<andythenorth>I could install it to my virtualenvs
12:13<@Alberth>planetmaker: you saw ? cargos are not displayed in the trains
12:13<andythenorth>but if it’s not on pip or easy_install, asking people to download a third party python module and install it is painful
12:14<@planetmaker>andythenorth, I just wondered and remembered that I created some special devzone install rules for pixa. Seems it's about pointless what I did... it's not a proper python package install
12:14<@planetmaker>Alberth, not yet. ty
12:14<@Alberth>ie it's quite terrible broken
12:14<@planetmaker>that's strange. yes, terrible indeed
12:14<@Alberth>32bpp does work, so it's perhaps somewhere in the m4 stuff?
12:15<@planetmaker>I'm sure it hasn't been that way always ;)
12:15<@planetmaker>uh... m4 branch is not main branch, no?
12:15<@Alberth>I don't know tbh, I just casually browsed the history
12:15<@planetmaker>I didn't like the m4 build stuff. Thus it should still be in a separate branch
12:16<samu>i have no idea what i'm doing
12:16<@planetmaker>unless xotic merged it
12:16<samu>created a patch?
12:17*andythenorth wonders if pdf is useful for this multiprocessing problem
12:17<@planetmaker>two heads, two branches, Alberth: hg log -r"head()" --template='{branch}-{rev}:{node|short} {desc}\n'
12:17<andythenorth>I have managed to never learn pdf
12:17<andythenorth>pdb *
12:18<@Alberth>oh, right, I was wondering about the relation of a document format and python code :p
12:18<@planetmaker>hg glog -r694:700 --template="{branch} {rev}:{node|short} {desc}\n"
12:18<@planetmaker>shows it better
12:19<@Alberth>planetmaker: didn't we have trouble with concurrent execution of hg programs in the same repo?
12:20<@planetmaker>hm... I recall that topic. But not at all what it was about
12:20<@Alberth>ah, not merged thus
12:21<@Alberth>yeti or so, I think
12:21<@planetmaker>still not ringing the issue
12:22<@planetmaker>was it about pulling while repo was pushed or so?
12:23<@Alberth>I don't know any more
12:23<@planetmaker>first some food here. bbl
12:24<samu>i still have no idea what I want to look for
12:24<samu>how to create a diff?
12:24<@Alberth>read the manual?
12:25<samu>bah no
12:25<@Alberth>really, it's faster than waiting for someone to asnwer your questions
12:25*andythenorth is trying to read the manual on broken multiprocessing
12:25<andythenorth>debugging a black box :D
12:26<@Alberth>perhaps first see what hg is doing?
12:26<@Alberth>it can't be that useful to do hg queries for each sprite
12:26<andythenorth>it does that? o_O
12:27<@Alberth>I ran top to watch parallel execution, and hg popped up quite often
12:28-!-frosch123 [] has joined #openttd
12:28<samu>when i do right click, tortoiseSVN, diff
12:28<samu>it opens this
12:28<samu>bah let me take a screenshot
12:30<andythenorth>hmm must be the makefile running hg
12:30<andythenorth>I don’t call it
12:30-!-FLHerne [] has joined #openttd
12:30<samu>i right clicked water_cmd.cpp, highlighted tortoiseSVN, then clicked diff
12:30<@Alberth>maybe just query existence or version or so
12:31<samu>what do i do
12:33<samu>i have no idea how to share this diff thing
12:34<andythenorth>multiprocessing has some logger
12:34<andythenorth>but no idea how to use it yet :)
12:34*andythenorth goes back to redneck debugging
12:34<andythenorth>commenting lines in a bisect :P
12:34<andythenorth>until the offender is found
12:39<Eddi|zuHause>samu: "create patch file" sounds appropriate
12:40<andythenorth>that’s interesting
12:40<@planetmaker>Alberth, what do you try to do? I'm somewhat missing the context of your hg parallel execution question
12:40<andythenorth>^ this is the function being passed to
12:40<andythenorth>and it still blows up with a pickling error
12:40<@Alberth>andy has problems with parallel builds, and it uses hg
12:40<@planetmaker>and why do you need to query hg so often (for what)?
12:41<@planetmaker>what do you parallelize?
12:41<@Alberth>bad andy, NEVER use "except:" unless you want hours of debugging fun
12:41<samu>is this all I need to copy?
12:42<andythenorth>Alberth: this is debugging fun :D
12:42<@planetmaker>pythoon? :P
12:42<andythenorth>that isn’t my production code, that’s trying to find out what is erroring
12:42<andythenorth>given that all errors are broken :P
12:42<@Alberth>yeah, errors have that property :p
12:43<@Alberth>perhaps open a file, and append messages to it?
12:43<andythenorth>even this blows up :D
12:43<andythenorth>bad pastebin
12:43<Eddi|zuHause>samu: yes.
12:43<andythenorth>slow pastebin
12:44<samu>i'm such a noob at this
12:44<@Alberth>woow, andy :)
12:45<@Alberth>so the problem is elsewhere
12:45<@planetmaker>samu, the difference between newbie and noob is that a newbie knows how to use help. And has no fear to simply consult the help of the programmes s/he uses
12:46<samu>i faced similar issues in university
12:47<samu>i could do some 'advanced' stuff, then i couldn't figure out how to save it, or load it back
12:47<samu>managed to make that code work
12:47<samu>i think
12:48<samu>not sure if I overlook something
12:49<samu>no idea how it would work when merging companies or bankrupting
12:50<andythenorth>somehow I’ve got a bad object
12:53<andythenorth>I have a list containing EngineConsist and WagonConsist objects, both subclassed from Consist class
12:53<andythenorth>EngineConsist instances work in multiprocessing
12:54<andythenorth>WagonConsist instances don’t
12:54<andythenorth>how interesting
12:57<andythenorth>can’t even pass WagonConsist instances to the mapped function
12:57<andythenorth>maybe they contain something that can’t be pickled
12:58<andythenorth>maybe I can try pickling them
12:58<samu>i think the else block is missing something...
12:58<@planetmaker>Alberth, how do I trigger that hg multiprocessing bug with firs? Or is that not the issue?
12:58<samu>how could I run the game twice?
12:58<@planetmaker>start it twice?
12:59<samu>in visual studio?
12:59<@Alberth>planetmaker: update iron horse, run make pw=8
12:59<@planetmaker>oh, iron horse
12:59<@Alberth>but andy knows
13:00<samu>how would the game know if it is deducting from the rigtht company?
13:01<Eddi|zuHause>"c" is the company
13:01<@planetmaker>samu, now look up the variable type of "c"
13:01<@planetmaker>I only get zillions of sprite level warnings from grfcodec with iron horse. But works fine with pw=6
13:02<samu>what if the company bankrupts?
13:02<@planetmaker>f65e53e666c1 tip
13:02<samu>or is merged
13:03<samu>Company *c = Company::GetIfValid(GetTileOwner(tile));
13:04<samu>i can't run this thing twice, visual studio doesn't let me
13:05<@Alberth>planetmaker: that's the version
13:06-!-glx [] has joined #openttd
13:06-!-mode/#openttd [+v glx] by ChanServ
13:06<Eddi|zuHause>samu: but why do you need to start it twice for that?
13:07<samu>test bankrupting
13:07<samu>test buyout
13:07<samu>just figured how to do it
13:07<samu>ran a 2nd time visual studio
13:07<Eddi|zuHause>samu: you can just switch companies, you know
13:08<Eddi|zuHause>start a multiplayer game, look in the company menu
13:08<andythenorth>pickle.dumps() fails on a WagonConsist instance
13:08*andythenorth loves redneck debugging :)
13:08<andythenorth>it’s so satisfying to get a result with no debugging skills
13:08<@Alberth>takes time, but it always works :)
13:09<andythenorth>now to find out what changed from python 2 :P
13:11<samu>stupid windows firewall
13:11<samu>ok this is gonna work
13:11<samu>bankrupting company 1
13:11<samu>company 2 won't buy 1 yet
13:13<samu>yay is still streaming one of these versions live
13:24<andythenorth>dict_keys is not pickleable
13:24<andythenorth>oh maybe 2to3 has done that
13:25<andythenorth>is not pickleable :o
13:26<andythenorth>is this a sensible replacement? [key for key in cargo_graphics_mappings_normal]
13:27<@Alberth>.keys() is an iterable
13:27<andythenorth>oh so I can just call list on it :)
13:28<andythenorth>that was actually fun to debug
13:28*andythenorth is weird
13:28<Xaroth|Work>.keys and .values (and .items) have changed in behavior between 2 and 3
13:28<@Alberth>I like to do boring refactor things, everybody is a bit crazy :)
13:28<Xaroth|Work>in 2 they all returned lists
13:28<Xaroth|Work>in 3 they all return iterators
13:29<+glx>nice to break legacy :)
13:30<Xaroth|Work>well, they did mention that in their roadmap to py3k
13:30<Xaroth|Work>backwards-mostly-compatible :P
13:34<samu>arf, how long does it take to bankrupt
13:35<@Alberth>users? they never bankrupt
13:35<@Alberth>AIs do bankrupt though
13:36<samu>it's a lan game
13:37<samu>think i better restart and make vehicles losing money
13:37<@planetmaker>samu, one year negative bank balance
13:40<samu>okay thx
13:41<@peter1138> You need Adobe Flash Player to watch this video.
13:41<samu>oh ya
13:41<samu>blame twitch
13:42<samu>if it doesn't work, blame twitch again
13:42<andythenorth>ho, interestingly, the python 3 (nmlc 0.4.0) build of Iron Horse is slower
13:43<andythenorth>by about 16%
13:43<andythenorth>compared to python 2 (nmlc 0.3.x)
13:44<andythenorth>whereas for FIRS python 3 (nmlc 0.4.0) compile is _much_ faster than python 2
13:44<@Alberth>python3 is a bit slower indeed
13:44<andythenorth>very different compilation steps too
13:44<andythenorth>Iron Horse is chameleon -> nml -> nfo -> grfcodec, multiprocessing
13:44<@Alberth>fr0sch did some magic in nml with image processing
13:45<andythenorth>I suspect I’m not getting that caching speed up at all
13:45<andythenorth>and the other slowness will be incidental python 3 slowness
13:45<@Alberth>of course, if you move things to nfo/grfcodec :p
13:48<@planetmaker>16%... interesting :)
13:50<andythenorth>AIUI, nmlc 0.4.x also has parsing improvements?
13:50<@planetmaker>andythenorth, for ogfx-landscape the difference between caching (1 minute) and not caching (45 minutes) is tremendous
13:50<andythenorth>each nml file for Iron Horse is only 1000-2000 LOC
13:50<andythenorth>which is a rough indication that they aren’t very complicated
13:50<andythenorth>only 3-9 vehicles in each file
13:51<frosch123>Alberth: 95% of iron-horse compiliation time is starting python
13:52<@planetmaker>andythenorth, for a clean repo, iron horse fails to build docs/license.txt
13:52<frosch123>andy split the nml into 100 files, each take 1 second startup, and 0.1 seconds processing or so
13:53<@planetmaker>lol. And the other 5% are optimized currently? :P
13:53<@Alberth>planetmaker: running parallel makes? :p
13:53<@planetmaker>Alberth, yes -j6
13:53<@planetmaker>which is my default, leaving me with a core for chatting and a core for video stream :P
13:53<andythenorth>nmlc 0.4.0 is so much faster for FIRS, wondering about ditching this nml -> nfo -> grfcodec business
13:53<@Alberth>makefile doesn't specify the dependencies properly
13:54<@Alberth>/me wonders how many channels you chat at :p
13:54*andythenorth tests the docs
13:55<@planetmaker>I chat usually in about 4. But there's 23 open ones ;)
13:56<@planetmaker>and you know all those 4 important ones ;) well, maybe not coop private one
13:57<@Alberth>hmm, that's how irc has so many lurkers :p
13:57<@planetmaker>yeah :P
13:57<+glx>hehe I have 19 open chans
13:57<+glx>on 4 servers
13:57<@planetmaker>well, besides the openttd channels, the only other 'important' one for me is #mercurial at freenode
13:59<andythenorth>“make clean” followed by “make -j6 pw=16” blows up horribly for me btw
13:59<+glx>because your makefile is broken
13:59<samu>test 1: pass
13:59<@planetmaker>surely also partly my fault :)
13:59<andythenorth>that would be the usual sign + cause :)
13:59<andythenorth>whereas “make pw=16” appears fine
14:00<@planetmaker>jack-of-all-newgrfs makefile is fragile
14:00<andythenorth>the deps aren’t independent, it’s a tree
14:00<samu>test 2: company 2 buys company 1
14:00<andythenorth>dunno which deps chameleon is exploding on though
14:02*andythenorth pushes a fix to the multiprocessing anyway
14:02<andythenorth>who has the most cores?
14:02*andythenorth has 4
14:03<samu>i got a pseudo real octal eight x8 fx-8000 series amd fx-8150
14:04<andythenorth>do you have an Iron Horse checkout though? And nmlc 0.4.x with python 3? o_O
14:05*andythenorth wanted to play pointless speed tests
14:05<samu>i'm pretty sure the answer is no
14:05<samu>no idea what is that
14:06-!-gelignite [] has joined #openttd
14:06<samu>test 2: pass
14:07<samu>test 3: build a lock on bare land
14:07<samu>and bankrupt
14:09<andythenorth>hmm no iron_horse.nml to try compiling with nmlc :P
14:10<samu>where can i download that
14:10<samu>what the heck is a python 3
14:10<@planetmaker>the successor of python2
14:13<samu>i have a feeling it's going to fail in one of the two next tests
14:21-!-Myhorta [] has joined #openttd
14:21<samu>Unhandled exception at 0x0067A933 in openttd.exe: 0xC0000005: Access violation writing location 0x00001240.
14:21<samu>i fail
14:21<samu>so what is this
14:22-!-LadyHawk [] has joined #openttd
14:22<andythenorth>if I do a pure nmlc compile (no nfo), it will probably be faster. On the first run.
14:22<andythenorth>but it won’t be faster for partial compiles :P
14:22<samu>i get a bunch of stuff in visual studio about local
14:24<samu>i'm staring at some error in detail, no idea what this means
14:24<samu>let me screenshot
14:25-!-Myhorta[1] [] has joined #openttd
14:27-!-Diablo-D3 [] has quit [Remote host closed the connection]
14:28-!-Myhorta[1] [] has quit []
14:28<samu>it's exactly the part I edited
14:29<samu>i was destroying a lock with no owner
14:29<samu>apparently the game doesn't know there's no owner
14:29<samu>but was subtracting -1 from water maintenance
14:30<samu>what can i do to prevent that
14:30<samu>that thing there
14:31<samu>is causing the error, how can i improve that
14:31<samu>at line 33
14:32-!-roidal [] has quit [Quit: WeeChat 1.0.1]
14:39-!-Wolf01 [] has joined #openttd
14:39<samu>if (c != NULL) c->infrastructure.water--;
14:39<samu>will that fix it?
14:39<Wolf01>hello o/
14:40<samu>if the lock ower is no one then it means someone owns it?
14:40<samu>who's that someone?
14:40<samu>will the game know it?
14:43<samu>there's a big red stop symbol next to that line in visual studio :) the program is smart
14:44-!-heffer [] has quit [Remote host closed the connection]
14:45-!-heffer [] has joined #openttd
14:54<samu>testing again
15:04<samu>wow it didn't crash
15:04<+glx>samu: if you can reproduce it, post on the bug tracker
15:04<@Alberth>glx: he is writing a patch
15:04<samu>so what i'm doing is a patch?
15:05<+glx>that's another solution (and a better one)
15:05<@Alberth>glx: no, he is enhancing the program, costs are badly balanced(tm) :)
15:05<samu>ok test 3: pass on 2nd try
15:06<samu>test 4: company 1 builds a lock, then merges with company 2. company 2 buys company 1 when bankrupting
15:08<Wolf01>does compiling ottd works on vs2014?
15:09<+glx>it should
15:10<+glx>I think
15:10<samu>I am destroying the program
15:11<samu>alberth doesn't agree with me on something
15:18<samu>bah fail
15:18<samu>doesn't crash, but it's counting wrong
15:19<samu>4,294,967,295 water tiles
15:20<samu>lol property maintenance is giving me money
15:21<samu>something is amiss
15:21<samu>help me
15:21<samu>company 1 builds a lock on 3 bare tiles
15:22<samu>it counts as 9 water tiles in company details
15:22<samu>company 2 buys company 1, it only counts 8
15:22<samu>i destroyed it and it became -1
15:22<samu>or 4,294,967,295 water tiles
15:22<samu>depends where i view it
15:23<@Alberth>if you use the '?' tool, and click at water, do you get the company?
15:23<@Alberth>canal, probably
15:23<samu>ops i closed openttd, must retest
15:23<samu>will check that
15:24-!-LadyHawk [] has quit []
15:26<samu>ok, waiting for bankrupt
15:26<@Alberth>no need, just check if the tile has an owner
15:27<samu>company 1 builds the lock
15:28<samu>yes it's owned by company 1, but company 2 must buy company 1 first
15:28<samu>all the 3 tiles owned by company 1
15:28<+glx>so 1 tile is incorrectly transfered
15:28<samu>the counting is
15:29<+glx>the problem is in the buy part
15:29<+glx>not counting
15:30<+glx>if you have 9 water tiles before being bought, you should have 9 water tiles after, not 8
15:31<samu>yes, that's what I want to do, but it also depends where the lock was built upon
15:31<+glx>something is not modified properly on owner change
15:32<samu>if you can watcch
15:32-!-LadyHawk [] has joined #openttd
15:33<Wolf01>uhm, the wiki say I need the Windows SDK, but I'm sure VS already installed those components
15:33<samu>im buying company 1 with comp 2
15:34<samu>it belongs to company 2, but only counts 8
15:36<+glx>yes but as each tile counts 3 there should be an underlying part which is not transfered even if land info says it's ok
15:36-!-Myhorta [] has quit [Quit: Leaving]
15:37-!-Myhorta [] has joined #openttd
15:38<+glx>a tile can have multiple owners even if only one is shown
15:39<+glx>and in your case one of the owners is wrong
15:39<+glx>don't focus on the counting part but on the property transfer part
15:40<+glx>Wolf01: SDK was required before VS2012 IIRC
15:41<samu>hmm no, each tile doesn't count as 3
15:42<samu>it counts as 2
15:42<+glx>1 lock counts 9
15:42<samu>and the middle tile can count as either 2 or 3
15:42<samu>1 lock counts 6
15:42<samu>but builds 2 extra tiles if there's no water
15:42<samu>becomes 8
15:43<samu>what i done to that was add one more count when it's not placed on water
15:43<samu>becomes 9
15:43<Wolf01>mmh, I think I would take a lot to fix the solution
15:44<+glx>still the problem is in the transfer I think, not the counting
15:44<andythenorth>@seen DanMacK
15:44<@DorpsGek>andythenorth: DanMacK was last seen in #openttd 1 day, 0 hours, 53 minutes, and 22 seconds ago: <DanMacK> Hey
15:45<andythenorth>thought it was about 24 hours :)
15:45<andythenorth>he might turn up
15:45<samu>i created some fake counting logic, according to zuHause
15:46<samu>i dunno how to explain it
15:46<+glx>if it's not consistent it's wrong
15:47<samu>let me copy paste
15:48<Wolf01>I think I'll wait for vs120 support :P
15:50<samu>what i've edited so far
15:50<samu>i must be missing some other place that also needs edit?
15:50<samu>the transfer?
15:51<@Alberth>how many water tiles actually exist for the company that built the lock?
15:51-!-Myhorta [] has quit [Read error: Connection reset by peer]
15:52<+glx>the problem is if (c != NULL) { c->infrastructure.water--; }
15:52<samu>if built on river: 6
15:52<samu>if built on dry tiles: 8 on the original, 9 on mine
15:54<+glx>hmm or not
15:54<+glx>yes the increment on build seems correct
15:55<@Alberth>wouldn't ownership transfer count actual tiles, instead of copying infrastructure.water blindly?
15:55<samu>it should count based on where it was originally built upon
15:57-!-HerzogDeXtEr1 [] has joined #openttd
15:57<samu>everything else seems to be counting correctly, except when merging
15:57<+glx>anyway if (c != NULL) { c->infrastructure.water--; } seems wrong for me
15:58<+glx>at least it's not at the right location I think
16:00<samu>when merging
16:00<+glx>but the main thing is to check what happens during the merge
16:00<samu>does the game re-builds?
16:00<samu>yes, i think that's what's missing
16:01<samu>where is that
16:01<+glx>there's a CMD_ something for that IIRC
16:03-!-flipFLOPS [] has joined #openttd
16:04-!-HerzogDeXtEr [] has quit [Ping timeout: 480 seconds]
16:05<@Alberth>2066:CommandCost CmdBuyCompany looks like the thing in economy.cpp, line 2066
16:06<andythenorth>edibles tank cars
16:06<andythenorth>could refit to food
16:06<andythenorth>is that weird?
16:06*andythenorth can’t remember if some industry sets use food as proxy for milk, beer, etc
16:06<+glx>or DoAcquireCompany()
16:09<+glx>and going deeper it should be in ChangeOwnershipOfCompanyItems() (economy.cpp:289)
16:09-!-sla_ro|master [slamaster@] has quit []
16:09-!-Yotson [~Yotson@2001:980:6ac8:1:689f:8cd4:410f:9c71] has quit [Quit: .]
16:11<+glx>ok found it
16:11<+glx>ChangeTileOwner_Water() in water_cmd.cpp:1271
16:11<+glx>that's when the counting gets wrong
16:12<+glx>samu: ^^
16:14<+glx>you'll need to detect if there was water before the lock construction, then decrement old and increment new in this case
16:29-!-gelignite [] has quit [Quit:]
16:31<Eddi|zuHause>andythenorth: my company sells (amongst others) food-quality CaCO3 solution, which can be either transported in tank trucks, or IBCs (1m³ standard containers)
16:31<andythenorth>Eddi|zuHause: realism ftw
16:31<samu>from the original?
16:32<Eddi|zuHause>actually, i lied, it's CaCl2 solution
16:33<Eddi|zuHause>CaCO3 is pretty hard to dissolve in water :p
16:33<samu>ah i found it
16:33<Eddi|zuHause>so we dissolve the CaCO3 in HCl :p
16:37-!-frosch123 [] has quit [Quit: be yourself, except: if you have the opportunity to be a unicorn, then be a unicorn]
16:38<samu>if (is_lock_middle) Company::Get(old_owner)->infrastructure.water -= 3 * LOCK_DEPOT_TILE_FACTOR; // Lock has three parts.
16:39<samu>old owner counting also counts?
16:40<+glx>when owner changes the game decrements old and increments new
16:40<+glx>so you must take care of your change there too
16:42<+glx>it's like destroy and rebuild
16:42<+glx>without the real destroy part :)
16:43-!-andythenorth [] has quit [Quit: andythenorth]
16:49-!-shadowalkerAFK is now known as shadowalker
16:51<samu>shouldn't it be RIVER?
16:51<samu>what's the difference
16:54<samu>lock is water_class-canal - always, right?
16:54<samu>im missing something
16:54<samu>there are 3 owners
16:55<samu>first owner = river
16:55<samu>second owner = company that is being sold to third owner
16:55<samu>third owner = buys second owner
16:56<samu>what varies is first owner
16:56<samu>can be river, or can be bare land, and when it's bareland, increment +1 to water maintenance thingy
16:57-!-shadowalker is now known as shadowalkerAFK
16:57<samu>when it's river, don't do anything
17:06<+glx>oh there are 2 cases in ChangeTileOwner_Water(), decrement happens when a company buys another, but also when the company is just removed after bankrupt
17:07-!-Myhorta [] has joined #openttd
17:13<samu>hmm does it matter?
17:13<samu>who is this no_owner?
17:14<samu>oh, owner_none
17:17<samu>testing again, no idea what i've done is correct
17:20<@planetmaker>it helps tremendously to not restrict maximum openttd version for newgrfs... I should better check the musa.ini I use :P
17:22<@Alberth>it does force you to update, eg translations :)
17:23<@planetmaker>it dawned on me that it's not the grf being aweful when it wasn't offered as update even for myself :P
17:23<@planetmaker>and actually, no it doesn't require that; I can update that via web interface
17:23<@Alberth>I mean make a new version of the newgrf with updated translations
17:24<@planetmaker>it's from yesterday :P
17:24<@Alberth>yes, but when 1.6 comes out, it's a year old
17:24<@planetmaker>there's no unreleased translation
17:24<@planetmaker>(I was talking of opengfx+landscape)
17:25<samu>oh yeh, that fixed it
17:25<samu>new owner gets 9
17:25<samu>now let me destroy
17:25<@Alberth>planetmaker: sorry, I am missing the point apparently, too tired
17:26<@planetmaker>there's no hidden point. Probably I miss yours :)
17:26<samu>looks fixed for when there's bareland
17:26<samu>now testing when it's a river tile
17:26<@planetmaker>I just noticed that the version I uploaded ours ago to bananas wasn't even downloaded once. And I wasn't offered it as update to my old version either
17:27<@Alberth>yeah, sounds bad :)
17:27<@planetmaker>so... then I noticed I used a faulty musa.ini :) But could correct it luckily just by removing the maximum allowed OpenTTD version stored for it in bananas
17:39-!-Alberth [~alberth@2001:981:c6c5:1:be5f:f4ff:feac:e11] has left #openttd []
17:49<samu>20 + 6
17:49<samu>nice, it werks!
17:50-!-oskari89 [] has quit []
17:54<samu>i don't really understand why it works
17:54<samu>but it works
17:55<samu>one last test
17:56<samu>company 3 is gonna buy company 2 that bought company 1
17:59<samu>18 -> 18
17:59<samu>and finally... bankrupt company 3
18:00<samu>but i have no idea how to tell how many maintenance tiles the owner_none have
18:00<samu>how can i verify that?
18:01<+glx>owner_none has no maintenance tiles
18:01<+glx>it's not a company
18:01<samu>really? why am i subtracting tiles then :(
18:02<+glx>you are substracting from old_owner
18:02<+glx>which was a company
18:02<samu>the old_owner is gone
18:03-!-Flygon__ [] has quit [Read error: Connection reset by peer]
18:03<+glx>it's not gone when you substract, it's gone only when all the changes are done
18:04-!-Flygon__ [] has joined #openttd
18:04-!-Myhorta[1] [] has joined #openttd
18:04-!-itsatacoshop247_ [] has joined #openttd
18:05<+glx>and this function could be called if an owner sells a tile to another, doesn't happen but better have a safe function in case it's added one day
18:05<samu>hmm interesting
18:05<Eddi|zuHause>you could try starting a new company after the old one is gone, and check whether there were things lingering
18:06<Eddi|zuHause>if things were not cleaned up properly, this new company would own stuff from the old company long after it is gone
18:07<samu>ah I see, i can test that when this bankrupts
18:07<+glx>oh don't forget the saveload code
18:07<samu>what.. :(
18:07<+glx>seems infrastructure is not saved
18:08-!-KouDy [~koudy@] has quit [Ping timeout: 480 seconds]
18:09-!-Progman [] has quit [Remote host closed the connection]
18:09<samu>bah you're right
18:09<samu>18 became 17
18:09<+glx>AfterLoadCompanyStats() in company_sl.cpp:95
18:10<+glx>block 175-187
18:11-!-Myhorta [] has quit [Ping timeout: 480 seconds]
18:14<samu>first test, company bankrupted, recreated another, it starts with none infrastructure tiles
18:15-!-Wolf01 [] has quit [Quit: Once again the world is quick to bury me.]
18:15-!-itsatacoshop247__ [~itsatacos@2601:9:1180:237:47a:9047:89b3:7540] has joined #openttd
18:17-!-KouDy [~koudy@] has joined #openttd
18:17<samu>i destroyed the leftovers
18:17<samu>maintenance is still none
18:17<samu>for this part I assume it's correct
18:19<samu>okay, i'm on that file now, where is line 95
18:19<samu>visual studio doesn't number lines
18:19<+glx>it does
18:20<+glx>options, text editor, c/c++
18:20<+glx>there's a check box
18:20<+glx>oh there's also "all languages"
18:21<+glx>makes more sense to check it there
18:22<+glx>anyway current line is also shown in status bar
18:23-!-itsatacoshop247_ [] has quit [Ping timeout: 480 seconds]
18:26<samu>oh i found it - // do not count the middle tile as canal
18:26<samu>lel it will count now
18:34<samu>if (GetWaterClass(tile) == WATER_CLASS_CANAL)
18:34<samu>i need the opposite of ==
18:34<samu>what is it
18:35<samu>why is it canal though?
18:35<samu>shouldn't it be RIVER
18:36<samu>well i put canal, but i don't really understand why it works
18:37-!-JacobD88 [] has joined #openttd
18:38<samu>that comment now makes no sense
18:38<samu> // do not count the middle tile as canal
18:42<samu>looks like it works, I load the save game, it was previously loading as 17, now it's 18
18:42<samu>now save again?
18:42<samu>loaded back, and still 18
18:43<samu>hmm what do i do now?
18:43<samu>how do i share this diff patch?
18:43<samu>it edited 2 files
18:44-!-JacobD88 [] has quit [Quit: JacobD88]
18:44<Eddi|zuHause>if you want it included in the game, put it on, if you want feedback from other players, put it on the forum
18:44<samu>yeah, but how do i pack the two files?
18:45<Eddi|zuHause>create the patch from the directory, not from the individual files
18:45<samu>hmm ok
18:45<+glx>from trunk directory, not a subdirectory :)
18:46<Eddi|zuHause>i was about to say that. the trunk directory, not the src directory
18:48-!-supermop [] has joined #openttd
18:51<+glx>grr silly VS
18:51<+glx>why does it always touch project files
18:52<samu>hmm so it's wrong?
18:52<+glx>you can safely delete lines 1-202
18:55<+glx>oh the cost thing is probably wrong
18:56<samu>the first one?
18:57<samu>ah I guess I forgot something
18:58<samu>when demolishing, it should subract a fake cost of clearing a water tile
18:58<+glx>well the docommand is used to check many things, like ownership
19:00<samu>i forgot something, my goal was to attach a fake cost of building a canal, instead of calculating the cost of clearing a river tile into the formula
19:00<samu>i did that for building it
19:00<samu>but i forgot to do that for demolishing it
19:05<+glx>maybe you could merge the tests in ChangeOwner
19:06<+glx>as they share is_lock_middle
19:09<samu>before that, I have to put this cost.AddCost(_price[PR_BUILD_CANAL]);
19:09<samu>somewhere in the removelock part
19:10<samu>not addcost, removecost or whatever it's called
19:12<+glx>oh it's probably an addcost :)
19:14<samu>where is the pricelist, is there a PR_DESTROY_CANAL?
19:14<samu>have to guess
19:15<+glx>PR_CLEAR_CANAL maybe
19:15<+glx>yup that's it
19:17<+glx>first step is to add a local variable for that
19:17<+glx>like in DoBuildLock
19:19<+glx>and in RemoveLock() you split return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_LOCK]); in 2 lines, cost.AddCost(_price...); return cost;
19:20<+glx>and of course all cost stuff must be outside if (flags & DC_EXEC) {
19:25<samu>CommandCost cost(EXPENSES_CONSTRUCTION);
19:25<samu>sorry i can't follow you
19:26<+glx>where are you lost ?
19:27<samu>i'm at the first line
19:27<samu>static CommandCost RemoveLock(TileIndex tile, DoCommandFlag flags)
19:27<samu>what I put after it? CommandCost cost(EXPENSES_CONSTRUCTION);
19:28<+glx>and at the end of the function you split the return line
19:29<+glx>of course with only these changes the result should be unmodified :)
19:29<+glx>until you add your extra cost
19:31<samu>last line says return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_LOCK]);
19:31<samu>i split expenses construction and price clear lock?
19:31<samu>hmm how is that done
19:32<+glx>the first part is done by creating the local variable
19:32<samu>expenses_construction goes to last place?
19:32<+glx>you just need to add clear lock price and return cost
19:33-!-FLHerne [] has quit [Quit: There's a real world out here!]
19:34<samu>im confused
19:34<+glx>EXPENSES_CONSTRUCTION is the type of CommandCost
19:34<+glx>you defined it when creating the local variable
19:35<+glx>you just need to do cost.AddCost(_price[PR_CLEAR_LOCK]);
19:35<+glx>and return cost;
19:35<+glx>to have the same effect as return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_LOCK]);
19:36<samu>ah i got it, I think
19:36<samu>cost is the name of variable?
19:36<samu>such a short name
19:36<samu>but it depends
19:36<samu>i need a if
19:37<+glx>that's the basic cost
19:37<samu>ok i guess i know how to do that part
19:37<+glx>then you'll need to ad your extra cost somewhere in the function
19:37<+glx>but outside if (flags & DC_EXEC) block
19:37<samu>the extra cost is only added if there was no river tile under it
19:38<samu>ah, in the else part?
19:38<samu>but... it's similar, they go in tandem
19:38<+glx>it should be added in any case, it's for estimation cost
19:39<samu>hmm ok
19:39<+glx>as estimation and real must be the same
19:39<+glx>DC_EXEC block does the real part
19:40<+glx>cost calculation just need to be outside the block and it's ok
19:42<+glx>if (GetWaterClass(tile) != WATER_CLASS_RIVER) cost.AddCost(...) outside the block
19:42<samu>WaterClass wc_middle = IsWaterTile(tile) ? GetWaterClass(tile) : WATER_CLASS_CANAL;
19:42<samu>hmm wait
19:43<+glx>it's the same test used to decrement ;)
19:43<samu>if (GetWaterClass(tile) != WATER_CLASS_CANAL)
19:43<samu>CANAL or RIVER
19:43<+glx>you decrement in !river
19:44<+glx>so the cost should be added for !river too
19:44<samu>that's a big mess then
19:45<samu>part of the game calls ir river, other part calls it canal
19:45<+glx>only rivers are kept when destroying the lock
19:46<samu>i try river on this part
19:46<+glx>on construction you add cost if there's no water on the tile
19:46<+glx>meaning you build canal and lock on the tile
19:47<+glx>so on destruction you remove canal and lock if there's no river under it
19:48<+glx>that's how I understand your code :)
19:51<samu>if (GetWaterClass(tile) != WATER_CLASS_RIVER) cost.AddCost(_price[PR_CLEAR_LOCK]);
19:52<+glx>not LOCK, CANAL :)
19:52<samu>oh crap yes
19:52<samu>if (GetWaterClass(tile) != WATER_CLASS_RIVER) cost.AddCost(_price[PR_CLEAR_CANAL]);
19:53<samu>now, where do i put this line at
19:53<samu>heh, im such a noob
19:53<samu>let me copy paste this part
19:53<+glx>can be anywhere exept the DC_EXEC block
19:55<samu>it's at line 7
19:55<samu>cus i have no idea where it goes
19:55<samu>line 3 and line 7
19:56<+glx>line 4 is misaligned
19:56<+glx>and line 7 is not the right place
19:56<+glx>it should be outside this block
19:57<+glx>you can put it around line 17 or line 40
19:58<+glx>and the return is still unsplit :)
20:00<samu>ok i put it at 40
20:01<samu>what's a split?
20:01<samu>i have to make it in two parts?
20:02<samu>but what
20:02<+glx>yes else the cost won't change
20:02<samu>let me try ad hoc split
20:03<+glx>cost.AddCost(...); return cost;
20:04<samu>if (GetWaterClass(tile) != WATER_CLASS_RIVER) cost.AddCost(_price[PR_CLEAR_CANAL]);
20:04<samu>and now
20:04<samu>cost.addcost(pr.. etc return cost?
20:04<samu>and the last line is unchanged?
20:04<+glx>and the last line is removed
20:05<+glx>replaced by the 2 lines you are writing
20:05<samu>oh, so im doing this wrong
20:06<+glx>you should have 3 lines after the DC_EXEC block
20:07<+glx>if (!river) add clear canal cost
20:07<+glx>add clear lock cost
20:07<+glx>return cost
20:07<samu>i can't follow you, sorry so much
20:08<samu>i have this
20:08<+glx>that's wrong :)
20:09<+glx>I'll try to explain clearly
20:09<samu>the price of clearing the lock must be accounted as well
20:10<samu>it sums both
20:10<+glx>return CommandCost(EXPENSES_CONSTRUCTION, _price[PR_CLEAR_LOCK]); is similar to
20:10<+glx>CommandCost cost(EXPENSES_CONSTRUCTION);
20:10<+glx>return cost;
20:11<samu>oh, i see
20:11<+glx>the declaration is moved on top of the function
20:11<+glx>and you add your extra cost in between
20:12<samu>1 line became 3
20:12<samu>not 2
20:12<samu>ok i see
20:12<+glx>well the first is already correct
20:13<samu>the expenses_construction is the dependable value, I seeeee :)
20:13-!-Quatroking [] has quit [Read error: Connection reset by peer]
20:13<samu>damn i'm such a nab
20:13<+glx>at least you try
20:14<+glx>and you touched many parts of the game without noticing :)
20:15<+glx>construction, destruction, loading
20:15<+glx>company merging too
20:16<+glx>for just a simple idea
20:16<+glx>not bad for a start :)
20:17<samu>I'd never guess the save and load one if no one would tell me
20:18<+glx>but I think you would have noticed it when testing
20:19<+glx>line 42 is already on line 3 :)
20:20<+glx>else this code should do what you want
20:20<samu>ah, which one do i remove
20:20<+glx>remove line 42
20:21<samu>k, hopefully it will work
20:21<+glx>to resume, the old return is split and your extra cost is added
20:23<samu>it is building
20:23<samu>and executing
20:23<samu>but you mentioned something else
20:23<samu>that needs fixing or imrpoving
20:23<+glx>what ?
20:24<samu>before I mentioned I forgot to add this cost when removing
20:24<samu>let me read back
20:24<+glx>ha yes the saveload checks
20:25<+glx>ha no the owner change
20:26<samu>building lock: 7500+5000+5000+5000 = 22500, let me see if it confirms
20:27<samu>correct, 22,500
20:27<samu>destroying lock: I actually don't know the base price
20:27<samu>dont know the base price + 5000
20:27<+glx>I think 2 canals are kept when destroying lock
20:28<samu>assertion failed
20:28<samu>at line blabla
20:28<samu>so i failed
20:28<+glx>which assertion failed ?
20:28<samu>can't be river?
20:29<samu>then it's canal, gonna try canal
20:29<+glx>oh of course
20:29<+glx>it's no longer a river after destruction
20:29<+glx>move the canal cost before the DC_EXEC
20:32<+glx>because if it was not a river it became a clear tile, so you can't check water class for that
20:32<+glx>as it's not a water tile
20:32<+glx>but before the DC_EXEC it's ok
20:33<+glx>as nothing has been done yet
20:34<samu>ok its running
20:35<samu>bah fail
20:35<samu>well no error, but
20:35<samu>it didn't account 5000
20:35<samu>2000+5000 = 7000
20:35<samu>should cost 7000
20:37<samu>ok it's doing the opposite of what I want
20:37<samu>its adding 5000 if built on river
20:37<samu>let me compare with 1.5.0-beta1
20:38<+glx>because the code cleary says if !river add
20:38<samu>with river, it does assert error
20:38<samu>i am trying with canal now
20:39<samu>it is doing the calculation but the wrong way
20:39<samu>so != becomes == ?
20:39<samu>let me re-check
20:40<+glx>decrement is done in else so != river
20:40<+glx>cost is increased for != river too
20:41<samu>let me try river again
20:41<samu>since it moved up
20:43<samu>is it because it's on a coast slope?
20:43<samu>river slope is also on coast
20:46<samu>nice it works
20:46<samu>moving that line before dc_exec apparently fixed it
20:46<samu>and it's river again
20:46<+glx>so 2000 in this case
20:47<samu>no, 7000 already
20:47<samu>all working as intended
20:48<+glx>hmm removing on river should cost 2000
20:48<samu>removing on river costs 2000
20:48<samu>removing on bareland costs 7000
20:48<samu>working as intended
20:48<samu>much happy!
20:49<samu>thx for all the help
20:49<samu>there's some other thing to solve but i dont have time now
20:49<samu>i can do that tomorrow
20:49<+glx>you learned a lot with a "small" change :)
20:50<samu>heh it looks so small but in truth it's not too easy to get it right
20:53<samu>okay, here it is
20:53<samu>the whole patch file
20:53<samu>except the visual studio parts
20:53<samu>i unticked it
20:54<+glx>well it's not a patch file it's a paste of the patch ;)
21:03<samu>if the owner of the lock is owner_none, will it still work?
21:04<samu>i got to check this tomorrow
21:04<samu>no time now
21:04-!-samu [] has quit [Quit: Page closed]
21:08-!-smoke_fumus [~smoke_fum@] has joined #openttd
21:13-!-Myhorta[1] [] has quit [Read error: Connection reset by peer]
21:26-!-liq3 [] has joined #openttd
21:31-!-liq3 [] has quit []
21:47-!-quorzom [] has quit [Read error: Connection reset by peer]
21:56-!-liq3 [] has joined #openttd
22:59-!-HerzogDeXtEr1 [] has quit [Quit: Leaving.]
23:15-!-glx [] has quit [Quit: Bye]
23:18-!-Flygon_ [] has joined #openttd
23:21-!-Flygon [] has joined #openttd
23:25-!-Flygon__ [] has quit [Ping timeout: 480 seconds]
23:27-!-Flygon_ [] has quit [Ping timeout: 480 seconds]
23:32-!-luaduck_zzz is now known as luaduck
---Logclosed Tue Feb 17 00:00:17 2015