IRC logs for #openttd on OFTC at 2017-04-02
⏴ go to previous day
00:05:21 <peter1138> Samu, i commented on fs6548
00:08:30 *** chomwitt has joined #openttd
00:24:41 <Samu> peter1138: in my opinion, if you want to do it the other way
00:25:05 <Samu> i'd exclude buoys, ships can walk in all direction on buoys, unlike locks and depots
00:26:02 <Samu> allow spawning on buoys and not on the others, so the exact opposite of how it is
00:26:43 <Samu> my thought was, since it already allows on the others, it would only make sense to allow on buoys
00:42:59 *** Supercheese has joined #openttd
00:49:53 *** Hiddenfunstuff has quit IRC
01:26:50 *** HerzogDeXtEr1 has joined #openttd
01:33:57 *** orudge` has joined #openttd
01:33:57 *** ChanServ sets mode: +o orudge`
01:59:07 <Samu> funny that juanjo also working on the same thing
01:59:08 <Wolf01> Eh what? Ah yes, I should sleep
02:03:56 <Samu> wow, his code is very much alike mine, lol
02:46:02 *** chomwitt1 has joined #openttd
03:11:27 <luaduck> yo, trying to debug a segfault when running under docker, what's the easiest way to get openttd to vomit a stacktrace?
03:18:53 *** Cybertinus has joined #openttd
03:38:35 <luaduck> gdb is throwing me a "no stack" when doing bt after running make run-gdb
04:03:54 <luaduck> nevermind, needed to be in privileged mode: says it's throwing an exception in LZMASaveFilter
06:36:32 *** chomwitt2 has joined #openttd
06:44:47 *** CompuDesktop has joined #openttd
07:30:29 *** Progman has joined #openttd
08:05:29 <peter1138> though i'd be surprised if anything had changed in ottd
08:08:09 *** sla_ro|master has joined #openttd
08:15:48 *** orudge` has joined #openttd
08:15:48 *** ChanServ sets mode: +o orudge`
08:53:35 *** Hiddenfunstuff has joined #openttd
09:49:45 <Eddi|zuHause> luaduck: in debug builds, there is a key that deliberately crashes the game (i think it's something like Alt+0, but i'm not sure)
10:11:05 <Eddi|zuHause> __ln__: i'm not quite sure i understand all of this
10:11:29 <Eddi|zuHause> especially the "important" paragraph
10:19:32 <__ln__> i guess they're implying "important" is not a word that would normally be used with "amount"... however, such combination seems to be used outside of EU texts all over the web.
10:23:13 *** Alberth has joined #openttd
10:23:13 *** ChanServ sets mode: +o Alberth
10:37:15 *** HerzogDeXtEr has joined #openttd
10:50:08 <Wolf01> Meh hangover from ginger ale...
11:17:54 <Eddi|zuHause> "Animal Adventure Park Giraffe Cam" yeah, that is certainly what i was looking for, youtube...
11:18:25 <Wolf01> I don't want to look at youtube suggestions after what I've seen lately
11:21:06 <Eddi|zuHause> "You have reached the Russian embassy, your call is very important to us. To arrange a call from a Russian diplomat to your political opponents, press one.
11:21:08 <Eddi|zuHause> To use the services of Russian hackers press two.
11:21:09 <Eddi|zuHause> To request election interference, press three and wait until the next election campaign. Please note that all calls are recorded for quality improvement and training purposes."
11:36:42 *** chomwitt3 has joined #openttd
11:40:17 <Alberth> hi V453000, nice blog, but "So I re-used some of the BRIX sources and code, and continued" <-- shouldn't that be RAWR ?
11:41:56 *** andythenorth has joined #openttd
11:48:25 <andythenorth> video of two screens?
11:53:28 <V453000> Albrth yeah need to proofread at least once, was tired yesterday
11:55:27 <Alberth> not a good time to post important news :)
11:56:34 <V453000> important are products, words less :)
12:00:34 <Alberth> pictures say many words :D
12:01:02 <V453000> take much time to make though :P
12:01:21 <Alberth> pictures also take many words :p
12:01:50 <Alberth> but it's good to see you have a clear goal, that is half the project, often
12:03:00 <V453000> yeah, let's see how many times it changes
12:04:16 <V453000> but a decision "won't do new big features" is easy to follow usually :P
12:06:48 <Wolf01> "I mostly use canals to divert multi level rivers. Gonna need an alt solution now :(" Lol
12:08:42 <Alberth> lots of canal discussion :)
12:09:16 <Wolf01> I really moved the waters eh :D
12:09:52 <Alberth> V, new big features are usually just moved to the next project :p
12:10:13 <Wolf01> Shame nobody was like "wow NRT might be in trunk" but everyone "Don't remove canals plz"
12:10:51 <andythenorth> if you go trolling, you get what you get
12:11:39 <Wolf01> If only I were more smart, I would have prepared some "NotShips" branch with ships disabled and desert in place of the water
12:12:08 <Wolf01> And linked that in the announce, with screens to
12:14:56 <andythenorth> that’s not mean, that’s English :P
12:15:27 * andythenorth is always surprised how direct mainland Europeans are :P
12:16:22 <Wolf01> BTW, we should really consider to remove canals and make them an addon (smiley)
12:26:01 <Rubidium> well... how many people are asking for ye olde AI?
12:26:25 <V453000> andythenorth: iz brix :)
12:26:48 <V453000> the converted 8bpp is actually almost unusable because of some things
12:26:49 <Wolf01> Eh, I want old bugs reintroduced... mmmh, this might be the next year's april fool joke
12:26:54 <V453000> slopes look shit, shadows look shit
12:26:57 <V453000> andythenorth: look iz
12:27:35 <V453000> tt-f, openttdcoop blog, bananaz
12:29:30 <Samu> can't embed videos on the forum?
12:29:51 *** Progman has joined #openttd
12:29:55 <andythenorth> V453000: reckon you can keep up with how fast I add cargos to FIRS? o_O
12:30:10 <V453000> andythenorth: eventually :P
12:30:27 <V453000> the universal wagon makes sure it techically works, regarding sprites it's harder
12:30:42 <V453000> I want to rewrite the system to utilize the layering, and recolour masks
12:31:00 <V453000> it's so much less sprites for so much better result & maintainability
12:35:23 <V453000> I mainly retrospectively regret not utilizing the recolours on cargo things
12:36:26 <andythenorth> recolours are my favourite way to cargo
12:36:35 <andythenorth> Road Hog tankers just change colour for cargo :P
12:36:49 <V453000> it's how NUTS does it as well, just not in code :)
12:37:07 <V453000> I actually managed to do it quite fast after doing thousands of sprites that way
12:37:10 <andythenorth> I considered that box wagons should change colour too
12:37:12 <V453000> but yeah still just way much pain
12:37:18 <andythenorth> and whether I could match them to cargo colour in game
12:37:23 <V453000> everything should change colour
12:38:35 <Wolf01> I'm having some ideas for a new industry set. How many different cargo an industry can accept and produce?
12:39:27 <Wolf01> Also, can industries change cargo with ages?
12:39:55 <andythenorth> they can change when constructed
12:40:08 <Wolf01> I need like 8 in, 8 out and year based
12:40:30 <Eddi|zuHause> you probably won't get that...
12:42:25 <andythenorth> what’s the idea?
12:43:58 <Alberth> build clusters of industries :p
12:44:12 <Wolf01> Some late game futuristic stuff
12:49:24 <Wolf01> Idea died, that was the core point to start from :(
12:50:24 <Wolf01> Grf set in cooperation with a gamescript to make a sort of puzzle game
12:50:36 <V453000> nice, any specifics ? :)
12:51:40 <Wolf01> More different raw materials you deliver to a processor, more different goods it produces
12:52:37 <Wolf01> Also different ages might impact on what you might obtain from it
12:52:57 *** frosch123 has joined #openttd
12:53:07 <andythenorth> one day, industries 3 in 2 out will probably get adjusted
12:53:12 <Wolf01> It's a sort of chem factory game
12:53:14 <andythenorth> but it’s probably not much net gain
12:53:57 <Wolf01> And the final goal: build spaceships
12:55:45 <V453000> never heard about building spaceships before :P
12:56:17 <Wolf01> You bring in 8 cargo items and get spaceships as production
13:02:59 <Wolf01> I was looking for a sort of A->B->C+A->B->C->B->D+A+C->B->E industry chain with fictional cargo, lot of refitting and puzzling for delivering in restricted space
13:03:01 *** andythenorth has joined #openttd
13:06:18 <V453000> seems to have gameplay idea -> I like it sofar
13:06:50 <Wolf01> I think, I should go play factorio instead... it already has everything, also I can make the factory as I want :S
13:07:26 <Wolf01> Plus, I can ion cannon the creeps out of the map
13:16:19 <luaduck> peter1138: I'll raise that bug later tonight
13:16:44 <luaduck> once I have time to document exactly what libraries are getting pulled in
13:19:01 <luaduck> my best guess is that alpine is rocking either a really new or a really really old version of lzma
13:19:20 <Wolf01> I would like to know what weird sequence of characters makes the weblog to panic
13:28:48 <andythenorth> no more temperate grass on non-temperate terrain
13:34:58 <frosch123> pile colors are common language to distinguish mines in various games
13:35:22 <frosch123> i am just surprised by the water tanks
13:35:33 <frosch123> i would expect them in some processing industry, not at the mine
13:36:10 <andythenorth> I am not convinced
13:36:16 <andythenorth> there is other greeble I could replace them with
13:40:41 <andythenorth> seems more like it needs a loading shovel
13:40:45 <andythenorth> and some chimneys
13:41:52 *** gelignite has joined #openttd
14:00:43 *** Wormnest has joined #openttd
14:05:42 *** orudge` has joined #openttd
14:05:42 *** ChanServ sets mode: +o orudge`
14:08:25 <andythenorth> making it better
14:18:13 *** chomwitt4 has joined #openttd
14:32:12 *** andythenorth is now known as Guest336
14:32:32 *** andythenorth has joined #openttd
14:32:59 *** sim-al2 has joined #openttd
14:34:37 <andythenorth> openttd does not like grfs being changed under it
14:41:14 <andythenorth> crane or front loader iron ore mine?
14:48:16 *** FLHerne has joined #openttd
15:01:35 *** roidal_ has joined #openttd
15:09:07 *** orudge` has joined #openttd
15:09:07 *** ChanServ sets mode: +o orudge`
15:20:33 *** Stimrol has joined #openttd
15:36:24 <Samu> i hate to have to separate patches
15:36:42 <Samu> makes no sense, i don't get it
15:36:55 <Samu> why separate things if they only make sense together
15:37:27 <andythenorth> because big diff
15:38:14 <Rubidium> so you just throw eggs, mustard and potatoes in a fryer? After all, they only make sense together
15:39:03 <Rubidium> though... good luck making fries/crisps with mayonaise that way ;)
15:40:38 <Samu> have to undo what i've done, just for the sake of being separated, it sucks
15:52:22 <andythenorth> if you commit atomically, it’s much easier
15:53:43 <peter1138> plus it looks like we're busier
15:53:51 <Samu> bah, the forums are bugged, can't right click or it crashes the page
15:57:39 <peter1138> sounds more like your browser is buggy...
16:04:37 <Samu> the bottom part which shows the past posts is where I can't right click
16:05:47 <Samu> browser says something about having to reload page as it wasn't answering a request
16:05:56 <peter1138> i bet you're using something shitty like edge anyway
16:07:34 *** Alberth has joined #openttd
16:07:34 *** ChanServ sets mode: +o Alberth
16:34:36 <Alberth> feeling a bit blue? :)
16:35:03 <Alberth> looks very different from other mines, nice
16:35:31 <peter1138> same range though heh
16:35:33 <Alberth> it's likely recourable, like the other mines
16:45:02 <andythenorth> probably needs snow
16:48:58 <andythenorth> FIRS has a fertiliser plant
16:51:33 *** gelignite has joined #openttd
16:52:35 <Alberth> piperoad rather than pipeline :)
16:53:43 <frosch123> can camels also be called "desert ships" in english? (german has this allegory)
16:54:17 <peter1138> well once canals are removed we can fit pipes in their space
17:05:29 <andythenorth> fertiliser is made from air
17:05:42 * andythenorth considers a weird primary-secondary industry
17:16:38 * andythenorth also considers removing all industry date restrictions
17:28:14 <Alberth> :o evening already, indeed
17:39:47 <Samu> i'm a terrible coder, damn
17:53:26 <andythenorth> FIRS makefile needs work
17:58:18 *** orudge` has joined #openttd
17:58:18 *** ChanServ sets mode: +o orudge`
18:03:24 *** andythenorth has joined #openttd
18:07:44 *** chomwitt has joined #openttd
18:48:29 <peter1138> it's all gone quiet
18:48:47 <Alberth> it's sunday evening, and very good weather :)
18:48:49 <planetmaker> psst, don't disturb the silence :)
18:49:46 <peter1138> nobody told my weather to be nice :S
18:50:59 <Wolf01> I would only talk about self pity, so better not talk
18:51:14 <Samu> doing a fastforward test with my depots patch
18:51:36 <Samu> will see which one takes more cpu time
18:52:43 <Samu> yeah, i guess that is the term
18:57:25 <peter1138> not if you're doing it like that
18:58:48 <Samu> don't know how else to test it
18:59:43 <peter1138> i'd suggest using a profiler
19:03:28 <andythenorth> industry location, incomaptible industries checks
19:03:49 <andythenorth> check distances to industries supplying inputs, industries processing outputs, or both?
19:03:51 <Wolf01> Like a farm is incompatible with a mine?
19:04:12 <andythenorth> iron ore mine has to be min 16 tiles from steel mill
19:04:33 <andythenorth> hmm, maybe just check both ways, and special case supplies
19:09:54 <Alberth> I have a somewhat love/hate relation with nearby related industries
19:10:36 <Alberth> one the one hand it gives diversity, on the other hand, it's not making money :p
19:10:40 <andythenorth> when it suits me, it suits me
19:10:44 <andythenorth> and when it doesn’t…
19:11:21 * Zuu have a noise issue. AP ending up being closer to a different town than you plan for need you to check that other towns noise limit instead, still keeping track of the future noise budget of the planned town in a upgrade scenario.
19:11:22 <Alberth> so I have become less decided on what is best
19:11:30 <andythenorth> looks like current FIRS mostly enforces checks on primary <-> secondary
19:11:42 <andythenorth> and not secondary <-> secondary <-> tertiary
19:12:18 <Zuu> Easy solution is to only allow building new airport closest to the town it is planned for.
19:12:44 <Zuu> hm.. my code is supposed to do that already ...
19:13:14 <Zuu> Oh.. using AITile instead of AIAirport.
19:17:15 *** frosch123 has joined #openttd
19:23:08 <Alberth> you could also make it a feature to have some industries not too far away from each other :p
19:23:34 <Alberth> especially if you have slow dedicated wagons for the cargo :p
19:24:17 <Samu> 28m21s with depots patch
19:25:14 *** andythenorth has joined #openttd
19:29:02 *** andythenorth has joined #openttd
19:31:47 <peter1138> what map size and how many ships?
19:32:18 <andythenorth> ha I got python in a loop
19:32:19 <Samu> i used a savegame posted on the bugs
19:32:24 <andythenorth> circular imports :l
19:32:57 <Samu> 89 ships i think, but there was more than just ships
19:37:01 <DorpsGek> Commit by peter1138 :: r27841 trunk/src/industry_cmd.cpp (2017-04-02 19:36:53 +0200 )
19:37:02 <DorpsGek> -Fix: Don't consider locks or ship depots as clear water when placing industries.
20:01:30 <andythenorth> Alberth: I’ve managed to write an incompatible check that takes 30s
20:02:12 *** andythenorth is now known as Guest359
20:02:12 *** andythenorth_ has joined #openttd
20:02:12 *** andythenorth_ is now known as andythenorth
20:02:36 <andythenorth> even python shouldn’t be that slow :|
20:03:03 <Alberth> oh, do enough, and it gets slow all by itself :p
20:04:55 <peter1138> dunno why i bother posting patches for george
20:04:59 <peter1138> i don't think he can ever test them
20:05:43 <Samu> npf: 40m34s with depots patch
20:06:29 <Samu> i thought npf wasn't much different than yapf, what has gone wrong?
20:13:46 <andythenorth> ach, the incompatible industries check is much harder than it seems :P
20:17:11 <andythenorth> the full list of industries isn’t known until they all been inited
20:17:23 <andythenorth> but they need the incompatible check at init time
20:17:46 <andythenorth> that direction is fundamentally impossible :P
20:21:54 <frosch123> if you want to make it more horrible, add incremental builds
20:22:17 <frosch123> read the incompatible checks from a generated file
20:22:24 <frosch123> it's empty the first time you build it
20:22:34 <frosch123> it's filled the more often you recompile
20:23:03 <frosch123> if you are lucky it converges at some point, but it can also toggle between multiple states :)
20:23:13 <Eddi|zuHause> andythenorth: you need an absolute non-cyclic abstract grammar (ANCAG) for solving your initialization problem? :p
20:26:41 <andythenorth> hmm, now my check calculation takes about 0.2s
20:28:04 <andythenorth> dunno if it works yet :P
20:30:22 <Alberth> just a minor detail to work out :p
20:33:21 *** Supercheese has joined #openttd
20:34:12 <peter1138> brix realism is xxxx
20:37:09 <Supercheese> Forum users' status: Fooled ☑ Not Fooled ☐
20:37:37 <Supercheese> NotFooledTypes when
20:38:15 <peter1138> brix trains are a bit tall i think
20:38:30 <Alberth> yeti compatible, perhaps
20:39:07 <peter1138> V453000, V453000, V453000
20:39:21 <V453000> peter1138: are disabled by default, you never seen anything
20:39:30 <andythenorth> and this is why the best malware are the ‘malware removal tools'
20:39:40 <peter1138> V453000, no i meant to say
20:40:03 <V453000> well I like the proportions of ultra chibby a lot
20:40:32 *** ChanServ sets mode: +v tokai
20:40:49 <peter1138> rough land isn't kidding
20:42:07 <V453000> tbh I am pretty ashamed of how BRIX looks atm
20:42:14 <V453000> might motivate me to do something with it
20:42:23 <peter1138> didn't see it last night as i don't usually read the graphics forums
20:42:51 <V453000> I uploaded it at like 0:40 a.m. today
20:44:33 <V453000> & the 8bpp is basically unusable
20:44:42 <V453000> some grass just blends together so slopes are invisible
20:45:02 <V453000> about as good proof of concept as zbase is to 32bpp :D
20:45:10 <peter1138> doesn't matter does it?
20:45:49 <peter1138> basically you don't have them in 8bpp :D
20:45:59 <peter1138> i suppose you could do a black chequer dot pattern
20:46:03 <V453000> just alpha cutout rules
20:46:13 <V453000> I'll figure something out
20:46:24 <V453000> likely the checker pattern yes
20:47:12 <andythenorth> incompatible check might work
20:48:11 <V453000> but overall i quite like the idea of 8bpp in x4 zoom
20:48:26 <peter1138> yeah, sure it's harder though
20:48:36 <V453000> just needs tweaking the converter accordingly
20:48:47 <peter1138> ooh a guy chopping down a tree
20:48:55 <V453000> I'm just going to make a better algorithm for it and then expose many settings to control it very well
20:49:30 <V453000> for example if I see a certain terrain is getting a green I don't want it to get, I just ban that ID from that sprite/row/column/whatever
20:49:32 <Samu> lost ships are a terrible thing for OPF, still waiting
20:53:10 <V453000> Wolf01: what's wrong?
20:53:22 <Wolf01> Nah, can't remove real life
20:54:26 <peter1138> heh, girder bridges are weird
20:54:48 <Samu> peter1138: provide me a good savegame
20:55:06 <Samu> with ships doing weird things
20:55:15 <V453000> yeah the colour masks are goign wild there I think
20:55:17 <peter1138> ok what's holding up the wooden bridge... haha
20:55:23 <peter1138> V453000, nah it's the pillar
20:56:00 <V453000> seems to be proper fucked actually
20:57:36 <V453000> they make more sense than the original ones :P
20:58:30 <Samu> 20 game years to finish OPF test, zzzz
21:00:12 <Alberth> test-result: "Tester fell asleep"
21:02:32 <Wolf01> OTTD needs functional tests
21:03:06 <Wolf01> It also really needs some unit tests
21:04:06 <Wolf01> Too bad that for what I've tried so far, the only way to test it is to start the game...
21:10:56 <Alberth> "some" is an understatement :p
21:11:33 <Alberth> likely the tests will become a bigger maintenance effort than the program
21:12:03 <Wolf01> Yes, like every other program with tests
21:12:35 <peter1138> unit test the unit tests!
21:13:28 <Supercheese> Yo dawg, I heard you like tests
21:13:32 <Wolf01> On my game I only tested the static functions, just to be sure the stateless things are working right
21:13:43 <Supercheese> so we made tests for your tests so you can test while you're testin
21:14:11 <V453000> sounds like automation
21:14:29 <Wolf01> It is, just set up enough data providers :P
21:28:18 <Samu> opf: 1h20m54s with depots patch
21:30:29 <Samu> only npf became too slow
21:30:41 <Samu> ~9% for some reason, why? :(
21:44:38 <V453000> thank you for the forum post peter1138 :) I appreciate it a lot
21:52:51 <peter1138> hmm, NUTS appears twice in the content list
21:54:00 <peter1138> oh i guess it is incompatible and therefore has a new grfid?
21:55:38 <frosch123> usually that only happens if it is a dependency of something else
21:56:26 <frosch123> 0.7.8 is bigger because it contains 32bpp
21:58:17 *** chomwitt1 has joined #openttd
22:01:13 <Zuu> Evil AI, using a very long signal block with PBS to cross a road. A short block is fine to save trucks, but 20-30 tiles blocking distance is a bit evil. :-)
22:04:29 <V453000> what different grfid?
22:04:44 <peter1138> i dunno, i guessed wrong
22:05:05 *** sim-al2 has joined #openttd
22:14:56 *** andythenorth has joined #openttd
22:24:32 <peter1138> "but there clearly stays its not a joke."
22:24:39 *** Hiddenfunstuff has quit IRC
22:24:52 <andythenorth> Do Not Press This Button
22:26:38 <V453000> can someone explain to me what the shit is /r/place ?
22:28:28 <Supercheese> looks like pixels
22:30:59 <frosch123> V453000: apparently every user can draw a pixel every few minutes
22:31:17 <frosch123> i have no idea how big the canvas is though, you only ever get some random section ro so
22:31:19 <V453000> well yeah but in /r/factorio it's EVERYWHERE
22:31:58 <frosch123> it's the hype of the week or so
22:32:07 <frosch123> just go on vacation :p
22:32:48 <Samu> zuu, did you make Epic ai or whatever it's called, sec, brb
22:32:51 <frosch123> i saw a r/place screenshot with factorio though
22:32:56 <frosch123> it may be about that
22:33:29 <Zuu> No. That is probably Trans.
22:33:48 <Samu> Author is Tovermodus, do u know who that is?
22:34:02 <Zuu> Oh.. there is one EpicTrans on bananas. Probably a fork of Trans.
22:34:31 <LordAro> frosch123: 1000x1000, you can move around :p
22:34:45 <LordAro> but yeah, essentially PvP MS Paint
22:34:54 <LordAro> is the best way i've seen it described
22:35:19 <frosch123> well, it will be taken over by bots
22:35:33 <LordAro> not so far, as far as i'm aware
22:35:49 <LordAro> fought off a 4chan botting attempt
22:38:51 <Zuu> The AI code is quite short, but it doesn't seem to deal with save/load.
22:39:05 <frosch123> LordAro: there are way too many flags in that
22:41:06 <Samu> what's the difference between NULL and 0 again?
22:41:19 <Zuu> I only made a few AIs :-) : Clueless(Plus), PAXLink, TownCars AI, IdleMore and Tutorial AI.
22:41:39 <Zuu> Samu: Depends on the programming language.
22:42:06 <Samu> - pfs.max_length = (max_penalty == NULL || max_penalty > OPF_MAX_LENGTH) ? OPF_MAX_LENGTH : max_penalty;
22:42:17 <Samu> + pfs.max_length = (max_penalty == 0 || max_penalty > OPF_MAX_LENGTH) ? OPF_MAX_LENGTH : max_penalty;
22:42:36 <Samu> why did juanjo modified it from NULL to 0?
22:43:29 <Zuu> NULL is in general used to check if a pointer is equal to NULL. But 0 is usually used for integer 0.
22:44:07 <Zuu> In C++ you can compare a pointer to 0 as NULL == 0, but in other languages that does not hold.
22:44:47 <Zuu> But it is not very good style to compare a integer non-pointer variable to NULL if you mean to compare it to integer 0.
22:45:04 <Zuu> NULL is coding style wise only for comparing with pointers.
22:45:50 <Samu> Sometimes I pass max_penalty as 0, some other times i pass as OPF_MAX_LENGTH, but some other times I don't pass anything, but I suppose it's defaulted to OPF_MAX_LENGTH, or is it passed as NULL?
22:45:50 <Zuu> Though not all C++ projects use NULL. Some use 0 for both integers and pointers.
22:46:32 <Samu> how am i knowing it will be defaulted to OPF_MAX_LENGTH
22:47:00 <frosch123> LordAro: your turn to point out "nullptr" :p
22:48:08 <peter1138> Samu, ... if it has a default value... that's the default value
22:48:17 <peter1138> if it doesn't have a default value, you have to provide it
22:49:14 <Samu> static uint FindShipTrack(const Ship *v, TileIndex tile, DiagDirection dir, TrackBits bits, TileIndex skiptile, Track *track, uint max_penalty = OPF_MAX_LENGTH, TileIndex depottile = INVALID_TILE)
22:50:12 <Samu> distr = FindShipTrack(v, tile2, ReverseDiagDir(enterdir), b, tile, &track)
22:50:31 <Samu> i don't put anything past &track
22:50:39 <Samu> is it gonna use the default?
22:50:44 <Zuu> That will use the default values.
22:50:50 <peter1138> that's what default values are for, yes
22:51:13 <Zuu> Sometimes called optional function/method arguments in docs.
22:51:26 <Samu> static const uint OPF_MAX_LENGTH = 50; ///< The default maximum path length
22:51:47 <Samu> it's uint? i guess it should be int
22:51:54 <Samu> dam, i'm a terrible coder
22:52:26 <Zuu> int is only needed if it needs to hold negative values like -1.
22:52:39 <peter1138> uint means unsigned int
22:53:01 <peter1138> negative values would seem bad for a penaltyu
22:53:24 <Samu> but when passing this value around multiple functions, sometimes it's int sometimes it's uint
22:53:34 <Samu> but the value is always positive
22:53:49 <Samu> it confuses me, i never know if i create a uint or int
22:54:12 <Zuu> Imho it should be consistent uint, but maybe it is not in current code.
22:55:01 <Samu> for example, in ship_cmd.cpp, it uses int max_penalty
22:56:07 <Samu> when it's passed to opf_ship.cpp, i have to compare this a uint with this int, something like uint < int, the compiler does not like this
22:56:44 <Samu> if (distdepot <= (uint)max_penalty && distdepot < best_dist) {
22:56:54 <Samu> i had to put (uint) there
22:57:57 <Samu> then there's best_dist, it's uint
22:58:09 <Zuu> Unless it use -1 anywhere as "no penalty", it may be best to make a -Codechange and fix it to consistently use uint at all places.
22:58:10 <Samu> inside the pathfinder code it's also uint
22:58:45 <peter1138> there's no max_penalty in opf_ship.cpp
22:58:48 <Samu> there's always a penalty
22:58:49 <peter1138> so the wrong type is your doing :p
22:59:02 <Samu> if it's 0, then treat it as 50
22:59:08 <LordAro> frosch123: i thought i couldn't mention that until the CF gets upgraded? :p
22:59:11 <Samu> if it's not specified, trat it as 50
22:59:24 <Samu> yes peter1138 it's my code, i suck right?
22:59:45 <peter1138> well just fix it properly instead of casting
22:59:49 <Samu> but it's not consistent with everywhere else that already uses a penalty
22:59:58 <Samu> everywhere else, it's int
23:00:13 <frosch123> LordAro: btw. we got a new user adding changelogs to the wiki
23:00:20 <Zuu> FindClosestRoadDepot do have the int/uint mismatch in trunk.
23:00:41 <Zuu> Unless it was fixed the very last few days.
23:00:49 <LordAro> frosch123: i shall have to inspect their work!
23:02:08 <Samu> yes zuu, i guess it's not the only one
23:03:38 <peter1138> src/pathfinder/yapf/yapf.h:FindDepotData YapfRoadVehicleFindNearestDepot(const RoadVehicle *v, int max_penalty);
23:03:41 <peter1138> src/pathfinder/yapf/yapf_road.cpp:FindDepotData YapfRoadVehicleFindNearestDepot(const RoadVehicle *v, int max_distance)
23:03:48 <peter1138> variable name is different :p
23:04:17 <Zuu> But in that case all callers of FindClosestRoadDepot supply uint data, so changing FindClosestRoadDepot to uint would be possible without having it spread further away to other parts.
23:04:54 <Samu> look at the other depots too, they're all ints
23:06:35 <Zuu> So now its possible to speed up the game by a tiny fraction by removing a uint -> int conversion for all depot types assuming it is not needed deep in the depot finding methods. :-)
23:06:46 <Samu> some say max_distance, some say max_penalty
23:07:07 <peter1138> max_distance seems more appropriate
23:07:30 <Samu> it's both at the same time
23:07:44 <Samu> it's a penalty inside the pathfinder
23:08:33 <Samu> it's the total computed cost
23:08:34 <Zuu> like a generalized cost possible
23:08:35 <peter1138> it's not a penalty inside the pathfinder
23:09:23 <Samu> if it goes past that value, the pathfinder stops that node or something like that, won't look beyond that path
23:12:30 <Samu> case VPF_YAPF: max_penalty = _settings_game.pf.yapf.maximum_go_to_depot_penalty
23:12:40 <Samu> config setting uses the name "penalty"
23:16:50 <Samu> trains: uint max_penalty
23:16:53 <Samu> FindClosestTrainDepot(Train *v, int max_distance)
23:17:12 <Samu> heh, it's not consistent, but oh well
23:18:21 <peter1138> ^ what i posted up there :p
23:18:28 <peter1138> mismatching names for the same function
23:19:25 <Samu> there's a lot of places it's being used and re-used
23:20:22 <Samu> i think aystar, inside NPF, uses int for that value
23:20:58 <Samu> it sometimes looks if the value is = -1, not entirely sure
23:22:49 <Samu> if (new_g == AYSTAR_INVALID_NODE) return;
23:22:57 <Samu> AYSAR_INVALID_NODE is == -1
23:24:12 <Samu> new_g is the cost of something, forgot exactly what
23:25:05 <Samu> case TRANSPORT_RAIL: _npf_aystar.CalculateG = NPFRailPathCost; break; case TRANSPORT_ROAD: _npf_aystar.CalculateG = NPFRoadPathCost; break; case TRANSPORT_WATER: _npf_aystar.CalculateG = NPFWaterPathCost; break;
23:25:16 <Samu> ah, cost of the node, yeah, it's always positive then
23:27:18 <Samu> is this the reason why NPF is slow? it's doing uint to int conversions all the time?
23:28:38 <Zuu> Slowness in programs in general comes from algorithms, not type casts or not using bit shifts etc.
23:38:43 <Samu> regarding ships, npf is slow but not annoiyng, opf is slow and random but not annoying, yapf is best but with annoying "ship it lost" brief popups
23:47:31 <Samu> gonna experiment something with NPF, try to feed it two-way
23:47:38 <Samu> see if that makes him faster
continue to next day ⏵