IRC logs for #openttd on OFTC at 2017-08-20
⏴ go to previous day
00:26:30 *** Progman has joined #openttd
00:44:27 *** supermop_home has joined #openttd
01:13:15 <Shoshonite> Does anyone know where the Oil Refinery sprites are hidden from OpenGFX I can't even find a reference to them in the Sauce
01:43:26 *** JacobD88 has joined #openttd
01:44:39 <Sylf> You'll need to look in the source. No sauce or salsa or soup will contain those sprites.
02:20:49 <wroom> anyone knows where to find more info about writing AI scripts?
03:01:03 *** supermop has joined #openttd
03:11:47 *** supermop has joined #openttd
03:14:29 *** supermop_home has joined #openttd
03:38:52 *** luxtram has joined #openttd
03:40:58 *** orudge` has joined #openttd
03:40:58 *** ChanServ sets mode: +o orudge`
04:06:39 *** orudge` has joined #openttd
04:06:39 *** ChanServ sets mode: +o orudge`
05:40:15 *** sim-al2 is now known as Guest2886
05:40:16 *** sim-al2 has joined #openttd
05:41:04 *** supermop_home has joined #openttd
07:13:09 *** Alberth has joined #openttd
07:13:09 *** ChanServ sets mode: +o Alberth
07:29:14 *** orudge` has joined #openttd
07:29:15 *** ChanServ sets mode: +o orudge`
07:31:49 *** sla_ro|master has joined #openttd
07:43:08 *** supermop has joined #openttd
07:44:14 *** chomwitt has joined #openttd
07:48:28 <V453000> assembling giant list is really fun to debug
07:50:06 <Alberth> can't you make the sub-lists smaller temporarily? eg insert sub_list = [''stuff xyz"]
07:50:42 <Alberth> or split assembly out into a separate function that takes all the sublists
07:50:56 <Alberth> so you can develop and test it separately
07:53:28 <V453000> I found the issue, just added some debug code :)
07:54:20 <Alberth> the alternative is pdb, a debugger, but that works better if you have to closely follow all the steps it takes
07:54:47 <V453000> haha well I basically do that, I just put the debug function in every step :D
07:55:49 <Alberth> interactive command line to step through each line, print vars, etc
07:57:05 <Alberth> :O it's even readable :p
07:57:27 <Alberth> I usually do stuff like print(n, len(lst))
07:57:38 <V453000> yeah well I don't test it separately
07:57:42 <V453000> so I need readability
07:57:54 <V453000> as there are other things printed all over the place
07:58:11 <Alberth> ah, too much output :p
07:58:25 <V453000> now I need to see how the F do 257 items appear in the list
08:03:13 *** andythenorth has joined #openttd
08:03:23 <Alberth> more python lovers, o/
08:16:03 * andythenorth has never learnt pdb
08:16:14 <andythenorth> print(foo) covers all evil
08:17:55 <Alberth> last time I had a 15-20 'if' statements, and one of them fired, and I needed to know which one, and why
08:18:22 <Alberth> startup took 6 minutes, so I didn't want to do many runs :p
08:29:12 <andythenorth> ok so I’ve rage quit on reviewing bugs :D
08:29:19 <andythenorth> well, more just quit
08:29:27 <andythenorth> bugs / patches /s
08:29:50 * andythenorth now looking at the 161 bugs in FS
08:29:51 <Alberth> yeah, it's complicated
08:30:29 <Alberth> yes, reviewing is complicated
08:30:36 <andythenorth> it’s above all just boring
08:31:14 <Alberth> code isn't so bad to review, or figuring out if it is proper is also somewhat doable, but deciding whether it is a good addition is a nightmare
08:31:20 <andythenorth> working on stuff I want for the game ~= doing other fun life things > working on stuff other people want for the game
08:31:44 <Alberth> for most stuff, the entire idea is quite alien to me
08:32:09 <andythenorth> it’s also way too much like work
08:32:42 <andythenorth> 2 out of 75 patches interest me
08:32:45 <andythenorth> and one is just a typo
08:32:53 <andythenorth> in translation keys
08:32:57 <andythenorth> but code quality is important :)
08:33:05 <Alberth> that typo thing does get in the way, doesn't it? :p
08:33:59 <Alberth> :O a real one, how nice
08:34:02 <andythenorth> presumably changing a lang string ID breaks all current translations?
08:35:19 <Alberth> no, wolf also changed the string names in the translations
08:41:37 *** HerzogDeXtEr has joined #openttd
08:41:37 <peter1138> yes that patch wasn't satisfactory
08:45:38 <Alberth> hmm, how did wolf miss src/lang/frisian ?
08:48:13 <andythenorth> some bugs get closed as ‘this is a total tarpit’
08:48:31 <andythenorth> where even diagnosing the issue outweighs any possible benefit
08:50:00 <Alberth> timetables **are** very broken
08:50:32 <andythenorth> they’re just a wrong concept
08:50:42 <andythenorth> but my prejudice against them is on record :P
08:50:52 <Alberth> not sure, they do keep the vehicles somewhat spread out over the entire route
08:51:03 <andythenorth> except when they break...
08:51:17 <Alberth> which beats clumping up, so only the first vehicle makes any profit
08:51:29 <Alberth> oh, you need loads of slack :p
08:51:42 <Alberth> and lots of patience to get themselves sorted out
08:51:52 <andythenorth> I just wonder who, ever, might sit and diagnose that bug :)
08:51:54 <Alberth> and a place where they can pass each other
08:51:58 <andythenorth> and what’s gained by fixing it :)
08:52:03 *** mescalito has joined #openttd
08:52:21 <Alberth> I use it mostly in pax & mail services
08:52:32 <Alberth> where you just run around
08:52:37 <andythenorth> file failed to download, once
08:52:52 <andythenorth> which given upstream issues, transient connectivity failure etc
08:53:01 <andythenorth> or local filesystem errors
08:53:08 <andythenorth> is imho a tarpit
08:54:10 <Alberth> yeah, the error cause is not trackable
08:54:22 <Alberth> but "error window not on top" is something we might want to fix
09:05:35 <Alberth> perhaps an interaction between sea level and rough land or so
09:05:45 <Alberth> but it's nice swamp-ish land :p
09:07:15 <andythenorth> no repro, no fix :)
09:07:16 <Alberth> :O frisian isn't even used
09:09:46 <andythenorth> is there any way to see map settings on a save?
09:09:57 <andythenorth> I want to try and repro from the attached save on 6216
09:11:19 <DorpsGek> Commit by alberth :: r27894 /trunk/src (55 files in 3 dirs) (2017-08-20 09:11:08 +0200 )
09:11:20 <DorpsGek> -Fix [FS#6608]: Typo fix in STATIOV_* string names (Wolf01)
09:11:43 <Alberth> likely they are stored in the variables you can see in the console
09:12:12 * andythenorth had better learn to debug better
09:14:26 <andythenorth> ok, using same seed as save in 6216, I can’t repro
09:14:32 <andythenorth> I don’t have exact settings
09:14:41 <andythenorth> also, not being able to copy-paste in console
09:15:06 <Alberth> you also need the exact same version
09:15:15 <Alberth> seed is version dependent
09:15:39 <andythenorth> ok, well I’m not going back to 1.5.0 beta to repro :)
09:15:48 <andythenorth> it doesn’t happen in 1.7.1 or 1.6.1
09:16:11 <Alberth> at least not trivially reproducible :p
09:16:39 <andythenorth> we’d have reports if it was frequent
09:16:58 <Alberth> the general landscape is a major step forward compared with the original terrain generator, so who's complaining :)
09:17:19 <andythenorth> are you saying “Feature not bug”? :P
09:18:40 <andythenorth> it’s a bit of a second class environment for developers eh?
09:18:58 <andythenorth> not much in the way of tests
09:19:28 <andythenorth> no known-good test data (or known-bad test cases)
09:19:40 <Alberth> /me ponders linking the "most tests are useless" article :p
09:19:50 <andythenorth> functional tests aren’t useless
09:20:04 <Alberth> there are a few regression tests in the AI area
09:21:23 <andythenorth> one of the most valuable things I’ve seen is known-good content
09:21:33 <andythenorth> in ottd, that would be savegames
09:22:27 <Alberth> yeah, I do such tests too at work
09:22:46 <Alberth> but it mostly works if you have a quick decision check
09:23:21 <andythenorth> I haven’t made any so far because I’d break them all the time
09:23:30 <andythenorth> my usual case is testing newgrf
09:23:43 <Alberth> defining "it's correct" in an openttd game is far from trivial
09:23:51 <andythenorth> so, e.g. testing FIRS production means setting up vehicle routes, running the game blah blah
09:23:59 <andythenorth> but then I break the savegame with changes :P
09:24:11 <Alberth> factorio builds and runs such tests
09:24:34 <Alberth> probably by executing some script to build the setup
09:24:48 <Alberth> and deciding by something happening
09:28:19 *** supermop_home has joined #openttd
09:42:09 <Wolf01> "Missed the 'src/lang/frisian.txt' file, but it seems that isn't even compiled." <- I don't even have it
09:43:06 <Alberth> clearly, but no idea what's happening
09:43:25 *** Progman has joined #openttd
09:43:35 *** supermop_home_ has joined #openttd
09:44:33 <Alberth> it's src/lang/unfinished/frisian.txt
09:45:25 <Alberth> svn reports it as a file in the VCS
09:46:07 <Wolf01> Oh, VS can't find those one
09:46:08 <Alberth> as you had all other unfinished languages in the patch
09:46:49 <Wolf01> I think they are excluded from the solution
09:47:13 <Alberth> it is, the file isn't build by strgen
09:47:46 <Wolf01> Shit, I can't rely on IDE file search
09:48:52 <Alberth> clearly, you must have all files marked as part of the project, or they don't exist :p
09:49:09 <Wolf01> Even with "show all files
09:50:14 <peter1138> bash + vim isn't an IDE?
09:50:43 <Alberth> they like to make their own wheel
09:51:41 <Alberth> in particular OS manufacturers that believe a computer is a useful tool without a compiler on it
09:53:29 *** orudge` has joined #openttd
09:53:30 *** ChanServ sets mode: +o orudge`
09:55:12 <Wolf01> It's an OS for the masses ;)
09:57:02 <Alberth> such a shame, using it as just a glorified type writer
09:58:34 *** supermop_home has joined #openttd
09:59:48 *** supermop_home_ has quit IRC
10:01:51 *** frosch123 has joined #openttd
10:04:15 *** sim-al2 is now known as Guest2901
10:04:16 *** sim-al2 has joined #openttd
10:13:16 *** supermop_home_ has joined #openttd
10:15:32 <andythenorth> Wolf01: what did I miss? o_O
10:16:00 <Wolf01> Oh no, it's right, I just found twice the same result as I looked for the string
10:16:51 <Alberth> language files are in some other part?
10:17:58 <andythenorth> yeah that one should go in imo
10:19:42 <Alberth> don't bother, I'll add it
10:19:59 <andythenorth> I already did it
10:20:11 <andythenorth> it’s interesting have ‘with patch’ and ‘patch’ as status and type
10:20:22 <andythenorth> bug trackers are always confusing :)
10:20:41 <andythenorth> admin is my main job :P
10:20:56 <andythenorth> how do I set the game seed?
10:21:13 <andythenorth> I can’t find a console command to set the seed
10:21:25 <Wolf01> Patch type is confusing... patch for what? Feature? Bug? Just codechange?
10:21:25 <andythenorth> there is EBKAC somewhere
10:21:33 *** ToBeFree has joined #openttd
10:22:50 <Wolf01> I marked mine as "feature request" and I would have set the status as "with patch" but I have a branch for it instead
10:23:04 <andythenorth> eh, 6604 is dull, I’m not exploring that any further :P
10:24:02 <Wolf01> Set the seed via console (set generation_seed N) <- OMG there it is
10:25:08 <andythenorth> but there’s not copy-paste and no tab-complete
10:25:24 <andythenorth> I’m not sitting typing all that out to reproduce his 5 different cases
10:25:30 * andythenorth makes way too many typos for that
10:25:46 <Wolf01> You could use "1" as seed
10:26:28 * andythenorth looking for other FS
10:26:34 <Wolf01> I'm going to try it with the tropic tgp change
10:27:27 <andythenorth> anyone got 4K monitor? :P
10:27:54 *** supermop has joined #openttd
10:28:08 <DorpsGek> Commit by alberth :: r27895 trunk/src/vehicle_gui.cpp (2017-08-20 10:28:05 +0200 )
10:28:09 <DorpsGek> -Fix [FS#6606]: Tooltip of 'increase service interval' said 'decrease' (adf88)
10:28:18 <Wolf01> <andythenorth> but there’s not copy-paste and no tab-complete <- are you kidding? I've just done it
10:28:34 *** supermop_home has joined #openttd
10:28:40 <andythenorth> what am I doing wrong? o_O
10:29:02 <andythenorth> oh so there’s paste
10:29:09 <andythenorth> but not copy, because no text caret?
10:29:43 <andythenorth> is inflation a supported feature?
10:30:02 * andythenorth would sunset inflation w.r.t fixing it
10:30:18 <andythenorth> it’s fundamentally broken, and minor fixes are a waste of time
10:30:56 <Wolf01> OK, SE doesn't obey to the seed too
10:31:38 <Wolf01> Tried setting it after and before clicking on "random land"
10:33:28 <Alberth> making inflation somewhat configurable might not be a bad idea
10:33:34 *** supermop_home_ has quit IRC
10:33:40 <Alberth> users could then tune the disaster :p
10:34:10 <Wolf01> Ok, I know what to do: add a seed textbox and only save the seed in settings when confirmed
10:34:17 <Alberth> but I just turn it off, I am not interested in money
10:34:17 <andythenorth> Alberth: part of ES :P
10:34:22 <andythenorth> I turn it off too
10:34:27 <andythenorth> game does not need inflation
10:34:33 <andythenorth> did TTD have it?
10:35:22 <andythenorth> so the OpenTTD innovation was to enable disabling it :P
10:36:05 <Alberth> I don't know if it was configurable in TTD, probably not
10:36:22 <Alberth> or it was linked to bank interest rate or so
10:37:14 <andythenorth> I would delete it
10:37:20 <andythenorth> I know I say that about everything it
10:37:26 <andythenorth> but I am serious about this one
10:37:38 <andythenorth> even though it violates a core game goal (preserving TTD gameplay)
10:37:48 <andythenorth> it causes bug reports that no-one is interested in fixing
10:37:59 <andythenorth> and it also causes bug reports for newgrf authors
10:38:12 <andythenorth> delete, migrate savegames to just drop it
10:38:14 <Alberth> we also get bug reports about stupid default vehicle set
10:38:42 <andythenorth> sometimes things need killed with fire
10:39:33 <andythenorth> I will field the brief inevitable whining if someone else does the rm
10:40:36 <andythenorth> an alternative is to move it to newgrf / GS
10:40:41 <andythenorth> but I think it’s TMWFTLB
10:42:26 * andythenorth wonders how it currently works
10:42:42 <andythenorth> presumably there’s an inflation factor applied to every cost calc
10:42:56 <Wolf01> >_> seed gets overwritten somewhere
10:43:00 <andythenorth> probably I look for CMD_COST or so
10:47:47 <Wolf01> Boys... GenerateWorld was called with "reset settings = true" in SE
10:48:40 <Wolf01> Now I understand why a lot of stuff I set between tests got reset
10:50:21 <Wolf01> BTW, it resets the seed anyway, even with that set as false
10:51:03 <andythenorth> is that desirable? o_O
10:51:10 <Eddi|zuHause> what would not resetting the seed help? the seed gets changed every time you generate a random number
10:51:14 <andythenorth> seems odd to have console commands for settings, then throw them away?
11:00:06 <andythenorth> if I can get to 420 without cheating
11:00:17 <andythenorth> that’s ~50% of the number at start of August
11:02:41 <Wolf01> How do I properly debug the seed? It always shows -290403268
11:03:41 <Alberth> likely there are at least 2 seeds, one in the configuration, and one that is used in the random number generator
11:04:23 <Alberth> if you load a game, probably even 3
11:04:37 <Alberth> but basically, find uses
11:04:55 <Alberth> setting a watch on reading or writing may also work
11:05:15 <Wolf01> No, I mean, what to set in DEBUG() as number placeholder
11:05:49 <Alberth> yeah, I would guess printf-style
11:06:14 <Eddi|zuHause> but i always forget printf stuff
11:17:25 <Wolf01> Ok, I could set what I want to game_config, it always discards game_config and copies it from newgame_config
11:20:39 <Wolf01> Not according to this comment: /* Copy all XXX_newgame to XXX when coming from outside the editor */
11:20:47 <Wolf01> I'm still inside the editor
11:21:57 <Wolf01> That is in StartGeneratingLandscape()
11:22:31 <Wolf01> And doesn't check where we are or were we are coming from
11:23:45 <Alberth> on entering the SE it gets copied too? Otherwise you have no sane start values
11:24:03 <_dp_> yeah that game/newgame thing always looked like a bug incubator to me
11:24:27 <_dp_> in every function changing settings you need to keep track in which context is it executed
11:24:41 <_dp_> and never call one fuction in two contexts if it's not prepared
11:25:54 <Wolf01> That's why I wanted to switch to a singleton with accessors, and do that logic there and only there
11:26:40 <_dp_> Wolf01, singleton is just a fancy name for a global :p
11:26:44 <Wolf01> No more _game_mode changes but X.ChangeGameMode(GM_EDITOR)
11:26:58 <Wolf01> Yes, but it's not a variable without any control
11:27:15 <Wolf01> And the logic must be done there
11:27:26 <Alberth> making it an object-like thing with methods helps a lot
11:27:26 <Wolf01> So you know it always behave the same way
11:28:06 *** FLHerne has joined #openttd
11:28:16 <Alberth> also "foo = new Foo()" and passing foo to everybody, is just as global, it's just more clear who gets it
11:28:22 <Wolf01> I started with _game_mode and works fine, but with _switch_mode I have some problems, since it seem deferred
11:28:45 <Alberth> yeah, switching game modes is weird to say the least
11:28:50 <_dp_> well, yeah, I guess it's slighly better
11:28:57 <_dp_> but still not very testable, etc.
11:28:58 <Wolf01> As you do _switch_mode = XYZ ... logic ... SwitchToMode()
11:29:54 <Eddi|zuHause> i think frosch123 had some "newgrf utopia" thing, which needs proper contexts where you can test stuff
11:31:44 <_dp_> actually, I did pretty much the same to citymania/luukland server, moving everything to one superclass and having just one _game global
11:34:31 <_dp_> but that's about the only viable solution there, I don't want to change interfaces of vanilla functions, that would be a disaster to merge
11:34:45 *** orudge` has joined #openttd
11:34:45 *** ChanServ sets mode: +o orudge`
11:36:02 <_dp_> Wolf01, I'd opt for a single _globals instance instead of statics class, would be easier to unglobal it later
11:36:21 <Wolf01> You can't put logic in variables
11:36:44 <_dp_> _globals.is_game_mode(GM_NORMAL)
11:36:55 <Eddi|zuHause> uhm, yeah you can, it's called "class"
11:37:41 <Alberth> IsGameMode, but indeed
11:38:26 <_dp_> oh, I forgot methods are camel case too in openttd
11:41:14 <Wolf01> I would like to work with an IoC Container
11:41:26 <Wolf01> And everything as a service
11:41:44 <Wolf01> Then for tests you mock the services in the container
11:43:00 <Wolf01> The only global thing then would be the container itself
11:43:24 *** supermop_home_ has joined #openttd
11:58:15 *** supermop_home has joined #openttd
12:02:32 <Wolf01> I still have a lot of confusion on using the * in c++
12:03:41 *** supermop_home_ has quit IRC
12:04:23 <Alberth> you know that a pointer has 2 values, the address it points to, and the value it points at, right? * dereferences to the latter
12:04:36 <Alberth> in types, * means "pointer to this type of data"
12:05:18 <Alberth> arrays are mostly red herrings, they are just pointers created by the compiler, that also have their element count remembered
12:05:37 <Alberth> only other use of * is for multiplication :p
12:07:19 <Alberth> p-> is equivalent to (*p).
12:07:41 <Alberth> and p[x] is equivalent to *(p+ x)
12:09:07 <Alberth> s/element count/size/
12:09:42 <_dp_> for me hardest thing is usually to choose between passing pointer and passing reference :)
12:11:28 <_dp_> and c++11/14 doesn't help at all with all the &&
12:11:42 <milek7> i think references are only c+ sugar
12:12:51 <_dp_> milek7, many other languages have references, they just don't usually come together with pointers)
12:13:17 <Alberth> references should be used if the parameter is never nullptr
12:14:02 <_dp_> Alberth, sometimes it gets awkward to use reference when everything around uses pointers
12:14:21 <milek7> also don't use gcc, not enough warnings
12:14:23 <Alberth> yep, you have that with legacy C code :p
12:14:46 <Alberth> milek7: -Wall helps a lot
12:15:47 <milek7> and -Wextra, but clang is better anyway
12:16:56 <Alberth> ok, outside is inviting me to join the sun, which I am going to try for a few hours
12:18:03 <milek7> int main() { int m = 5; std::cout << "m: " + m << std::endl; }
12:18:57 *** Wormnest has joined #openttd
12:20:34 *** Stimrol has joined #openttd
12:32:10 <Wolf01> Meh... class Globals *_globals already defined everywhere, what am I missing?
12:33:39 <Wolf01> Also Globals &operator=(const Globals&); "function for operator= not found"
12:40:20 <Wolf01> Could be an intellisense bug
12:43:21 *** supermop_home has joined #openttd
12:51:00 <Wolf01> Ok, I think I found the right order to define variables
12:52:45 <Wolf01> Nope, I must be stupid
12:55:02 <Wolf01> Now I just have unresolved esternals
12:57:34 <frosch123> but a "external Foo _bar;" into one header, and put a "Foo _bar;" into *one* source
12:58:25 <Wolf01> Still 1 unresolved external
13:00:04 <Wolf01> If only it says where it is missing
13:00:44 <frosch123> my compiler usually gives a source file
13:01:05 <Wolf01> It's a linker error... it gives openttd.exe
13:01:59 <Wolf01> Severity Code Description Project File Line Suppression State
13:01:59 <Wolf01> Error LNK2001 unresolved external symbol "private: static class Globals * Globals::instance" (?instance@Globals@@0PAV1@A) openttd E:\progetti\OpenTTD\wolfolo\projects\openttd.obj 1
13:02:31 <_dp_> Wolf01, did you put it in a new cpp file?
13:03:06 <milek7> it's static, do you defined it in cpp?
13:03:06 <Wolf01> (and it shouldn't be there)
13:03:29 <Wolf01> It's static inside the class
13:03:29 <_dp_> Wolf01, that's extern, where is the definition inself? it has to be in cpp
13:05:00 <Wolf01> Class definition is in openttd.h
13:05:51 <Wolf01> If I move it to cpp it throws any kind of error, like missing ; or type specifiers
13:06:16 <milek7> you need Globals *Globals::instance in any cpp
13:08:18 *** orudge` has joined #openttd
13:08:18 *** ChanServ sets mode: +o orudge`
13:09:57 <_dp_> Wolf01, static in class in only declaration, you need definition in some cpp as well.
13:13:38 <Wolf01> It's not a static class, it's a singleton, it just returns a single instance
13:14:10 <V453000> weird, if I make one arg default to True, it stops accepting the -r False from console. I tried changing it to int so it was -r 0 but that fails as well. As soon as I make the thing default to 0 / False, it works. :0 Any random ideas? :D
13:15:13 <_dp_> Wolf01, instance variable is declared as static in your class, right? but that doesn't define it, you define variables in cpp, not h files
13:15:39 <Wolf01> The instance variable is internal to the class
13:16:08 <_dp_> Wolf01, still needs to be defined somewhere
13:16:16 <frosch123> Wolf01: you are doing c++, not java
13:16:41 <Wolf01> Fuck c++ private members defines outside of the class
13:16:52 <frosch123> you must define all static members, public/private makes no difference whatsoever
13:19:33 <_dp_> it's easier to grasp if you think how #include works, it pretty much just inserts text of h file in that place
13:19:52 <_dp_> if you have definition in h file and include it from two places you'll get two copies of variable
13:19:53 <Wolf01> No, I can't understand how "static" works
13:22:26 <Wolf01> Ok, now I have type redefinition...
13:36:38 <Wolf01> /* static */ Globals *Globals::instance; <- 'instance': is not a member of 'Globals'
13:37:27 <Wolf01> I think the worst part of c++ is that it isn't like java
13:40:03 <_dp_> Wolf01, check BasePersistentStorageArray in newgrf_storage.h/cpp it has some static members
14:10:04 *** supermop has joined #openttd
14:13:09 *** supermop_home has joined #openttd
14:14:32 <milek7> Wolf01: include header containing declaration in that cpp
14:16:42 *** orudge` has joined #openttd
14:16:42 *** ChanServ sets mode: +o orudge`
14:21:21 <_dp_> Wolf01, ofc it is redefinition look at any other class in openttd :P
14:21:33 <_dp_> Wolf01, there can't be two class Globals { }
14:22:12 <milek7> delete that Globals { from cpp
14:22:23 <_dp_> and use bool Globals::IsGameMode(GameMode mode) {} to define members
14:24:23 <Wolf01> Shit, I must inherit to implement methods this way
14:25:24 <_dp_> Wolf01, wut? how does inheritance get here?
14:25:40 <Wolf01> The definition in .h is like an interface
14:27:08 <V453000> omg fancy haz 7 debug levels :D
14:27:21 <_dp_> Wolf01, yeah, it mostly declares things. but inheritance is a completely diffenet thing, it's a way do define another class, while you seem to still be struggling with just one :p
14:28:25 *** supermop_home_ has joined #openttd
14:28:54 *** orudge` has joined #openttd
14:28:55 *** ChanServ sets mode: +o orudge`
14:33:22 <Eddi|zuHause> Wolf01: if you think inheritance is the solution to your problem, you probably need to take a few steps back and rethink the concepts you're trying to implement
14:35:11 <Eddi|zuHause> (this is basically why my professor thought teaching OOP with C++ is a bad idea)
14:35:41 <Wolf01> Yes, I'm starting to think that too
14:35:42 <Eddi|zuHause> (because sometimes the C++ way of doing things is not the optimal way of doing things)
14:36:52 <Wolf01> Ok, back to the unresolved external symbol "private: static class Globals * Globals::instance" (?instance@Globals@@0PAV1@A)
14:37:14 <Wolf01> At least now it doesn't throw any weird error
14:37:36 <Wolf01> And I have declaration in .h and implemented the methods one by one in .cpp
14:38:04 <_dp_> Wolf01, literally, just put "Globals * Globals::instance" in cpp
14:38:16 <_dp_> Wolf01, but don't remove anythig
14:39:19 <Wolf01> I really can't understand that, is the compiler so stupid it can't do it by itslef?
14:39:35 *** orudge` has joined #openttd
14:39:35 *** ChanServ sets mode: +o orudge`
14:39:43 <milek7> no, maybe you want to assign initialization value
14:39:59 <_dp_> also you need to specifi which translation unit it belongs to
14:40:02 <michi_cc> Wolf01: Why do you need a singleton and a global instance at the same time? ('Singleton' is just a fancy dress up name for global anyway.)
14:40:26 <Wolf01> Because I'm doing it step by step
14:40:33 <_dp_> putting it in a class is just a promise that you'll define it somewhere later.
14:40:58 <michi_cc> Oh, and for . vs ->, don't look at c++ operator overloading :)
14:42:45 <Eddi|zuHause> <Wolf01> I really can't understand that, is the compiler so stupid it can't do it by itslef? <-- so, do you get into a stickshift car and then complain that it's too stupid to switch gears automatically like other cars?
14:43:04 *** supermop_home has joined #openttd
14:43:58 <Wolf01> No, I would complain if I should tell the shift what cog to move and in which position I want it
14:44:12 <Wolf01> The shiftstick hides all that to me
14:44:25 <Wolf01> The automatic drive is only another facade to it
14:44:39 *** supermop_home_ has quit IRC
14:45:39 <michi_cc> On a serious note, yes, the compiler really is that stupid because it doesn't have the required information. The *linker* could clean it up (and has to do it in case of template stuff), but that really is more of a kludge than a proper solution. Gets somewhat hairy if you mix and match different object files.
14:45:58 <_dp_> Wolf01, as c++ doesn't ask you the memory offset to put that variable to
14:46:07 <Eddi|zuHause> Wolf01: the point is, while moving from stickshift to automatic makes things easier, you also give up other features that people actually might want (like manually choosing whether to maximise torque or lowering fuel consumption)
14:46:40 <michi_cc> E.g. what should the linker do if one object file has the variable intialized by 0 and another by 1?
14:47:27 <Wolf01> In this case it shouldn't, also, I should initialize it to nullptr in one place and not touch it anywhere else
14:47:49 *** mindlesstux has joined #openttd
14:48:52 <_dp_> Wolf01, that's exactly what's happening in c++, you initalize it in cpp file and don't touch (define) anywhere else
14:49:24 <_dp_> Wolf01, but you still need to declare that such variable exists so other parts of program could use it.
14:50:13 <milek7> headers are most annoying thing in c++, but maybe this will change with imports
14:50:17 <Wolf01> But that behavior should be defined by the definition, because in this case it relies on that, and no, other parts of the program shouldn't use it because is private
14:51:19 <Eddi|zuHause> Wolf01: the trouble with C++ is, you need to put the private declarations in the public .h file, you can't separate it
14:51:35 <_dp_> Wolf01, you can have methods of same class defined in different translation units (~= cpp files) iirc
14:52:12 <Wolf01> _dp_: Yes, I'm fine with that
14:52:17 *** orudge` has joined #openttd
14:52:17 *** ChanServ sets mode: +o orudge`
14:53:05 <Wolf01> It's what Eddi said which it doesn't look right to me
14:53:13 <Eddi|zuHause> Wolf01: and you can't (sensibly) put definitions in .h files (because that definition would be duplicated in every translation unit)
14:53:58 <_dp_> also part of the problem is that in class X {} you define class but not necessarily it members
14:54:03 <Wolf01> Like that is what I want to do
14:54:31 *** luxtram has joined #openttd
14:54:37 <_dp_> Eddi|zuHause, except that sometimes you can (like inline)
14:55:42 <milek7> and sometimes you must ;p (like templates)
14:57:01 <Eddi|zuHause> yeah, C++ is silly :p
14:57:19 <_dp_> sometimes c++ is very confusing just because it's like 3 different languages in one
14:57:27 <Wolf01> Silly language, silly CVS... does that make OTTD a silly game?
14:57:41 <milek7> template error messages are the worst
14:57:43 <_dp_> in c++ they had to put object system in a way that's compatible with c linkage
14:59:07 <_dp_> and in c++11/14 things got even crazier
15:01:12 <Wolf01> Now I should add all those _global_variable to it
15:02:31 <Wolf01> Maybe move the definitions on a new file too, to keep openttd.cpp clean
15:03:23 <milek7> templates are imo bad design, interface-based generics would be better
15:05:52 <_dp_> it hard to judge c++ design since every small detail has a lot of reasons behind it
15:06:00 <_dp_> backwards compatibility takes a toll
15:07:35 <milek7> eh, but you usually don't call c++ members from c code
15:07:59 <_dp_> milek7, you call c ones from c++
15:08:17 <_dp_> milek7, and even other language ones
15:08:48 <milek7> but they are just function with arguments and return value
15:08:59 <milek7> no c++, virtual, objects, etc. magic
15:11:03 <_dp_> milek7, you mean why keep obj files backwards compatible?
15:11:41 <_dp_> dunno, but there must be a lot of reasons :p
15:12:36 <_dp_> probably because of dynamic linkage stuff
15:15:22 <michi_cc> The first C++ compiler (Cfront) compiled to *C*, not to object code. A lot of now historical baggage is probably due to that (e.g. the requirement to fit into the C linking model).
15:26:39 <Eddi|zuHause> what's wrong with c++ templates?
15:28:07 <milek7> that they don't require to specify interface-class
15:28:26 <_dp_> Eddi|zuHause, imo "is there anything right about them" is a better question :p
15:28:31 <milek7> and that usually causes horrible error messages
15:29:14 <milek7> and that they must be compiled for each spectialization
15:29:37 <_dp_> they finally fixed >> syntax so I guess that's one fine thing about them :)
15:30:06 *** luxtram has joined #openttd
15:30:27 <milek7> i think that if they required abstract interface-class they could be compiled only once
15:32:29 <milek7> but that can be done without templates
15:32:41 <milek7> so i think that templates aren't necessary at all ;p
15:39:43 <Eddi|zuHause> milek7: but you need templates for cases where you DON'T want a class/inheritance
15:41:25 <Eddi|zuHause> milek7: opposing to OOP/inheritance, which resolves at runtime, templates resolve at compile time
15:41:47 <Eddi|zuHause> milek7: which is what makes YAPF 10 times faster than NPF
15:45:25 *** Alberth has joined #openttd
15:45:25 *** ChanServ sets mode: +o Alberth
15:46:16 *** sim-al2 is now known as Guest2918
15:46:18 *** sim-al2 has joined #openttd
15:47:05 *** mindlesstux has joined #openttd
16:03:11 <supermop_home> should i steal people from japan stations to put in these trams?
16:04:47 <Eddi|zuHause> depends on your value of "steal"
16:05:06 <supermop_home> I believe its a gpl set
16:05:22 <supermop_home> but i wonder if the people will look good in a tram
16:07:22 <Wolf01> Heh... identifier byte undefined... yes
16:22:06 <Eddi|zuHause> wrong order of .h files?
16:22:14 <Wolf01> Nah, missing stdafx.h include
16:23:09 <Wolf01> Also yes, wrong order since the error was shown in globals.h and stdafx was included in .cpp
16:27:21 <Wolf01> What's up with spanish.txt and spanish_MX.txt? Regenerate projects swapped all the entries
16:30:32 <_dp_> shouldn't stdafx only be included in cpp files?
16:30:56 <Wolf01> It's where I included it
16:37:34 *** orudge` has joined #openttd
16:37:35 *** ChanServ sets mode: +o orudge`
16:38:17 *** synchris has joined #openttd
16:39:01 *** gelignite has joined #openttd
16:50:29 *** orudge` has joined #openttd
16:50:31 *** ChanServ sets mode: +o orudge`
16:57:07 <_dp_> more I try to use admin port more I want to throw it out and write my own
17:13:15 *** orudge` has joined #openttd
17:13:15 *** ChanServ sets mode: +o orudge`
17:22:57 <_dp_> omg, smiles in commit messages
17:23:44 <Wolf01> They are cool, but meh
17:27:07 <Wolf01> Uhm, if I move the transparency options into Globals all that remains is the transparency enum
17:28:06 <milek7> what's wrong with many globals?
17:28:56 <Wolf01> Read log from 6 hours ago
17:29:03 <_dp_> milek7, like, everything?
17:29:13 <_dp_> milek7, no testability, no clear state
17:29:48 <Wolf01> Also, how *BAD*is to define transparency methods in a different .cpp file? Globals as sparse class
17:34:12 <_dp_> Wolf01, you mean declare them in globals, but define in different cpp files like they are now?
17:35:22 <_dp_> Wolf01, this whole thing with globals isn't quite right still so it's hard to tell how is it better to do it xD
17:35:26 *** andythenorth has joined #openttd
17:35:43 <_dp_> Wolf01, I'd say yes, leave in different files so it's still kind of logically groped together
17:35:50 <Wolf01> Since is clear now that you have to define method by method I would take advantage about it
17:36:35 <Wolf01> And yes, if you go on globals.h you have all the declarations there
17:42:04 <supermop_home> ok finally drew all these tram bit
17:42:18 <supermop_home> well like half, but enough to start
17:42:42 <supermop_home> half the generations will have to share sprites with the prior one for now
17:44:56 <Alberth> one gets the even pixels, the other the odd pixels
17:50:30 <Wolf01> HasBit(_transparency_lock, i) <- could I convert this to _global->IsTransparencyLockSet((TransparencyOption)i)?
17:55:05 <Wolf01> Mmm no, the functions check to not be in the menu
17:56:14 <Wolf01> I might need 2 sets of functions or a parameter
17:57:33 <Wolf01> I make 2 sets of functions instead of changing the logic, it would be easy to replace them later
18:00:23 <__ln___> is there something worth seeing in Passau?
18:01:36 <_dp_> Wolf01, btw, there is SwitchToMode which is also a bit different from _game_mode = ...
18:02:35 <Wolf01> Yes I know, I'm still trying to find some good logic to replace that
18:05:09 <_dp_> probably good idea to leave them be for now
18:05:10 <V453000> is there any reason at all why a palette converter should care about the windows palette for ttd?
18:05:15 <V453000> I always used the DOS palette
18:05:34 <_dp_> like, things can easily crash if you replace _switch_mode = .. with SwitchToMode
18:06:10 <Wolf01> V453000: I think you can use the one you want as OTTD automatically loads it with the right palette
18:06:38 <V453000> but if you are making a script for others to use it is good to know if WIN palette is ever useful
18:06:42 <V453000> because I don't remember it being useful
18:06:52 <V453000> it has a few extra grays or something I think
18:07:11 *** Maraxus has joined #openttd
18:07:36 <V453000> idk I will just ignore it
18:08:26 <Wolf01> _dp_: yes, I already had a close encounter with that
18:09:36 <andythenorth> V453000: WIN palette is LOSE
18:09:50 <andythenorth> iirc, it has less greys
18:09:54 <andythenorth> due to windows stealing some
18:10:03 * andythenorth might be spreading prejudice, not facts
18:10:48 <Wolf01> Only because you use OS X
18:13:55 <Eddi|zuHause> V453000: WIN palette has a few extra magic pinks, and shuffled around the greys, while removing some colours. you should ignore it
18:18:05 * andythenorth looking for rude emojis to send back to Wolf01
18:18:09 <andythenorth> can’t find any good ones :P
18:21:43 <supermop_home> is running cost per articulated part?
18:22:27 <Eddi|zuHause> supermop_home: most things on articulated parts have no effect
18:22:41 <Eddi|zuHause> supermop_home: and should be set to 0
18:32:49 *** Prof_Frink has joined #openttd
18:44:09 <Alberth> that hunk was rejected, have a look at the source file, and insert the two lines manually
18:45:06 <Alberth> likely some code was added to the destructor
18:45:29 <andythenorth> ugh, xcode opens .cpp files
18:45:40 <andythenorth> xcode has no line numbers, how is this supposed to be an IDE?
18:46:16 <Alberth> perhaps Apple believes line numbers are not relevant :p
18:46:43 <Wolf01> SDTG_VAR("transparency_options", SLE_UINT, SLF_NOT_IN_SAVE | SLF_NO_NETWORK_SYNC, 0, _globals->GetTransparency(), <- this fucks me out
18:47:31 <Alberth> looks like that comes from a tales/*.ini file?
18:47:37 *** Progman has joined #openttd
18:47:58 <milek7> what's good graphical text editor?
18:47:59 <milek7> i opened 3kl file with sublime/pluma/atom/chromium/firefox
18:48:17 <milek7> and the only one that is perfectly smooth while scrolling is firefox...
18:49:25 <Alberth> I don't understand what you need to know
18:49:55 <Wolf01> What to put in place of the old global variable, because c++ don't like what I pasted
18:49:57 <Alberth> SDTG_VAR is a macro that folds it arguments into some struct, with defaults for all the values you didn't supply
18:50:26 <milek7> eh, i have keyboard with cursor keys so don't need weird vi modes
18:50:37 <Zuu> andythenorth: On windows alt+G or ctrl+G usually open a dialog to enter the line number in IDEs. Duno what key that would be on a mac. And no idea if xcode would follow that pattern.
18:51:14 <Alberth> Wolf01: perhaps the macro takes the address?
18:51:24 <andythenorth> ok this group collapse UI works
18:51:27 <andythenorth> but the counts don’t
18:51:35 <Alberth> Check pre-processor output
18:51:54 <Alberth> or track #define of SDTG_VAR & friends
18:51:58 <Wolf01> expression must be an lvalue or a function designator
18:52:23 <Alberth> lvalue means "something you can write a value into"
18:52:37 <Alberth> no idea what "function designator" means
18:53:02 <Alberth> well, &func would be valid
18:53:23 <Alberth> but likely you don't want a pointer to the getter function :p
18:53:27 <frosch123> you cannot put a getter or setter into the SDTG stuff
18:53:33 <frosch123> it must be a reference to the real variable
18:53:45 <_dp_> can go getter for reference
18:54:14 <andythenorth> collapsible groups is probably better eh?
18:54:21 <andythenorth> if we’re going to have sub-groups
18:54:52 <Wolf01> <frosch123> it must be a reference to the real variable <- Ha! Then I fail
18:58:34 <peter1138> that's a patch for it ;p
19:01:02 <Zuu> Not really doing anytihng with OpenTTD at the moment other than visiting the forum a few times a year and this channel.
19:03:58 <andythenorth> still looks like a useful patch
19:04:08 <andythenorth> Wolf01: 5208 - scenario stuff from console
19:04:22 <Zuu> But it looks like there is a patch, and I honestly doesn't remember this FS task.
19:04:58 <Zuu> But it is probably from my tutorial work.
19:05:06 <Wolf01> andythenorth: could be nice to have
19:10:32 <supermop_home> is there an easy way to dectect drive-on side?
19:10:35 *** JacobD88 has joined #openttd
19:10:53 <supermop_home> or do I need to have a parameter to set what side you want the doors to open on
19:12:16 <andythenorth> supermop_: or…don’t worry about it? o_O
19:12:26 <supermop_home> I already drew all the doors
19:12:28 <Wolf01> Ok, I miss only the SDTG_VAR stuff...
19:13:04 <Wolf01> But not now, must go outside to eat stuff
19:15:32 <luxtram> Hi, I am reading the source and I am wondering what is the meaning of the mode parameter of TrainLocoHandler. Any pointers?
19:17:00 <frosch123> iirc that function is called multiple times per tick
19:17:07 <frosch123> mode is the iteration number or something
19:19:40 <frosch123> it needs to be called multiple times, since trains can move faster than 1 coordinate per tick
19:20:00 <frosch123> on the first iteration it likely does some more stuff that during the other
19:26:19 <Zuu> andythenorth: How many many more open tasks am I responsible for ... hm I can look that up ... 5 in total. :-)
19:28:50 <Zuu> I don't feel anything in particular for any of those at the moment and I can always open new ones if I feel for, so close them if you like to. :-)
19:31:05 <luxtram> ok, but how does it help to call it twice really and why it is not possible to satisfy the situation with a single call?
19:31:24 <frosch123> it moves the train my one step on every call
19:31:35 <frosch123> and needs to check train collision, end of track and stuff
19:32:23 <frosch123> possibly it can be done better, by first checking with only the front how far you can drive
19:32:28 <frosch123> and then moving everything
19:32:39 <frosch123> but it's not exactly easy code :p
19:33:56 <luxtram> so the train always moves two steps during a tick?
19:34:15 <frosch123> depends on its speed :p
19:34:23 <frosch123> at 0 km/h it does not move any steps
19:34:39 <frosch123> planes iirc can move up to 4 steps per tick
19:43:11 *** supermop has joined #openttd
19:47:04 <supermop> can I put an if thing around a sprite group?
19:47:38 <planetmaker> real sprites are unconditional
19:48:15 <Zuu> Oh.. was thinking about to go out, but now it rains hevily at 45 degree angle. Good I didn't get out for a walk. :-)
19:48:16 <planetmaker> I think no. You need to decide on different sprite groups depending on parameter
19:48:57 <planetmaker> supermop, think of it as such: the sprites cannot be in the newgrf and not in the newgrf at the same time
19:49:25 <frosch123> supermop: everything which you could in an if-condition, you can also put into a switch
19:49:25 <planetmaker> they must always be there - but you can choose not to show them
19:53:05 <Alberth> time to practice your 45 degrees walk, Zuu :)
19:54:42 <frosch123> ah, that's why the brittish are so obsessed with the silly-walks-business
19:54:51 <Zuu> It is now more normal only a few degrees angled rain.
19:57:25 <supermop> I have my traffic side switch at the bottom of that
20:05:52 <andythenorth> we practice dodging raindrops around here
20:11:37 <frosch123> andythenorth: make a patch that adds it to known_bugs.txt
20:12:11 <frosch123> we document "won't fix" stuff there
20:12:28 <Eddi|zuHause> i'd debate whether this is a bug at all
20:12:41 <Eddi|zuHause> looks more like a feature request
20:12:45 <frosch123> even more a reason for known_bugs then
20:12:50 <andythenorth> is there any particular order to known_bugs.txt ?
20:13:29 <Eddi|zuHause> of course there's the follow-up bug that payment will be screwed up
20:13:57 <andythenorth> delete neutral stations?
20:14:06 <frosch123> andythenorth: apprently sorted by fs number
20:14:34 <andythenorth> there is a proposal for bouy stations
20:14:40 <planetmaker> I guess it can be closed. It's not exactly a bug
20:14:40 <andythenorth> player owned iirc
20:14:52 <planetmaker> and I like the behaviour
20:14:58 <andythenorth> bouy stations would eliminate need for industry built-in stations
20:15:12 <andythenorth> but I can’t think of any savegame migration strategy :(
20:15:30 <Eddi|zuHause> andythenorth: wasted effort, i think
20:15:33 <andythenorth> nor how to handle helicopters
20:15:49 <Eddi|zuHause> plus, people actually want more neutral stations (like city-owned airports)
20:17:10 <andythenorth> people actually also want reliable cargodist
20:17:16 <andythenorth> lots of things ;D
20:17:45 <V453000> planetmaker: if you told me 4 years ago that I would eventually voluntarily learn programming, I would have told you that you are insane :)
20:17:52 <andythenorth> V453000: you are insane
20:18:04 <V453000> I wouldn't have been wrong, but you would be rihgt ;P
20:18:22 <V453000> andythenorth: you are insane
20:18:59 <Eddi|zuHause> postulate: there are no sane people
20:20:00 <V453000> any suggestions how to name parameters as in the shortcuts? since I am using c-s, it is not easy to use something sensible :D
20:20:10 <andythenorth> my editor makes tabs into spaces :P
20:21:00 <V453000> depends on settings :) in factorio we use 2 so I keep it
20:21:07 <Eddi|zuHause> python suggestion is to use 4 spaces for indent
20:21:28 <Eddi|zuHause> i don't know. it's what it is
20:21:47 <V453000> I will use 2 for heresy
20:21:55 <Alberth> 2 is not enough, 3 doesn't quite work with the 8 of a TAB, 4 is nice
20:21:57 <_dp_> it's called pep8 a standard for code formatting in python
20:22:25 <Eddi|zuHause> there's no hard reason to actually follow pep8, though :p
20:22:40 <peter1138> tabs are useful when you use variable width fonts ;p
20:23:24 <Eddi|zuHause> peter1138: how does that have any influence on indentation, though?
20:23:35 <planetmaker> hihi @ V453000 :)
20:23:45 <planetmaker> but then... you are :P
20:23:50 <_dp_> Eddi|zuHause, exept every other python programmer picking on you for not following standards :p
20:23:55 <planetmaker> but what changed your mind? what do you learn?
20:26:25 <andythenorth> patch probably ‘breaks’ some FIRS industries
20:27:01 <Alberth> planetmaker: V is somewhat infacted with the "automate everything" virus from andy :)
20:28:43 <frosch123> except V is in level 1, where you automate stuff which you would do by hand otherwise
20:28:57 <frosch123> while andy is in level 5, where you automate automating automating automating automating thing
20:29:30 <Eddi|zuHause> you should meta-level that, so you automate reducing the layers of automation
20:30:05 <andythenorth> I think V453000 has actually surpassed me by some measure
20:30:29 <andythenorth> frosch123: 4754 patch does what it says on the tin: ‘fixes’ rivers in desert a bit, and probably breaks newgrf industries
20:30:40 <andythenorth> pursue, or dead?
20:35:44 <frosch123> at some point i wanted to move half-desert into the map array
20:36:08 <supermop> what about snowy desert
20:36:30 <Alberth> it's never night in openttd
20:40:14 <andythenorth> 7 year old asked for day night cycle
20:40:26 <Zuu> Or support for telestick so we can turn of the lights in the room?
20:40:28 <andythenorth> I told him totally dark made it hard to see the trains :P
20:40:37 <andythenorth> I get all the regular feature requests here
20:40:45 <andythenorth> we could close FS and forums, and get it all from one 7 year old
20:40:46 <frosch123> andythenorth: the only thing worse than day/night in a video game is weather
20:41:11 <andythenorth> I told him we’d have to remake all the sprites (he’s drawing trains now so he knows it’s work)
20:41:18 <frosch123> actually, since i no longer use solar power, i should disable it again in f
20:41:20 <andythenorth> he said we could just take screenshots and tint them with code
20:41:50 <frosch123> andythenorth: don't show nightgfx :)
20:42:00 <frosch123> lot's of thing are bright at night
20:42:04 <frosch123> which are not during daylight
20:42:42 <andythenorth> I would like night mode
20:42:50 <andythenorth> I would put the work into the sprites :P
20:42:56 <andythenorth> or at least…automating them
20:43:39 <planetmaker> oh, the automation-infection. I'm no stranger to that :D
20:43:41 <andythenorth> such heatshrink wrapping of cables
20:44:53 * andythenorth also lit a model train layout when much younger
20:45:15 * andythenorth should also write a ‘talking to V’ bot
20:45:29 <andythenorth> supermop: such content :)
20:46:15 <andythenorth> import random; swears = [list]; random.choice(swears)
20:46:35 <andythenorth> could pretty much automater
20:46:42 <andythenorth> window purples -> yellow
20:46:51 <andythenorth> headlight yellow -> yellow
20:47:00 <andythenorth> tail light red -> red
20:47:09 <andythenorth> everything else -> compression
20:47:20 <andythenorth> probably non-linear
20:47:28 <andythenorth> there’s probably an algorithm for it :P
20:48:38 <milek7> but roads should be lightened in patterns
20:49:22 <supermop> could use more cab styles and liveries, and a better panto
20:50:48 <andythenorth> michi_cc: peter1138 will do the roads
20:53:25 <supermop> if I up a tram's max speed does that break grf with previous versions?
20:54:04 <andythenorth> strictly it does, if you’re being purist
20:54:34 <supermop> realized my late 80s LRV isn't better enough than my 60s articulated tram
20:56:00 <supermop> also my ersatz Melbourne W class is too good
20:56:11 <supermop> it still is a good buy in 2000
20:58:58 <andythenorth> trams tend to evergreen
20:59:04 *** orudge` has joined #openttd
20:59:05 *** ChanServ sets mode: +o orudge`
20:59:20 * andythenorth wonders if “Landscape:” is a thing for grouping FS stuff
20:59:28 <andythenorth> seems to be a bit of that
20:59:41 <supermop> well the W class stills runs in melb
20:59:45 <frosch123> as in stuff for a potential newlandscape?
21:01:17 <andythenorth> nah, there’s not much in FS for it
21:01:27 <andythenorth> I wondered about making landscape gen pluggable
21:01:40 <supermop> i'll need to add a low floor property to make the old trams illegal after 2000
21:01:55 <andythenorth> eh, dumping raw C++ into mods…probably very very insecure? o_O
21:02:30 <V453000> that looks nice Alberth thanks :) I will digest it first though
21:02:33 <frosch123> how about dumping opengl shader code into newgrf :p
21:02:47 <frosch123> and wait until noone does opengl anymore :p
21:05:22 <V453000> /me discovered andythenorth's flicker
21:05:28 <V453000> some spectacular vehicles right there
21:06:17 <frosch123> i think i saw those
21:06:50 <frosch123> i think andy and wolf are on some legobook network or something
21:07:14 <planetmaker> lego... I'm mad at lego. The Saturn V set was sold out too soon
21:07:53 <planetmaker> available for like 2 weeks or so?
21:08:17 <frosch123> and doesn't wolf regulary get rid of old sets to make space for new?
21:08:18 <planetmaker> it came out in July. Dunno?
21:08:35 <peter1138> much earlier than july
21:08:45 <V453000> I suddenly feel completely normal
21:09:06 <peter1138> i nearly ordered one
21:09:13 <peter1138> but then decided i didn't need £110 of lego
21:09:14 <V453000> can't wait for daughter to grow so I could justify ordering one
21:09:41 <planetmaker> I decided I do... but thought I could spend that on an occasion like Christmas. So wrong :(
21:10:02 <peter1138> they made it very limited for no reason i guess
21:11:02 <andythenorth> V453000: lego is like pixels
21:11:24 <andythenorth> lack of true realism
21:13:07 <V453000> iz realizms though, in a way I like
21:13:15 <V453000> the shovel and stuff at the ends are giving it a really nice final touch
21:16:17 <V453000> Alberth: added it, script works :>
21:16:27 *** luxtram has joined #openttd
21:16:36 <V453000> btw andythenorth can I redistribute the generated palette you have in roadhog? :P under gplv2 ofc
21:17:27 <V453000> gg, you get credit for this spectatular piece of art
21:17:40 <milek7> why anyone cares about palettes in 2017?
21:17:45 *** orudge` has joined #openttd
21:17:46 *** ChanServ sets mode: +o orudge`
21:19:55 * andythenorth counting to 10 slowly
21:20:05 <V453000> milek7: openttd still won't run without some 8bpp even if you have 32bpp over it :P and as we discovered, apparently for many people the 32bpp is simply not an option due to performance
21:20:37 <V453000> + palette has some benefits too if you draw pixelz
21:21:30 <milek7> performance? framebuffer is anyway probably stored in at least 24bit
21:21:59 <V453000> well don't ask me why but even people with beastly computers sometimes have to me unexpected problems with running 32bpp
21:22:45 <andythenorth> how can I replicate this?
21:23:07 <andythenorth> I might make a special rule for TGP crap: you have to tell what settings were used
21:23:14 <andythenorth> that rule will definitely work
21:23:30 <planetmaker> andythenorth, savegame will tell
21:23:38 <andythenorth> title says 'default'
21:23:38 <planetmaker> but... not provided either :|
21:23:49 <planetmaker> default... default... that's a non-statement
21:23:49 * andythenorth tries to find defaults
21:24:13 <planetmaker> I also use default. But there's an openttd.cfg and then it doesn't care about defaults, but it uses the values stored there
21:24:29 <planetmaker> defaults are those which you get when you delete your openttd.cfg and have it rewritten by the game
21:24:34 <andythenorth> which size map, what water settings etc
21:24:45 <andythenorth> ok I’ll mv openttd.cfg
21:25:07 <planetmaker> but I'd not bet much on none of those being changed or set by the user
21:26:03 <andythenorth> and no rainforest
21:26:08 <andythenorth> so completely valid bug report
21:26:44 <supermop> my tiny tram from 1890 goes 80 kmh
21:26:50 <supermop> I think that is a mistake
21:27:39 <andythenorth> maybe it’s a pneumatique
21:27:47 <planetmaker> faster than a horse? That must be detrimental to the passenger's health!
21:28:12 <Eddi|zuHause> random progression i just thought of: 1890: 30km/h, 1920: 40km/h, 1950: 50km/h, 1980: 60km/h
21:28:12 <supermop> I don't enjoy playing with pitifully slow vehicles but ill need to make up some progression at least
21:28:31 <Eddi|zuHause> probably useless
21:28:36 <supermop> Eddi|zuHause sounds realistic,
21:28:54 <supermop> i think ill want 80 kmh by the 50s though to not be too boring
21:28:58 <Eddi|zuHause> 1980 should be more like 80km/h, but with inner-town speed limits
21:29:53 <andythenorth> I can’t get below 449 now
21:30:02 <supermop> is that km or miles andy?
21:51:46 *** ToBeFree has joined #openttd
21:53:15 *** orudge` has joined #openttd
21:53:15 *** ChanServ sets mode: +o orudge`
22:02:21 <andythenorth> how creaking is the UI part of groups (vehicles list)
22:02:32 *** sim-al2 has joined #openttd
22:02:48 <andythenorth> groups themselves are quite lame, but is the UI code a horrowshow, or ok?
22:20:26 <Wolf01> BTW yes, SE and game should be one way
22:20:38 <V453000> so how should I call my fancy conversion script
22:20:47 <V453000> Palletizer? :) Palletizator?
22:21:34 <Wolf01> Also, back on those SDTG_VAR
22:21:54 <Wolf01> I might need a workaround
22:21:58 <frosch123> V453000: downsampler
22:22:09 <V453000> no that sounds unsuperior frosch "D
22:22:22 <Wolf01> frosch123, any idea for a workaround?
22:22:37 <V453000> MAXIMAL_PALLETTE_CONVERTER_8D_BEST_OF
22:22:58 <frosch123> continuous-palette-transfunctionator?
22:23:17 <frosch123> Wolf01: just let the sameload stuff access the raw private data
22:23:32 <Wolf01> Yes I thought about it but meh
22:23:36 <frosch123> saveload does binary stuff, sizeof, offsetof, endian swapping, ...
22:24:14 <frosch123> Wolf01: openttd is no book about conservative oop
22:24:37 <frosch123> it's about breaking the rules when it benefits
22:24:57 <frosch123> V453000: hey-dude-wheres-my-palette?
22:26:12 <frosch123> ach, just call it slugette
22:26:54 <Wolf01> I'd put a comment "Needed for settings: don't use them in code, please"
22:29:15 <Wolf01> Uhmmm... what? It still throws error about _transparency_opt undeclared identifier when I replaced it
22:30:27 <Wolf01> Ooooh, misc_settings_ini not regenerated
22:34:22 <Wolf01> Or maybe I'm modifying the wrong file, I don't edit settings so much
22:35:32 <frosch123> transparency_opt probably should be a member of GUISettings
22:35:49 <frosch123> but iirc it's not possible to move all of the settings into _settings
22:36:06 <frosch123> the very early ones need to be separate or something
22:36:17 <frosch123> planetmaker: sounds like chocolate
22:36:30 <planetmaker> But I love chocolate, too :P
22:36:44 <frosch123> i considered ordering that slug-chocolate, but in the end it did not seem worth it
22:36:48 <Wolf01> Ok, compiled, run, access violation
22:41:02 <frosch123> 17 euro for 200g american chocolate of unknown quality seemed a bit steep
22:41:11 <planetmaker> the perfect gift for V :P
22:41:29 <planetmaker> but... uwe... American chocolate?
22:41:43 <LordAro> 5 Reallocated_Sector_Ct 0x0033 089 089 010 Pre-fail Always - 14400
22:41:48 <frosch123> it's no supermarket chocolate, you never know
22:42:13 <planetmaker> LordAro, just moving my home dir from one disk to another ;) one never knows...
22:43:30 <V453000> calling it RAINBOW_SLUG actually makes sense
22:44:45 <frosch123> V453000: yeah, but that name is already used
22:44:53 <planetmaker> the modelling is superb :)
22:46:07 <V453000> larger than I imagined
22:46:20 <frosch123> i think it's a different one
22:46:31 <frosch123> the other were 200g in 8 pieces
22:46:42 <frosch123> 25g is not that large
22:47:27 <planetmaker> ehm... sure that's 200g, frosch123 ?
22:47:55 <planetmaker> nasty, tiny dot :)
22:47:59 *** FLHerne has joined #openttd
22:48:36 <frosch123> planetmaker: you though 20kg? :o
22:49:29 <planetmaker> it didn't look like 20kg. When I saw 20kg I started to look closer at the text - and discovered the dot
22:49:48 <planetmaker> it's not that I have any relation to what 47 lbs or .47 lbs might be
22:50:37 <frosch123> i learned to measure butter in half pounds
22:51:38 <frosch123> 1 lbs is close enough to a 500g pound
22:53:32 <planetmaker> lbs doesn't even remotely look like "pound" though
22:54:34 <frosch123> well, i assume you are more used to M☉ :)
22:55:53 <Wolf01> Uhm... I can't understand why in settings.h _global is not instanciated
22:55:54 <frosch123> £ doesn't look like pound either
22:55:56 <planetmaker> honestly, in my daily work life I'm more used ot µg, and g than M_sun or M_earth
22:56:19 <planetmaker> that's different... currencies never resemble anything
22:56:45 <planetmaker> and it could be a symbiosis of S and t
22:57:03 <planetmaker> or maybe even not underlined
22:58:01 <frosch123> oh £ is actually an L
22:58:36 <frosch123> i never thought it would actually be an L desprite looking like one
22:59:12 <frosch123> and it's related to lira
22:59:25 <Wolf01> "a reasonable approximation can be made by typing an "f" over an "L"."
22:59:49 <frosch123> pff, tell them to bind caps lock to compose
22:59:55 <frosch123> or compose to caps lock?
23:00:29 <frosch123> yeah, the = represents stability :)
23:02:19 <frosch123> planetmaker: anyway, µg sounds like chemistry, i would have expected either astronomical units, or atomar units
23:03:18 <Wolf01> frosch123, do you have a moment to apply a patch and help me to spot an access violation?
23:03:39 <frosch123> i think i have a clean working copy
23:04:25 <DorpsGek> Commit by frosch :: r27896 /trunk/src (3 files in 3 dirs) (2017-08-20 23:04:21 +0200 )
23:05:06 <Wolf01> But if you remove ->GetInstance() from settings.ini it has _globals not initialized and throws access violation
23:05:21 <Wolf01> But _globals should be initialized at that point
23:05:28 <planetmaker> frosch123, how much does a single grain of sand weigh? How much a marble? That's my typical size scale :D
23:06:09 <frosch123> constructor workers use very different grain sizes of sand
23:06:38 <frosch123> Wolf01: doesn't compile
23:07:00 <frosch123> oh, i guess i need to patch sdl_v, which you do not compile on windows
23:09:08 <frosch123> #include "../globals.h"
23:09:36 <frosch123> Wolf01: warning: globals has non-virtual destructor
23:09:42 <Wolf01> Yes, I'm moving the globals
23:10:10 <frosch123> i definitely would move transparency settings to guisettings
23:10:26 <frosch123> gamemode and transparencysettings is completely unrelated
23:11:54 <Wolf01> So I should move only _game_mode, _switch_mode and _exit_game
23:12:10 <frosch123> yeah, those would seem related
23:12:12 <Eddi|zuHause> frosch123: but doesn't the title game have magic transparency values?
23:12:19 <Wolf01> Maybe renaming Globals => GameState
23:12:50 <frosch123> Eddi|zuHause: many, no pbs reserations, no breakdowns, ...
23:13:40 <frosch123> if you want to move everything that is different in title game to that class, you may have picked the wrong approach :)
23:14:01 <Wolf01> BTW, in case it would happen again, what could be that access violation? SDTG_VAR evaluated in another thread or such?
23:14:38 <Wolf01> _globals is initialized in the entry point
23:15:47 <frosch123> Wolf01: so, it compiled, what am i supposed to do next?
23:16:05 <Wolf01> Go into settings.ini and remove ->GetInstance()
23:16:11 <Wolf01> From transparency options
23:16:21 <frosch123> _globals->transparency_opt ?
23:16:50 <frosch123> why do you have _globals and Globals::_instance?
23:16:58 <Wolf01> Because it's a singleton
23:17:09 <frosch123> that answer makes no sense
23:17:17 <frosch123> you have a doubleton
23:17:28 <frosch123> _globals and Globals::_instance makes two
23:17:38 <Wolf01> I would like to remove the _global at the end
23:19:31 <Wolf01> I could ::GetInstance() everywhere, but it's long
23:20:08 <Eddi|zuHause> you need a get-method that autmatically creates the instance if it doesn't exist
23:20:38 <frosch123> Wolf01: also calling a static method with a instance pointer is kind of pointless
23:22:29 <LordAro> what is the advantage to having one massive global, as opposed to lots of little ones?
23:23:04 <frosch123> LordAro: wolf wants to create it with a factory to insert some mocks
23:23:18 <Eddi|zuHause> ideally, you would have no globals, but some sort of easily switchable context
23:23:28 <frosch123> or he wants to run two instaces of ottd in one task
23:24:06 <Wolf01> Don't give me weird ideas :P
23:27:16 <peter1138> load the map in 16x16 chunks
23:27:56 <frosch123> Wolf01: anyway, the settings stuff has static initialisation
23:28:27 <frosch123> it does &_globals->GetInstance()->transparency_lock or &_globals->transparenc_lock during static intialisation
23:28:35 <frosch123> which is way before openttd_main
23:28:44 <frosch123> so, _globals is NULL at that point
23:28:57 <frosch123> while the method forces the initialisation
23:29:09 <Wolf01> But why it didn't throw the exception until the end of openttd_main?
23:29:34 <frosch123> for me it segfaults in LoadFromConfig
23:29:58 <frosch123> precisely when it loads the settings, and tries to store them at NULL
23:30:13 <frosch123> well, NULL+offsetof(.., transparenc...)
23:30:48 <Wolf01> Ok, but _globals is before LoadFromConfig()
23:31:14 <frosch123> btw. this also means that SLEG will never work if you want to swap instances of _globals at runtime
23:31:56 <frosch123> Wolf01: yes, but _globals is not used during LoadFromConfig, but during static initialisation
23:32:02 <frosch123> which is before main()
23:32:52 <frosch123> when you call GetInstance in openttd_main it has already been called by misc_settings.ini
23:33:06 <frosch123> GetInstance is called before main() is called
23:33:26 <frosch123> Wolf01: read up on "static initialisation" :)
23:33:48 <frosch123> the stuff in SLEG is done during static initialisation
23:35:30 <Wolf01> Oh, because settings.h <-
23:36:25 <Wolf01> Aren't headers evaluated first?
23:36:39 <frosch123> SLEG is translated into "static const void* ptr_to_trans = &Globals::GetInstance()->transparency;
23:37:01 <frosch123> Wolf01: "headers" is no concept known to the compiler or linker
23:37:45 <frosch123> the point is that all "static" variables in global scope are initialised before main() is called
23:38:10 <frosch123> if you initialise _globals in main(), it is still NULL during static initialisation
23:38:31 <frosch123> if you call GetInstance() during static initialisation, that forces it to be called before main()
23:39:00 <Wolf01> Globals *_globals = Globals::GetInstance(); <- this could have done the trick?
23:39:23 <frosch123> no, that is a deep rabbit hole
23:39:40 <frosch123> if you then use _globals during static initialisation, you get undefined behaviour
23:40:26 <frosch123> you can't define whether _globals is assigned before or after the SLEG
23:40:30 <Wolf01> Right, it says that in "static initialization order fiasco"
23:41:05 <frosch123> if you want to dynamically allocate those globals, you either always use GetInstance
23:41:08 <frosch123> or you get rid of SLEG
23:41:10 <Eddi|zuHause> hence you need a property with a get method
23:41:18 <frosch123> for example by moving transparency to guisettings :p
23:43:07 <Eddi|zuHause> the point of a property is exactly to hide this call to GetInstance
23:44:17 <Wolf01> Better if I start again, I mangled too much this local repo
23:44:37 <frosch123> do you have a list of globals
23:44:55 <frosch123> or do you just handle them when you find one?
23:45:40 <Eddi|zuHause> just grep for variables starting with _?
23:46:42 <frosch123> i thought for "extern"
23:46:56 <Wolf01> I wanted to move most of them in Globals, but it doesn't make sense because 1) different scopes; 2) problem of usage like the settings one
23:47:22 <frosch123> ottd is a peaceful game
23:47:30 <V453000> graphics development isn't
23:47:55 <guru3> am I just thinking crazy? I seem to remember that the original TT music was different from TTDs, but don't want to install them both to figure it out -_-
23:48:12 <V453000> no would be INDEXOZER
23:48:26 *** FLHerne has joined #openttd
23:48:43 <V453000> we haz train crashes and wrecks
23:48:57 <Wolf01> Also, RIP Jerry Lewis :(
23:51:45 *** supermop has joined #openttd
continue to next day ⏵