IRC logs for #openttd on OFTC at 2019-06-11
⏴ go to previous day
00:00:59 <LordAro> the blue is very weird
00:04:33 <LordAro> as is the fullwidth posts
00:04:45 <LordAro> setting it to 75% works better, but is a hack
00:07:50 <nielsm> actually it feels slower to me
00:08:06 <nielsm> as in there seems to be some delays during loading where parts of the page are missing
00:10:16 *** andythenorth has left #openttd
00:14:32 <milek7_> that grey background is horrible
00:14:37 <milek7_> (not that it was better before)
00:27:58 *** Supercheese has joined #openttd
01:28:02 <Eddi|zuHause> what the hell happened to the forum layout?
01:34:28 <FLHerne> Presumably it needed a major update, and Owen hasn't fixed the theme yet?
01:34:51 <FLHerne> I run a small IPB forum and keep having the same issue
01:36:31 <FLHerne> There's not much overlap between the support lifecycles of releases, so with limited time the options are sometimes <semi-broken theme> or <insecure>
07:19:20 *** Speedy` has joined #openttd
08:35:55 *** andythenorth has joined #openttd
09:55:22 *** Flygon_ has joined #openttd
10:08:10 *** goodger has joined #openttd
11:32:27 *** somerandom has joined #openttd
11:33:17 <somerandom> hi all... i'm trying to generate larger then 4096*4096 maps but i cant find the correct setting in the source code. help please?
11:34:57 <nielsm> first consider the explosive complexity by doubling the number of tiles even more times and how it will impact the performance (which is already bad on large maps)
11:36:22 <nielsm> I think there may also be some places in the code that assume that a tile index fits within 20 bits or 24 bits which may break in unexpected ways if you increase it
11:37:22 <somerandom> yeah well... could i please at least try? please?
11:38:32 <somerandom> seriously, i have a dual socket xeon motherboard here with 96 gigabytes of ram
11:38:42 <nielsm> nobody cares about your number of CPUs
11:39:07 <nielsm> ottd is single-threaded and cannot be multithreaded due to the core structure of the simulation
11:39:30 <somerandom> aaaaw, there it is. previusly i tried genworld_gui.cpp with no luck
11:41:50 <nielsm> also look for game_creation.map_x and .map_y in table/settings.ini
11:42:11 <nielsm> though you probably don't need to change anything there
11:47:16 <somerandom> it breaks down here: assert_compile(lengthof(feedbacks) == 2 * MAX_MAP_SIZE_BITS - 2 * MIN_MAP_SIZE_BITS + 1);
11:47:57 <nielsm> yeah figure out what that "feedbacks" thing is and if it's something you can increase
11:49:05 <somerandom> i think i can manage that
11:51:51 <nielsm> thing is, all actions in OTTD are based around commands (which are also what is transmitted on the network protocol), and a command has just two 32 bit fields which are often bitstuffed
11:52:18 <nielsm> it also has a third 32 bit field for the target tile of the command, but some commands require two tile indexes, and if the second tile index is in a bitstuffed field
11:52:36 <nielsm> there may not be enough space in that field to expand the effective size of a tileindex
11:54:35 *** arikover has joined #openttd
11:57:16 <somerandom> second issue. land can be purchased only one tile at a time, while for example bulldozing can be done on larger areas.
11:57:42 <nielsm> I believe that's intentional to limit certain types of griefing
11:59:35 <somerandom> but... is there an easy way to implement the same function for purchasing land?
12:00:02 <somerandom> so its not only a copy-paste affair then?
12:00:17 <LordAro> OTTD is a complex program
12:00:34 <somerandom> i have some experience with c/c++ but not at this level
12:00:47 <LordAro> perfect opportunity to learn :)
12:01:19 <LordAro> any "fix" for land purchasing would involve the same limiting backoff factor that bulldozing has, except much more harshly
12:01:32 <LordAro> and even then it might get rejected
12:09:09 <somerandom> but seriously purchasing land tile by tile has been a pain for me since i started playing the original transport tycoon in the 90's
12:10:33 <LordAro> the issue is that it's a stupidly easy tool to abuse
12:11:07 <LordAro> and we don't really want to introduce differing behaviour between singleplayer & multiplayer
12:11:43 <LordAro> if you can come up with some solution to it, then great :)
12:11:57 <LordAro> but no one here has come up with anything in the last 15 years
12:22:12 <somerandom> what about tor support? say i'd want to run a multiplayer server as a tor hidden service?
12:24:39 <nielsm> can't that be done with a virtual loopback adapter the game listens on?
12:25:42 <LordAro> i'm not hugely familiar with tor, but i can't imagine that there's anything specific that OTTD needs to support
12:28:47 <somerandom> alright, 8192*8192 maps work with the original land generator. terra genesis says "map generation aborted... ... no suitable town locations". it appears it generates a whole lot of water
12:31:40 <nielsm> try in scenario editor instead, than you can get the terrain generated without towns and industries placed
12:31:47 <nielsm> see if it does something wrong
12:34:08 <LordAro> istr seeing a 8192x8192 patch in the past
12:34:20 <LordAro> i imagine it was dropped as "utterly impractical"
12:34:37 <LordAro> let's be honest, 4096 is stupid big already
12:35:10 <somerandom> in my experience its the upper limit for what can be regarded as practical
12:38:22 <LordAro> think this was mostly what got included in the game way back when
12:39:01 <somerandom> the scenario editor can generate flat land for 8k*8k maps but not truly random terrain
12:40:23 <somerandom> not a brilliant idea after all
12:41:56 <somerandom> you've been really helpful so far... can you now please tell me the file where the code for purchasing land is?
12:42:54 <nielsm> at least one _cmd.cpp and one _gui.cpp
12:44:38 <somerandom> terraform_gui.cpp?
12:44:45 <LordAro> i start by finding a string referencing the thing i want to find, then repeatedly search through the code until i find something relevant
13:01:36 <somerandom> do you have any documentation on the source code available at all?
13:03:20 <nielsm> not everything seems to be indexed and it's not always useful, but it's there
13:04:08 <LordAro> pretty sure that's not been updated in a year either
13:04:16 <LordAro> it never got set up properly
13:09:51 <Samu> wow what happened to the forum?
13:11:43 <FLHerne> somerandom: If you're just hacking it for your own use, you can always just feed it a heightmap?
13:56:59 *** andythenorth has joined #openttd
14:36:47 *** snail_UES_ has joined #openttd
15:05:51 *** techmagus has joined #openttd
15:29:37 <somerandom> aaaaaaaaaw you people use a glfsr for a pseudorandom number generation. shame on you. shame!
15:30:01 <somerandom> its patended unless i'm mistaking
15:30:40 <somerandom> overall its rather lousy to implement in software. i'm certain there are better alternatives
15:33:25 <somerandom> i might be the closest thing you have to a cryptographer. i might be able to come up with something else if you don't mind
15:34:09 <somerandom> but seriously... glfsr?
15:34:34 <somerandom> we were taught they are obsolete these days
15:39:23 *** tokai|noir has joined #openttd
15:39:23 *** ChanServ sets mode: +v tokai|noir
15:40:46 <Heiki> perhaps that’s why OpenTTD is seldom used for cryptography
15:41:33 <nielsm> yeah there's nothing that needs to be secure, it just needs to be unpredictable to the player
15:41:56 <nielsm> (and if someone wants to TAS the game and abuse the RNG they're welcome)
15:42:05 <LordAro> i for one, do all my banking with OTTD
15:42:59 <nielsm> the only argument I can think of for replacing the RNG would be a significant performance improvement in the game loop
15:43:07 <somerandom> and it also needs to be efficient. galois/fibonacci lfsr's are not efficient by todays standard. can i make a serious effort to improve your pseudorandom number generator?
15:43:59 <LordAro> s/glfsr/std::mt19937/ ?
15:44:07 <LordAro> it's not exactly a bottleneck
15:44:28 <nielsm> sure, as long as it will produce the same sequence on any machine a PR is welcome
15:44:41 <nielsm> but you probably need to demonstrate an actual performance improvement
15:44:58 <nielsm> (that is measured in more than microseconds per frame)
15:45:20 <LordAro> (or be significantly less code)
15:47:15 <somerandom> actually glfsr is less then ideal because it has a lot of numbers just sitting around doing very much nothing. i don't know about performance but it's more a question of memory.
15:47:58 <somerandom> i'm thinking more of elliptic curves.
15:49:51 <LordAro> neither rolling our own crypto or requiring openssl are particularly desirable
15:52:08 <somerandom> your current implementation... what does it use as seed?
15:54:19 <nielsm> the value stored in the savegame or received from the network server
15:55:06 <nielsm> the purpose of the RNG in the game is to provide a reproducible a sequence of numbers that will be the same on any client simulating the game world from the same initial state, given the same sequence of input
15:55:43 <somerandom> yes, that is the definition of a pseudorandom number generator
15:56:03 <somerandom> is the lfsr used for generating the world at the beginning of every game?
15:56:03 <nielsm> you keep talking about this like it's a question of security
16:00:22 <andythenorth> he mentioned patents first, to be fair :)
16:00:24 <somerandom> well... i'm a mathematician and cryptographer writing my masters thesis. i associate lfsr's with security, but openttd is obviously not a security software. what i'm saying is your current rng could probably be done better
16:00:58 <andythenorth> most things in ottd can
16:01:19 <somerandom> actually i'm under the impression glfsr is patented but i'm not sure. didn't find anything by googling once
16:06:06 <Corns[m]> q: what function(s) do i use to check if a tile is a plain water tile? e.g. it's a river or ocean tile with no occupying tiles (such as locks, docks)
16:07:20 <nielsm> Corns[m]: in the C++ code, or in AI, or where?
16:10:17 <somerandom> i ran out of ram experimenting. clearly 32k*32k is too much for my laptop
16:10:26 <somerandom> need to reboot. we will have to continue this later.
16:11:14 <Corns[m]> oh yeah i'm looking at it right now HAHA
16:11:28 <Corns[m]> buoys don't affect the tile class, do they?
16:11:39 <Corns[m]> also what constitutes a WATER_TILE_COAST tile?
16:11:49 <nielsm> buoys are station tiles
16:12:13 <nielsm> WATER_TILE_COAST are the "beach" tiles, the slopes down to ocean level
16:12:48 <Corns[m]> oh i see - does that include the diagonal cost tiles? i.e. the half land/half water tiles
16:13:33 <Corns[m]> i guess i can always test - thank you :)
16:21:32 <Corns[m]> yup buoys fail the IsWaterTile() function
16:24:31 <Corns[m]> wait so how would i check if a tile has a buoy on it?
16:26:04 <Corns[m]> answer: IsBuoyTile()
16:48:46 *** andythenorth has joined #openttd
17:07:30 *** sla_ro|master has joined #openttd
17:52:22 *** someguy has joined #openttd
17:53:14 <someguy> is the glfsr used for generating the world at the start of every game?
17:59:26 <LordAro> i imagine you can work that out as well as anyone else
18:01:57 *** HerzogDeXtEr has joined #openttd
18:02:30 <someguy> that's it. in the near future i'll start some serious effort to replace it for you.
18:11:01 *** Gustavo6046 has joined #openttd
18:13:36 <someguy> seriously. it's not only for you. i too benefit from doing so. something like this easily helps me in my masters thesis and even toward a ph.d
18:32:45 *** tycoondemon has joined #openttd
18:36:11 *** supermop_work has joined #openttd
19:41:30 <someguy> anyway, as i experimented, 32k*32k maps could technically work with enough ram. 64k*64k give a segmentation fault.
19:43:57 <dwfreed> if k is 1024, 64k * 64k would give you a number larger than could be represented in a 32 bit unsigned integer, unless the first tile is 0
19:44:15 <dwfreed> so if somebody used signed int, it would overflow
19:47:52 <LordAro> wouldn't necessarily segfault though :p
19:51:05 *** gelignite has joined #openttd
19:55:56 *** Progman has joined #openttd
19:57:00 <dwfreed> LordAro: it would give a tile count of -1
19:58:21 <FLHerne> someguy: Frankly, I don't see the point in trying to permit larger maps; even the current ones are too large for gameplay purposes
19:59:23 <FLHerne> Even with 15 active players, 4k^2 is enough for every company to essentially ignore all the others
19:59:54 <FLHerne> And of course for SP it's too large for anyone to really interact with more than a tiny fraction of it
20:00:15 <FLHerne> (no, dragging rails in straight lines directly over hills doesn't count... :-/)
20:01:23 <andythenorth> some people just want MOAR
20:01:32 * andythenorth would never ask for MOAR in newgrf :P
20:01:40 <FLHerne> The map just turns into a featureless repeating pattern of towns, with stuff scrawled on it arbitrarily
20:01:51 <milek7_> even ignoring gameplay sense, it is just too slow
20:01:56 <FLHerne> (the default mapgen doesn't help)
20:02:49 <FLHerne> 512^2, or even 1024^2, can be divided into distinctive areas with recognisable features
20:03:25 *** ChanServ sets mode: +v tokai
20:34:53 <andythenorth> what DID I do to make articulated trucks in Hog
20:35:02 <andythenorth> something about vehicles shorter than sprites
20:35:06 <andythenorth> and shifting offsets around :P
20:36:21 <someguy> there is a chance i remember incorrectly. either flfsr/glfsr or the geffe generator is patented. i'll have to check that out tomorrow
20:47:09 *** Thedarkb has joined #openttd
21:21:01 <supermop_work> andythenorth: whatever i did was clunky
21:21:09 <supermop_work> but i think I followed you
22:07:29 <andythenorth> hmm time to add some feldbahn eh
22:31:05 <andythenorth> peter1138 did you finish all Doom mods yet?
22:32:49 <DorpsGek> LordAro: peter1138 was last seen in #openttd 3 days, 9 hours, 25 minutes, and 25 seconds ago: <peter1138> titties are better now
22:33:07 <LordAro> didn't realise it had been quite so long
22:36:01 *** arikover has joined #openttd
23:10:26 *** andythenorth has left #openttd
23:24:02 *** rocky11384497 has joined #openttd
continue to next day ⏵